/* ═══════════════════════════════════════════════════════════
   CineDesk — Design System
   Dark Cinema Premium Theme
   ═══════════════════════════════════════════════════════════ */

/* ─── Reset & Base ────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Palette */
    --bg-primary:     #06060b;
    --bg-secondary:   #0d0d14;
    --bg-card:        rgba(16, 16, 24, 0.85);
    --bg-card-hover:  rgba(22, 22, 34, 0.95);
    --bg-filter:      rgba(10, 10, 18, 0.88);
    --bg-input:       rgba(255, 255, 255, 0.04);

    --accent:         #f5c518;
    --accent-dim:     #c9a200;
    --accent-glow:    rgba(245, 197, 24, 0.15);

    --text-primary:   #e8e8ec;
    --text-secondary: #8a8a9a;
    --text-muted:     #55556a;

    --border:         rgba(255, 255, 255, 0.06);
    --border-hover:   rgba(255, 255, 255, 0.12);

    --shadow-sm:      0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md:      0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg:      0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow:    0 0 30px rgba(245, 197, 24, 0.08);

    --radius-sm:      8px;
    --radius-md:      12px;
    --radius-lg:      16px;
    --radius-pill:    999px;

    --transition:     0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s ease;

    --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --max-width:      1400px;
    --gutter:         24px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--accent-dim);
}

/* ─── Custom Scrollbar ────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ─── Hero / Header ───────────────────────────────────── */
.hero {
    position: relative;
    padding: 80px var(--gutter) 48px;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245, 197, 24, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 20% 50%, rgba(100, 60, 255, 0.03) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(0, 180, 255, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: var(--max-width);
    margin: 0 auto;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.logo-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 12px rgba(245, 197, 24, 0.3));
}

.logo h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 36px;
    letter-spacing: 0.01em;
}

/* ─── Stats ───────────────────────────────────────────── */
.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
    transition: var(--transition);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* ─── Filters Bar ─────────────────────────────────────── */
.filters {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px var(--gutter);
    background: var(--bg-filter);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

.filters.scrolled {
    box-shadow: var(--shadow-md);
}

.filters-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.filters-mobile-header,
.search-filter-wrapper,
.filter-tools-collapse {
    display: contents;
}

.btn-toggle-filters-mobile {
    display: none;
}

/* ─── Filter Groups ───────────────────────────────────── */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* Type Pills */
.filter-tipo {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
}

.pill:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-input);
}

.pill.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
    box-shadow: 0 0 16px rgba(245, 197, 24, 0.2);
}

.pill-icon {
    flex-shrink: 0;
    stroke: currentColor;
}

/* Select Filters */
.filter-select {
    padding: 9px 36px 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%238a8a9a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 120px;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--accent-dim);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Search Input */
.filter-search {
    width: 240px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.filter-input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.filter-input:hover,
.filter-input:focus {
    border-color: var(--accent-dim);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.filter-input:focus ~ .search-icon,
.search-wrapper:focus-within .search-icon {
    color: var(--accent);
}

/* ─── Main Content ────────────────────────────────────── */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px var(--gutter) 80px;
    min-height: 50vh;
}

/* Results Bar */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 4px;
    gap: 12px;
}

.results-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ─── Card Grid ───────────────────────────────────────── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.card {
    position: relative;
    cursor: default;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    translate: 0 24px;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1) var(--stagger-delay, 0s),
                translate 0.6s cubic-bezier(0.4, 0, 0.2, 1) var(--stagger-delay, 0s),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.card.visible {
    opacity: 1;
    translate: 0 0;
}

.card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transform: scale(1);
    box-shadow: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) {
    .card:hover .card-inner {
        background: var(--bg-card-hover);
        border-color: var(--border-hover);
        transform: scale(1.025);
        box-shadow: var(--shadow-lg), var(--shadow-glow);
    }
}

/* Card Poster */
.card-poster {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--bg-secondary);
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Poster Gradient Overlay */
.card-poster::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(6, 6, 11, 0.8) 0%, transparent 100%);
    pointer-events: none;
}

