/**
 * Sidebar Modules Styling - Phase 3.2
 * Responsive Styling für produktspezifische Sidebar-Module
 */

/* ========================================
   CONTAINER LAYOUT
   ======================================== */

.ha-product-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    grid-column: 1 / -1;
    margin-top: var(--spacing-lg);
}

.ha-sidebar-module {
    background: var(--bg-card, #1c2333);
    border: 1px solid var(--border-color, #30363d);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.ha-sidebar-module:hover {
    box-shadow: var(--shadow-md);
}

.ha-sidebar-module h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--accent-orange, #FF6B35);
    border-bottom: 2px solid var(--accent-orange, #FF6B35);
    padding-bottom: var(--spacing-sm);
}

/* ========================================
   MODULE: QUICK STATS
   ======================================== */

.ha-module-quick-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

.ha-stat-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color, #30363d);
    align-items: center;
}

.ha-stat-item:last-child {
    border-bottom: none;
}

.ha-stat-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary, #8b949e);
}

.ha-stat-value {
    font-weight: 600;
    font-size: 1rem;
    color: var(--accent-orange, #FF6B35);
    text-align: right;
}

/* ========================================
   MODULE: AMAZON LINKS
   ======================================== */

.ha-module-amazon-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.ha-button-amazon {
    background: linear-gradient(135deg, #FF9900 0%, #FF6B35 100%);
    color: white;
    border: none;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.ha-button-amazon:hover {
    background: linear-gradient(135deg, #FFA500 0%, #FF7A45 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.ha-button + .ha-button {
    margin-top: var(--spacing-sm);
}

.ha-amazon-info {
    background: var(--bg-secondary, #161b22);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary, #8b949e);
}

.ha-amazon-info strong {
    color: var(--accent-orange, #FF6B35);
    font-family: 'Courier New', monospace;
}

/* ========================================
   MODULE: ALTERNATIVES
   ======================================== */

.ha-alternatives-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.ha-alternative-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color, #30363d);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary, #161b22);
    transition: all 0.2s ease;
}

.ha-alternative-item:hover {
    border-color: var(--accent-orange, #FF6B35);
    background: var(--bg-card, #1c2333);
}

.ha-alternative-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.ha-alt-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ha-alt-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.ha-alt-info h4 a {
    color: var(--accent-orange, #FF6B35);
    text-decoration: none;
    transition: color 0.2s;
}

.ha-alt-info h4 a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.ha-alt-price {
    font-weight: 600;
    color: var(--accent-orange, #FF6B35);
    font-size: 1rem;
}

.ha-button-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    align-self: flex-start;
    white-space: nowrap;
}

/* ========================================
   MODULE: CATEGORIES
   ======================================== */

.ha-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ha-categories-list li {
    border-bottom: 1px solid var(--border-color, #30363d);
}

.ha-categories-list li:last-child {
    border-bottom: none;
}

.ha-categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    color: var(--accent-orange, #FF6B35);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ha-categories-list a:hover {
    color: var(--color-primary-dark);
    padding-left: var(--spacing-sm);
}

.ha-count {
    background: var(--accent-orange, #FF6B35);
    color: var(--accent-orange, #FF6B35);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ========================================
   MODULE: POPULAR
   ======================================== */

.ha-popular-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.ha-popular-item {
    padding: var(--spacing-md);
    border: 1px solid var(--border-color, #30363d);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary, #161b22);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.ha-popular-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-orange, #FF6B35) 0%, var(--color-secondary) 100%);
}

.ha-popular-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-primary, #e6edf3);
}

.ha-popular-item h4 a {
    color: var(--accent-orange, #FF6B35);
    text-decoration: none;
    transition: color 0.2s;
}

.ha-popular-item h4 a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.ha-popular-item small {
    color: var(--text-secondary, #8b949e);
    font-size: 0.85rem;
}

/* ========================================
   RESPONSIVE: TABLET (640px - 1024px)
   ======================================== */

@media (max-width: 1024px) {
    .ha-product-sidebar {
        grid-column: 1 / -1;
        margin-top: var(--spacing-lg);
    }

    .ha-sidebar-module {
        padding: var(--spacing-md);
    }

    .ha-alternative-item {
        grid-template-columns: 70px 1fr;
    }

    .ha-alternative-item img {
        width: 70px;
        height: 70px;
    }

    .ha-stat-item {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========================================
   RESPONSIVE: MOBILE (<640px)
   ======================================== */

@media (max-width: 640px) {
    .ha-product-sidebar {
        gap: var(--spacing-md);
    }

    .ha-sidebar-module {
        padding: var(--spacing-md);
        margin: 0 calc(var(--spacing-md) * -1);
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .ha-sidebar-module h3 {
        font-size: 1rem;
        margin: 0 0 var(--spacing-md) 0;
    }

    /* Quick Stats */
    .ha-stat-item {
        grid-template-columns: 1fr;
        gap: 0;
        padding: var(--spacing-sm) 0;
    }

    .ha-stat-label {
        display: block;
        font-size: 0.85rem;
    }

    .ha-stat-value {
        text-align: left;
        font-size: 1.1rem;
    }

    /* Amazon Links */
    .ha-button-amazon {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .ha-module-amazon-links {
        gap: var(--spacing-sm);
    }

    /* Alternatives */
    .ha-alternative-item {
        grid-template-columns: 60px 1fr;
    }

    .ha-alternative-item img {
        width: 60px;
        height: 60px;
    }

    .ha-alt-info h4 {
        font-size: 0.9rem;
    }

    .ha-button-small {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Categories */
    .ha-categories-list a {
        padding: var(--spacing-md) 0;
        font-size: 0.95rem;
    }

    .ha-count {
        padding: 2px 6px;
        font-size: 0.75rem;
    }

    /* Popular */
    .ha-popular-item {
        padding: var(--spacing-md);
    }

    .ha-popular-item h4 {
        font-size: 0.9rem;
    }

    .ha-popular-item small {
        font-size: 0.8rem;
    }
}

/* ========================================
   BUTTONS & LINKS
   ======================================== */

.ha-button {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--accent-orange, #FF6B35);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.ha-button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.ha-button-secondary {
    background: var(--border-color, #30363d);
    color: var(--accent-orange, #FF6B35);
}

.ha-button-secondary:hover {
    background: var(--accent-orange, #FF6B35);
    color: white;
}

/* ========================================
   UTILITIES
   ======================================== */

.ha-color-border {
    color: var(--border-color, #30363d);
}

.ha-color-text-secondary {
    color: var(--text-secondary, #8b949e);
}

.ha-font-small {
    font-size: 0.85rem;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@media (prefers-reduced-motion: no-preference) {
    .ha-sidebar-module,
    .ha-alternative-item,
    .ha-categories-list a,
    .ha-button {
        transition: all 0.3s ease;
    }

    .ha-button:hover,
    .ha-alternative-item:hover {
        transform: translateY(-2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ha-sidebar-module,
    .ha-alternative-item,
    .ha-categories-list a,
    .ha-button {
        transition: none;
    }

    .ha-button:hover,
    .ha-alternative-item:hover {
        transform: none;
    }
}