/* No-poster placeholder */
.card-poster .no-poster {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #18182a 100%);
    color: var(--text-muted);
    font-size: 3rem;
}

/* Rating Badge */
.card-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    line-height: 1.3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.card-rating.high {
    background: rgba(16, 28, 20, 0.85);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.card-rating.mid {
    background: rgba(28, 26, 16, 0.85);
    color: var(--accent);
    border: 1px solid rgba(245, 197, 24, 0.4);
}

.card-rating.low {
    background: rgba(30, 18, 18, 0.85);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.card-tipo {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    z-index: 2;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(6, 6, 11, 0.75);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Card Body */
.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.card-generi {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.genre-tag {
    font-size: 0.7rem;
    color: #a855f7;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    line-height: 1;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: auto;
}

/* ─── Loading ─────────────────────────────────────────── */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Empty States ────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 20px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.empty-desc code {
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--accent);
    border: 1px solid var(--border);
}

/* ─── Load More ───────────────────────────────────────── */
.load-more {
    display: block;
    margin: 40px auto 0;
    padding: 14px 48px;
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-pill);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.02em;
}

.load-more:hover {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 0 24px rgba(245, 197, 24, 0.25);
    transform: translateY(-1px);
}

.load-more:active {
    transform: translateY(0);
}

/* ─── Footer ──────────────────────────────────────────── */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(6, 6, 11, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid var(--border);
    padding: 10px var(--gutter);
    text-align: center;
    z-index: 500;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer p {
    font-size: 0.76rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: var(--accent);
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 1024px) {
    .filters-mobile-header,
    .search-filter-wrapper,
    .filter-tools-collapse {
        display: flex;
    }
    
    .btn-toggle-filters-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-primary);
        border-radius: var(--radius-pill);
        padding: 8px;
        cursor: pointer;
        flex-shrink: 0;
        height: 38px;
        width: 38px;
    }

    .filters-inner {
        gap: 12px;
        flex-direction: column;
        align-items: stretch;
    }

    .filters-mobile-header {
        flex-direction: column;
        width: 100%;
        gap: 12px;
        align-items: stretch;
    }

    .filter-tipo {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        padding-bottom: 4px;
        margin-right: 0;
        scrollbar-width: none;
        display: flex;
        justify-content: flex-start;
    }
    .filter-tipo::-webkit-scrollbar {
        display: none;
    }

    .search-filter-wrapper {
        width: 100%;
        display: flex;
        gap: 12px;
        align-items: flex-end;
    }

    .search-filter-wrapper .filter-search {
        flex: 1;
        width: auto;
        min-width: 0;
    }

    .filter-tools-collapse {
        display: none;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        padding-bottom: 8px;
    }
    
    .filter-tools-collapse.show {
        display: flex;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 48px var(--gutter) 32px;
    }

    .stats {
        gap: 16px;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .filters {
        position: relative !important;
        top: auto !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Rimuovi backdrop-filter su mobile per velocizzare lo scroll */
    .card-rating,
    .card-tipo,
    .card-btn-action {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .card-rating.high {
        background: rgba(16, 28, 20, 0.96) !important;
    }
    .card-rating.mid {
        background: rgba(28, 26, 16, 0.96) !important;
    }
    .card-rating.low {
        background: rgba(30, 18, 18, 0.96) !important;
    }
    .card-tipo {
        background: rgba(6, 6, 11, 0.92) !important;
    }
    .card-btn-action {
        background: rgba(13, 13, 20, 0.96) !important;
    }

    .filter-tipo {
        justify-content: space-between;
    }
    .pill {
        padding: 7px 14px;
        font-size: 0.8rem;
    }
    .filter-tipo .pill:not(.active) .pill-text {
        display: none;
    }

    .filter-group {
        flex: 1;
        min-width: calc(50% - 8px);
    }



    .custom-dropdown-menu {
        min-width: 100% !important;
    }


    .grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .card-body {
        padding: 12px;
    }

    .card-title {
        font-size: 0.85rem;
    }

    .card-desc {
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    :root {
        --gutter: 16px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card-desc {
        display: none;
    }

    .footer {
        padding: 6px 8px;
    }

    .footer p {
        font-size: clamp(9px, 2.7vw, 11px);
        letter-spacing: -0.015em;
        white-space: nowrap;
    }
}

/* ─── Animations ──────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        translate: 0 24px;
    }
    to {
        opacity: 1;
        translate: 0 0;
    }
}

/* Stagger animation for cards */
.card:nth-child(1)  { animation-delay: 0.02s; --stagger-delay: 0.02s; }
.card:nth-child(2)  { animation-delay: 0.04s; --stagger-delay: 0.04s; }
.card:nth-child(3)  { animation-delay: 0.06s; --stagger-delay: 0.06s; }
.card:nth-child(4)  { animation-delay: 0.08s; --stagger-delay: 0.08s; }
.card:nth-child(5)  { animation-delay: 0.10s; --stagger-delay: 0.10s; }
.card:nth-child(6)  { animation-delay: 0.12s; --stagger-delay: 0.12s; }
.card:nth-child(7)  { animation-delay: 0.14s; --stagger-delay: 0.14s; }
.card:nth-child(8)  { animation-delay: 0.16s; --stagger-delay: 0.16s; }
.card:nth-child(9)  { animation-delay: 0.18s; --stagger-delay: 0.18s; }
.card:nth-child(10) { animation-delay: 0.20s; --stagger-delay: 0.20s; }
.card:nth-child(11) { animation-delay: 0.22s; --stagger-delay: 0.22s; }
.card:nth-child(12) { animation-delay: 0.24s; --stagger-delay: 0.24s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .card {
        opacity: 1;
        transform: none;
    }
}

/* ─── Page Layout (main + sidebar) ───────────────────── */
.page-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 0;
    max-width: var(--max-width);
    margin: 0 auto;
    align-items: start;
}

.page-layout .main {
    max-width: none;
    margin: 0;
    padding: 24px 24px 80px var(--gutter);
    min-width: 0; /* evita overflow in grid */
}

/* ─── Sidebar Raccomandazioni ─────────────────────────── */
.rec-sidebar {
    position: sticky;
    top: 73px; /* altezza filtri */
    padding: 20px 16px 20px 8px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.rec-sidebar::-webkit-scrollbar { width: 4px; }
.rec-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* Header sidebar */
.rec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.rec-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.rec-header-title svg {
    color: var(--accent);
    filter: drop-shadow(0 0 6px rgba(245,197,24,0.4));
}

.rec-header-actions {
    display: flex;
    gap: 4px;
}

.rec-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.rec-btn-icon:hover {
    border-color: var(--accent-dim);
    color: var(--accent);
    background: var(--accent-glow);
}

.rec-loading {
    display: none;
    justify-content: center;
    padding: 20px 0;
}

.rec-sidebar.loading .rec-loading {
    display: flex;
}

.rec-sidebar.loading .rec-list {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Onboarding */
.rec-onboard {
    text-align: center;
    padding: 24px 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.01);
}

.rec-onboard-icon {
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 12px;
}

.rec-onboard-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.rec-onboard-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Barra di Progresso Onboarding */
.rec-progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-pill);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.rec-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-dim) 0%, var(--accent) 100%);
    border-radius: var(--radius-pill);
    box-shadow: 0 0 8px var(--accent-glow);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Recommendation Cards ────────────────────────────── */
.rec-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rec-card {
    display: flex;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: default;
    transform: translateX(0);
    translate: 0 0;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
    animation: fadeInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.rec-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(-2px);
}

@keyframes fadeInRight {
    from { opacity: 0; translate: 12px 0; }
    to   { opacity: 1; translate: 0 0; }
}

/* Poster piccolo */
.rec-poster {
    position: relative;
    width: 52px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    overflow: hidden;
}

.rec-dismiss-btn {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 14px;
    line-height: 1;
    transition: all var(--transition-fast);
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.card:hover .rec-dismiss-btn,
.rec-card:hover .rec-dismiss-btn,
.rec-modal-card:hover .rec-dismiss-btn {
    opacity: 1;
    pointer-events: auto;
}

.rec-dismiss-btn:hover {
    background: #f87171;
    border-color: #f87171;
    color: #fff;
    transform: translateX(-50%) scale(1.1);
}

.rec-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rec-no-poster {
    width: 52px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #18182a 100%);
}

/* Info */
.rec-info {
    flex: 1;
    padding: 8px 10px 8px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.rec-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Badge match */
.rec-match {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: var(--radius-pill);
    line-height: 1.4;
}

.rec-match.match-high {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.rec-match.match-mid {
    color: var(--accent);
    background: rgba(245, 197, 24, 0.06);
    border: 1px solid rgba(245, 197, 24, 0.2);
}

.rec-match.match-low {
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
}

.rec-match.match-discovery {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.08);
    border: 1px solid rgba(192, 132, 252, 0.2);
}

/* Rating inline */
.rec-rating {
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
}
.rec-rating.high { color: #4ade80; }
.rec-rating.mid  { color: var(--accent); }
.rec-rating.low  { color: #f87171; }

.rec-title {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-genre {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Responsive sidebar ──────────────────────────────── */
@media (max-width: 1024px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .page-layout .main {
        padding: 24px var(--gutter) 80px;
    }

    .rec-sidebar {
        position: static;
        max-height: none;
        padding: 24px var(--gutter) 24px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 16px;
        order: -1;
    }

    /* Su mobile la lista diventa orizzontale scrollabile */
    .rec-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
        scrollbar-width: none;
    }
    .rec-list::-webkit-scrollbar { display: none; }

    .rec-card {
        min-width: 130px;
        flex-direction: column;
        border-radius: var(--radius-md);
        gap: 0;
    }

    .rec-poster {
        width: 100%;
        height: auto;
        aspect-ratio: 2 / 3;
    }

    .rec-poster img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .rec-no-poster {
        width: 100%;
        height: auto;
        aspect-ratio: 2 / 3;
    }

    .rec-info {
        padding: 10px;
    }

    .card .rec-dismiss-btn,
    .rec-card .rec-dismiss-btn,
    .rec-modal-card .rec-dismiss-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 768px) {
    .rec-card {
        min-width: 130px;
    }
}

/* ─── Watchlist Pill Badge ────────────────────────────── */
.watchlist-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    margin-left: 6px;
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.pill.active .watchlist-badge-count {
    background: var(--bg-primary);
    color: var(--accent);
    border-color: var(--accent);
}

/* ─── Card Actions Overlay (Thumbs & Watchlist) ───────── */
.card-actions-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--transition), transform var(--transition);
}

.card:hover .card-actions-overlay,
.card:has(.card-btn-action.active) .card-actions-overlay {
    opacity: 1;
    transform: translateY(0);
}

.card-btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    background: rgba(13, 13, 20, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.card-btn-action.btn-thumb-up {
    border-color: rgba(74, 222, 128, 0.25);
}

.card-btn-action.btn-thumb-down {
    border-color: rgba(248, 113, 113, 0.25);
}

.card-btn-action.btn-watchlist {
    border-color: rgba(245, 197, 24, 0.3);
}

.card-btn-action:hover {
    color: var(--text-primary);
    transform: scale(1.1);
    background: rgba(22, 22, 34, 0.95);
}

.card-btn-action.btn-thumb-up:hover {
    border-color: rgba(74, 222, 128, 0.6);
}

.card-btn-action.btn-thumb-down:hover {
    border-color: rgba(248, 113, 113, 0.6);
}

.card-btn-action.btn-watchlist:hover {
    border-color: rgba(245, 197, 24, 0.7);
}

/* Stato attivo - Watchlist */
.card-btn-action.btn-watchlist.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(245, 197, 24, 0.4);
}

/* Stato attivo - Thumbs Up */
.card-btn-action.btn-thumb-up.active {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.4);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.2);
}

/* Stato attivo - Thumbs Down */
.card-btn-action.btn-thumb-down.active {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.4);
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.2);
}

/* Nascondi i pulsanti non attivi quando il mouse si allontana dalla card (solo su dispositivi con mouse) */
@media (hover: hover) {
    .card:not(:hover) .card-actions-overlay .card-btn-action:not(.active),
    .rec-modal-card:not(:hover) .card-actions-overlay .card-btn-action:not(.active) {
        display: none;
    }
}


/* Su mobile, mostra sempre parzialmente le azioni per facilitare il touch */
@media (max-width: 1024px) {
    .card-actions-overlay {
        opacity: 0.9;
        transform: none;
    }
}

/* ─── Modal Consigli Espansi ──────────────────────────── */
#rec-expand {
    display: none;
}
.rec-sidebar.has-recs #rec-expand {
    display: flex;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 8, 0.85);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    background: linear-gradient(135deg, rgba(16, 16, 28, 0.98) 0%, rgba(8, 8, 14, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-glow), 0 0 50px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--accent);
    text-transform: uppercase;
    min-width: 0;
    flex-shrink: 1;
}

.modal-title svg {
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(245,197,24,0.5));
}

.modal-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal-close:hover {
    border-color: #f87171;
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

/* Griglia raccomandazioni nel modal */
.rec-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .rec-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .rec-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .rec-grid {
        grid-template-columns: 1fr;
    }
}

/* Card raccomandazione nel modal */
.rec-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transform: scale(1);
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background 0.45s ease,
                border-color 0.45s ease,
                box-shadow 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.4s ease,
                max-height 0.5s ease,
                margin 0.5s ease,
                padding 0.5s ease;
}

.rec-modal-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: scale(1.025);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.rec-modal-poster-wrapper {
    position: relative;
    aspect-ratio: 2/3;
    width: 100%;
    background: var(--bg-secondary);
    overflow: hidden;
}

.rec-modal-poster-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
}




.rec-modal-no-poster {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #18182a 100%);
}

.rec-modal-rating {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    z-index: 5;
}

.rec-modal-rating.high { color: #4ade80; }
.rec-modal-rating.mid  { color: var(--accent); }
.rec-modal-rating.low  { color: #f87171; }

.rec-modal-tipo {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    z-index: 5;
}

.rec-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.rec-modal-match-badge {
    align-self: start;
}

.rec-modal-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

.rec-modal-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
}

.rec-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.rec-modal-genre {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.rec-modal-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Mostra overlay azioni su hover nel modal card */
.rec-modal-card:hover .card-actions-overlay,
.rec-modal-card:has(.card-btn-action.active) .card-actions-overlay {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .rec-modal-card .card-actions-overlay {
        opacity: 0.9;
        transform: none;
    }
}

/* Custom Dropdown Menus */
.custom-dropdown {
    position: relative;
    display: block;
    width: 100%;
    font-family: var(--font);
    font-size: 0.85rem;
}

.custom-dropdown-value {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.custom-dropdown-trigger:hover,
.custom-dropdown.active .custom-dropdown-trigger {
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: rgba(255, 255, 255, 0.06);
}

.custom-dropdown-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: transform var(--transition-fast);
    color: var(--text-secondary);
}

.custom-dropdown.active .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    padding: 6px;
    backdrop-filter: blur(12px);
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.custom-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
}

.custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.custom-dropdown.active .custom-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-dropdown-item {
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.custom-dropdown-item.selected {
    background: rgba(245, 197, 24, 0.1);
    color: var(--accent);
    font-weight: 500;
}

/* Skip onboarding button */
.rec-btn-skip {
    display: block;
    margin: 14px auto 0 auto;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.rec-btn-skip:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
    border-color: var(--accent-dim);
}

/* Custom Confirm Dialog */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 8, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.confirm-container {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(135deg, rgba(20, 20, 32, 0.98) 0%, rgba(12, 12, 20, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg), var(--shadow-glow), 0 0 50px rgba(0,0,0,0.6);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-overlay.active .confirm-container {
    transform: scale(1) translateY(0);
}

.confirm-header {
    display: flex;
    align-items: center;
}

.confirm-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.confirm-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.confirm-btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    outline: none;
}

.confirm-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.confirm-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.confirm-btn-ok {
    background: var(--accent);
    color: #000;
    font-weight: 600;
}

.confirm-btn-ok:hover {
    background: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* ─── Detail Modal Styles ───────────────────────────── */
.detail-modal-container {
    width: 100%;
    max-width: 1280px;
    height: 92vh;
}

.detail-modal-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.detail-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100%;
    overflow: hidden;
}

.detail-sidebar {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.detail-sidebar::-webkit-scrollbar {
    width: 4px;
}
.detail-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.detail-poster {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    aspect-ratio: 2/3;
    object-fit: cover;
}

.detail-no-poster {
    width: 100%;
    aspect-ratio: 2/3;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.detail-meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.9rem;
}

.detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-meta-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-meta-value {
    color: var(--text-primary);
    font-weight: 500;
}

.detail-main {
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.detail-main::-webkit-scrollbar {
    width: 6px;
}

.detail-main::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.detail-title-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-tagline {
    font-style: italic;
    color: var(--accent);
    opacity: 0.9;
    font-size: 1.05rem;
}

.detail-overview {
    line-height: 1.6;
    color: var(--text-primary);
    opacity: 0.95;
}

.detail-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    border-left: 3px solid var(--accent);
    padding-left: 8px;
}

/* Video Trailer Responsivo */
.detail-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.detail-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Cast List */
.detail-cast-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.detail-cast-member {
    flex: 0 0 75px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-cast-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.detail-cast-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    margin-bottom: 1px;
}

.detail-cast-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

/* Loading Detail Spinner */
.detail-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    gap: 16px;
    color: var(--text-secondary);
}

/* Responsività */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }
    .modal-header {
        padding: 12px 16px;
    }
    .modal-title {
        font-size: 1.1rem;
    }
    .detail-header-actions {
        margin-right: 12px;
    }
    .detail-header-actions .detail-actions {
        gap: 8px;
    }
    .detail-actions .card-btn-action {
        width: 38px;
        height: 38px;
    }
    .detail-actions .card-btn-action svg {
        width: 18px;
        height: 18px;
    }
    .detail-modal-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: var(--radius-md);
    }
    .detail-grid {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        height: 100%;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.08) transparent;
    }
    .detail-grid::-webkit-scrollbar {
        width: 6px;
    }
    .detail-grid::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.1);
        border-radius: 3px;
    }
    .detail-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 20px;
        align-items: center;
        text-align: center;
        overflow: visible;
        flex-shrink: 0;
    }
    .detail-poster {
        max-width: 200px;
    }
    .detail-meta-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    .detail-main {
        padding: 20px;
        overflow: visible;
    }
}

/* Pulsanti d'azione nel Detail Modal */
.detail-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
}

.detail-actions .card-btn-action {
    position: static;
    opacity: 1;
    transform: none;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.detail-actions .card-btn-action svg {
    width: 20px;
    height: 20px;
}

.detail-actions .card-btn-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.detail-header-actions {
    margin-left: auto;
    margin-right: 20px;
    flex-shrink: 0;
}

.detail-header-actions .detail-actions {
    margin-top: 0;
}

/* TV Series and Program Badge styling */
.tv-series-badge-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
    margin-bottom: 24px;
}

.tv-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.tv-badge:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.tv-badge .badge-icon {
    font-size: 1rem;
}

.tv-badge .badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    display: inline-block;
}

/* Status variants */
.tv-badge.status-in-corso .badge-dot {
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.tv-badge.status-terminato .badge-dot {
    background: #94a3b8;
}

.tv-badge.status-cancellato .badge-dot {
    background: #f87171;
    box-shadow: 0 0 8px #f87171;
}

.tv-badge.status-in-produzione .badge-dot {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.tv-badge.episode-badge {
    border-color: rgba(245, 197, 24, 0.2);
    background: rgba(245, 197, 24, 0.02);
}

.tv-badge.episode-badge strong {
    color: var(--accent);
}

/* Pulsante Trailer */
.btn-play-trailer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.btn-play-trailer:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
}

.btn-play-trailer:active {
    transform: translateY(0);
}

.btn-play-trailer svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Badge dei Generi */
.genres-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    margin-bottom: 4px;
}

.genre-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.genre-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Modale Trailer */
.trailer-modal-container {
    max-width: 900px;
    width: 90%;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #000;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.trailer-modal-container .modal-header {
    background: rgba(16, 16, 28, 0.95);
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trailer-modal-container .modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

/* ─── Notifiche Campanella e Dropdown ────────────────── */
.filter-notifications {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 100;
    flex: none;
    min-width: auto;
    width: auto;
}

@media (max-width: 768px) {
    .filter-notifications {
        top: 16px;
        right: 16px;
    }
}

.notification-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.notification-bell-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(245, 197, 24, 0.05);
    transform: scale(1.05);
}

@keyframes bell-shake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    45% { transform: rotate(-10deg); }
    60% { transform: rotate(5deg); }
    75% { transform: rotate(-3deg); }
    85% { transform: rotate(0); }
}

.notification-bell-btn.has-new svg {
    animation: bell-shake 1.5s infinite;
    color: var(--accent);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff4d4d;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notifications-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
}

.notifications-dropdown-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-clear-notifications {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all var(--transition);
}

.btn-clear-notifications:hover {
    background: rgba(245, 197, 24, 0.1);
}

.notifications-list {
    overflow-y: auto;
    flex: 1;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.notification-item-poster {
    width: 36px;
    height: 54px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #0d0d14;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.notification-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.notification-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-item-date {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.notification-empty {
    padding: 36px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

@media (max-width: 580px) {

    
    .notifications-dropdown {
        position: fixed;
        top: 60px;
        left: var(--gutter);
        right: var(--gutter);
        width: auto;
        max-height: 70vh;
    }
}

/* Forzatura filtri su un'unica riga per desktop */
@media (min-width: 1025px) {
    .filters-inner {
        flex-wrap: nowrap !important;
        gap: 8px;
    }
    .filter-tipo {
        gap: 4px;
    }
    .pill {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    .custom-dropdown {
        min-width: 140px;
        width: auto !important;
        display: inline-block !important;
    }
    .custom-dropdown-trigger {
        padding: 9px 10px;
    }
    .filter-search {
        min-width: 120px;
    }
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 56px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition);
}

.back-to-top-btn:hover {
    transform: translateY(-2px) scale(1.05);
    background: var(--accent-dim);
    box-shadow: 0 8px 24px rgba(245, 197, 24, 0.3);
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* ─── PWA Install Banner ────────────────────────────── */
.pwa-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: calc(100% - 48px);
    max-width: 500px;
    background: rgba(13, 13, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 1000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.pwa-banner.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-banner-content {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pwa-icon {
    color: var(--accent);
    flex-shrink: 0;
}

.pwa-banner-text h3 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.pwa-banner-text p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.pwa-banner-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.pwa-btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pwa-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.pwa-btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pwa-btn-primary:hover {
    background: var(--accent-dim);
    box-shadow: 0 4px 12px rgba(245, 197, 24, 0.2);
}

@media (min-width: 769px) {
    .pwa-banner {
        left: auto;
        right: 24px;
        transform: translateY(100px);
        width: 400px;
    }
    .pwa-banner.visible {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ─── Contenitore Top Right (Notifiche + Auth) ────────────────── */
.header-top-right {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .header-top-right {
        top: 16px;
        right: 16px;
        gap: 8px;
    }
}

/* Modifica .filter-notifications per stare nel flex container */
.filter-notifications {
    position: static !important;
    top: auto !important;
    right: auto !important;
}

/* Area Utente e Pulsanti Auth */
.btn-auth-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    height: 40px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition);
}

.btn-auth-trigger:hover {
    border-color: #e50914;
    background: rgba(229, 9, 20, 0.1);
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.2);
}

.btn-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #e50914, #9a050d);
    color: #ffffff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all var(--transition);
}

.btn-user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
}

.user-profile-dropdown-wrapper {
    position: relative;
}

.user-dropdown-menu {
    position: absolute;
    top: 50px;
    right: 0;
    width: 240px;
    background: #101016;
    border: 1px solid #20202c;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
    animation: fadeInDropdown 0.2s ease;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-header p {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-divider {
    height: 1px;
    background: #20202c;
    margin: 4px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    transition: all var(--transition);
}

.user-dropdown-item:hover {
    background: rgba(229, 9, 20, 0.1);
    color: #ffffff;
}

/* Modals di Autenticazione (Popup Premium) */
.auth-modal-overlay {
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    background: rgba(0, 0, 0, 0.75) !important;
}

.auth-modal-container {
    max-width: 440px !important;
    width: calc(100% - 32px) !important;
    background: linear-gradient(135deg, #121218 0%, #0a0a0f 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    padding: 36px 32px 36px 32px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(229, 9, 20, 0.1) !important;
    position: relative;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease !important;
    overflow: visible !important;
}

.auth-modal-overlay.active .auth-modal-container {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
}

.auth-modal-container .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.auth-modal-container .modal-close:hover {
    background: rgba(229, 9, 20, 0.2);
    color: #ffffff;
    transform: rotate(90deg);
}

/* Premium Title Gradient */
.auth-header {
    margin-bottom: 16px;
}

.auth-header h2 {
    margin: 0 0 8px;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #a2a2b5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.auth-header p {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* Form Styles */
.auth-box form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-box .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-box .form-row {
    display: flex;
    gap: 12px;
}

.auth-box .form-row .form-group {
    flex: 1;
}

.auth-box label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-box input {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    color: #ffffff !important;
    font-size: 0.95rem !important;
    transition: all 0.25s ease !important;
    outline: none;
}

.auth-box input:focus {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: #e50914 !important;
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.25) !important;
}

/* Autofill fixes */
.auth-box input:-webkit-autofill,
.auth-box input:-webkit-autofill:hover, 
.auth-box input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #121218 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}

.auth-remember input[type="checkbox"] {
    accent-color: #e50914;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.auth-options {
    display: flex;
    justify-content: flex-end;
}

.auth-link {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.auth-link:hover {
    color: #e50914;
}

/* Submit Button */
.btn-auth-submit {
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%) !important;
    border: none;
    border-radius: 10px !important;
    padding: 16px !important;
    color: #ffffff !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    cursor: pointer;
    margin-top: 6px !important;
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.4) !important;
    transition: all 0.3s ease !important;
}

.btn-auth-submit:hover {
    background: linear-gradient(135deg, #ff1e27 0%, #d80b15 100%) !important;
    box-shadow: 0 6px 25px rgba(229, 9, 20, 0.6) !important;
    transform: translateY(-2px) !important;
}

.btn-auth-submit:active {
    transform: translateY(0) !important;
}

.auth-footer {
    margin-top: 16px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: #e50914;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Settings Modal */
.settings-modal-container {
    max-width: 420px !important;
}

.settings-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 0 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 20px;
}

.settings-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    background: linear-gradient(135deg, #e50914, #b20710);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    box-shadow: 0 4px 16px rgba(229, 9, 20, 0.35);
}

.settings-profile-info h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.settings-profile-info p {
    margin: 0;
    font-size: 0.82rem;
    color: #64748b;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}

.settings-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 7px;
    padding: 10px 16px;
    font-size: 0.83rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.settings-tab svg {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.settings-tab.active {
    background: rgba(229, 9, 20, 0.12);
    color: #e50914;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.settings-tab.active svg {
    opacity: 1;
}

.settings-tab:hover:not(.active) {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
}

.settings-tab-content.auth-box form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Toast Notifications */
#toast-container {
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    user-select: none;
}

@keyframes slideInToast {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToast {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
