:root {
    /* Colors */
    --background-primary: #050505;
    --background-secondary: #0a0a0a;
    --surface-chat-user: #1A1A1A;
    --surface-chat-agent: transparent;
    --accent-primary: #E50914;
    --accent-hover: #F40612;
    --text-primary: #FFFFFF;
    --text-secondary: #A3A3A3;
    --border-subtle: #262626;
    --error-state: #FF3B30;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing & Radii */
    --chat-bubble-radius: 16px;
    --movie-card-radius: 12px;
    --button-radius: 8px;
    --layout-padding: 24px;
    
    /* Transitions */
    --transition-quick: 200ms ease-out;
    --transition-smooth: 600ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-physical: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ambient Background */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #050505;
    background-size: cover;
    background-position: center;
    transition: background-image 2s ease-in-out, background 1.5s ease;
}

.ambient-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.4);
    z-index: 1;
}

.ambient-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(5,5,5,0.95) 100%);
    z-index: 2;
}

/* Content Nebula (Floating Masonry Start Screen) */
.content-nebula {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-auto-rows: 20px;
    gap: 20px;
    padding: 20px 0 60px 0;
    perspective: 1000px;
    opacity: 1 !important; /* Ensure nebula always stays visible */
    visibility: visible !important;
}

.nebula-card {
    grid-row-end: span 12;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease, opacity 0.6s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    animation: nebulaEntry 0.8s backwards, floatingCard 6s infinite ease-in-out 0.8s;
    opacity: 1; /* Ensure cards stay visible after animation */
}

@keyframes nebulaEntry {
    from { 
        opacity: 0; 
        transform: translateY(40px) scale(0.9) rotateX(-10deg); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1) rotateX(0); 
    }
}

.nebula-card:nth-child(even) {

    grid-row-end: span 15;
    animation-delay: -1s;
    animation-duration: 7s;
}

.nebula-card:nth-child(3n) {
    grid-row-end: span 10;
    animation-delay: -2.5s;
    animation-duration: 8s;
}

@keyframes floatingCard {
    0%, 100% { transform: translateY(0) rotateX(0) rotateY(0); }
    50% { transform: translateY(-15px) rotateX(2deg) rotateY(-1deg); }
}

.nebula-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.nebula-card:hover {
    transform: translateY(-20px) scale(1.05) rotateX(0) rotateY(0);
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(229, 9, 20, 0.2);
    border-color: rgba(229, 9, 20, 0.4);
}

.nebula-card:hover img {
    opacity: 1;
    transform: scale(1.1);
}

.nebula-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 15px 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9) 60%, rgba(0,0,0,1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-align: center;
}

.nebula-card:hover .nebula-info {
    opacity: 1;
}

.nebula-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nebula-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.ambient-background.horror { background: radial-gradient(circle at center, #2e0505 0%, #050505 100%); }
.ambient-background.action { background: radial-gradient(circle at center, #2e1a05 0%, #050505 100%); }
.ambient-background.sci-fi { background: radial-gradient(circle at center, #052e2e 0%, #050505 100%); }
.ambient-background.comedy { background: radial-gradient(circle at center, #1a2e05 0%, #050505 100%); }
.ambient-background.romance { background: radial-gradient(circle at center, #2e051a 0%, #050505 100%); }



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

body.chat-mode-active {
    overflow: hidden;
}

/* Header Styles */
.header {
    height: 72px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(5, 5, 5, 0.6);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: flex;
    align-items: center;
}

.header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--layout-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    font-family: 'Inter', sans-serif;
}

.logo-accent {
    color: var(--accent-primary);
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.header-nav {
    display: flex;
    gap: 12px;
}

/* Category Dropdown */
.category-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-quick);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 10px;
    margin-top: 10px;
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform-origin: top right;
    animation: dropdownAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.category-dropdown:hover .dropdown-menu,
.category-dropdown:focus-within .dropdown-menu {
    display: flex;
}

.dropdown-menu .nav-pill-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 10px 15px;
}

.dropdown-menu .nav-pill-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-pill-btn {
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-quick);
}

.nav-pill-btn.active {
    background: #111;
    border-color: var(--accent-primary);
}


.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-quick);
}

.icon-btn:hover {
    color: var(--text-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-subtle);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main App Layout */
.app-view {
    display: flex;
    flex: 1;
    overflow: auto;
    height: 100%;
}

.player-container {
    flex: 2;
    background: #000;
    position: relative;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    z-index: 10;
    border-radius: 16px;
    overflow: hidden;
    margin: 20px;
}

/* Webtor Preloader */
.webtor-preloader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px);
    transition: opacity 1s ease;
    z-index: 5;
}

.preloader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.pulse-loader {
    width: 60px;
    height: 60px;
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    margin-bottom: 20px;
    animation: pulseLoader 2s infinite;
}

@keyframes pulseLoader {
    0% { transform: scale(0.8); opacity: 0.8; box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.4); }
    70% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 20px rgba(229, 9, 20, 0); }
    100% { transform: scale(0.8); opacity: 0.8; box-shadow: 0 0 0 0 rgba(229, 9, 20, 0); }
}

/* Mobile Touch Shield */
#touchShield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 99;
    display: none;
}

body.active.mobile-sheet-open .player-container #touchShield {
    display: block;
}

#player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Chat Canvas */
.chat-canvas {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: var(--layout-padding);
    padding-bottom: 60px;
    position: relative;
    border-left: 1px solid var(--border-subtle);
}

/* Body Layout States */
body.active .chat-canvas {
    flex: 1;
    order: -1;
    border-right: 1px solid var(--border-subtle);
    border-left: none;
    transition: var(--transition-physical);
    max-width: 100%;
}

/* Side-by-side layout only when playing */
body.active.playback .chat-canvas {
    flex: 0 0 38%;
    max-width: 38%;
}

body.active.playback .player-container {
    flex: 0 0 62%;
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transition: var(--transition-physical);
}

body.active .player-container {
    display: none; /* Hide by default in active mode until playback starts */
}

body.active .chat-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, var(--background-primary) 80%, transparent);
    z-index: 50;
    transition: var(--transition-physical);
    display: flex;
    justify-content: center;
}

body.active.playback .chat-footer {
    width: 38%;
    border-right: 1px solid var(--border-subtle);
    justify-content: flex-start;
}

/* Playback State */
body.playback .chat-canvas,
body.playback .chat-footer {
    opacity: 0.4;
    transition: opacity 0.4s ease;
}

body.playback .chat-canvas:hover,
body.playback .chat-footer:hover {
    opacity: 1;
}

body.idle .player-container {
    opacity: 0;
    pointer-events: none;
    display: none;
}

body.idle .chat-canvas {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: var(--layout-padding);
    padding-bottom: 150px;
    scroll-behavior: smooth;
    position: relative;
    border-left: 1px solid var(--border-subtle);
}

/* Chat Search result-filter-bar */
.result-filter-bar {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: 16px 20px;
    margin: -24px -24px 24px -24px;
    display: flex;
    gap: 10px;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none; /* Only show when body is active */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0; /* CRITICAL: Prevent shrinking */
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.result-filter-bar::-webkit-scrollbar {
    display: none;
}

body.active .result-filter-bar {
    display: flex;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-quick);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0; /* Prevent squashing on mobile */
    white-space: nowrap; /* Keep text on one line */
}

.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.filter-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-btn .badge {
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Filtering logic via CSS classes */
body[data-filter="movie"] .message.agent:not(.type-movie):not(.general-response) { display: none; }
body[data-filter="anime"] .message.agent:not(.type-anime):not(.general-response) { display: none; }
body[data-filter="tv"] .message.agent:not(.type-tv):not(.general-response) { display: none; }

/* Discovery View */
.discovery-view {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 200px;
}

.discovery-section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--accent-primary);
    font-size: 0.9rem;
}

/* Waterfall Loader for Discovery Grids */
.loader-waterfall {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    height: 40px;
    margin: 20px auto;
}

.loader-waterfall span {
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: waterfall 1s ease-in-out infinite;
}

.loader-waterfall span:nth-child(2) { animation-delay: 0.1s; }
.loader-waterfall span:nth-child(3) { animation-delay: 0.2s; }
.loader-waterfall span:nth-child(4) { animation-delay: 0.3s; }
.loader-waterfall span:nth-child(5) { animation-delay: 0.4s; }

@keyframes waterfall {
    0%, 100% { transform: scaleY(0.3); opacity: 0.3; }
    50% { transform: scaleY(1); opacity: 1; }
}

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

.discovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    min-height: 240px;
}

.discovery-card {
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 2/3;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.discovery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.discovery-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 24px 15px 15px;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.discovery-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.discovery-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.discovery-card:hover .discovery-card-info {
    opacity: 1;
}

@media (max-width: 500px) {
    .discovery-card-info {
        opacity: 1; /* Always show on mobile slides */
        bottom: 20%;
        width: 80%;
        background: rgba(15, 15, 15, 0.75);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 24px;
        padding: 20px 15px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .discovery-title {
        font-size: 1.4rem;
        font-weight: 700;
    }
    .discovery-meta {
        font-size: 0.9rem;
        font-weight: 600;
    }
}


body.idle .empty-state {
    display: none;
}

body.idle .chat-footer {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: transparent;
    padding: 0;
    z-index: 100;
}

.quick-suggestions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.quick-suggestions .dot {
    opacity: 0.3;
}

body.idle .suggestions-container {
    margin-bottom: 32px;
}

/* Responsive Layout */
@media (max-width: 1024px) {
    .app-view {
        flex-direction: column;
    }
    
    .player-container {
        flex: none;
        width: 100%;
        height: 56.25vw; /* 16:9 */
    }
    
    .chat-canvas {
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        overflow-y: auto; /* Enable vertical scrolling */
        flex: 1; /* Allow it to grow */
    }

    body.active .chat-canvas,
    body.active .player-container {
        flex: none;
        width: 100%;
    }

    body.active .chat-footer {
        width: 100%;
        left: 0;
        bottom: 20px; /* Floating look */
        border: none;
        height: auto;
        overflow: visible;
        background: transparent;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 20px;
        box-shadow: none;
        position: fixed; /* Fixed positioning for stable footer */
        z-index: 50; /* Ensure it stays on top */
    }

    body.active .input-wrapper {
        border-radius: 50px; /* Perfect elliptical shape */
        width: 100%;
        max-width: 600px;
        background: rgba(10, 10, 12, 0.9);
        backdrop-filter: blur(30px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        padding: 8px 12px 8px 24px;
    }

    .chat-footer::before {
        content: '';
        width: 40px;
        height: 4px;
        background: var(--border-subtle);
        border-radius: 2px;
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        display: none;
    }

    body.active .chat-footer::before {
        display: block;
    }

    .message-list {
        padding-bottom: 80px;
    }

    .movie-card {
        scroll-snap-align: center;
        margin-top: 16px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: var(--background-secondary);
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        height: auto;
        min-height: auto;
        display: flex;
        flex-direction: row; /* Horizontal layout like desktop */
    }

    .movie-poster {
        width: 120px;
        min-width: 120px;
        height: 180px;
        object-fit: cover;
        flex-shrink: 0;
    }

    .movie-details {
        padding: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex: 1;
        min-width: 0;
    }

    .movie-title {
        font-size: 1.25rem;
        font-weight: 800;
        margin-bottom: 6px;
        letter-spacing: -0.02em;
        color: #fff;
    }

    .movie-metadata {
        display: flex;
        gap: 12px;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-secondary);
        margin-bottom: 12px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .movie-synopsis {
        font-size: 0.85rem;
        color: #aaa;
        margin-bottom: 16px;
        line-height: 1.6;
    }

    .movie-synopsis.clamped {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .movie-synopsis.clamped.movie-only {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .read-more-btn {
        background: transparent;
        border: none;
        color: var(--accent-primary);
        font-size: 0.8125rem;
        font-weight: 600;
        cursor: pointer;
        padding: 0;
        margin-top: -12px;
        margin-bottom: 16px;
        display: none;
    }

    .read-more-btn:hover {
        text-decoration: underline;
    }

    .meta-item {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .rating { color: #FFD700; }

    .movie-actions {
        display: flex;
        gap: 10px;
    }

    .message-list {
        display: block;
        scroll-snap-type: none; /* Remove mandatory snapping */
        overflow-y: scroll; /* Allow natural scrolling */
        height: auto; /* Let content expand */
        min-height: calc(100dvh - 200px); /* Minimum for usability */
        padding-bottom: 100px; /* Extra space for fixed footer */
    }

    .message {
        max-width: 100%;
        height: auto; /* Allow messages to expand naturally */
    }
}

/* Mobile Discovery Slideshow (< 500px) */
@media (max-width: 500px) {
    html.idle,
    body.idle {
        overflow: hidden !important;
        height: 100dvh !important;
        width: 100vw !important;
        position: fixed !important;
        touch-action: none !important; /* Block all touch interaction by default, we will enable it for the grid */
    }

    .header {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 100%;
        background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
        border-bottom: none;
        z-index: 1000;
    }

    body.idle .chat-canvas {
        overflow: hidden !important;
        padding: 0 !important;
        height: 100dvh !important;
        width: 100vw !important;
        border: none !important;
        position: relative !important;
    }

    body.idle .discovery-view {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        width: 100vw;
        padding-bottom: 0;
        overflow: hidden;
        position: absolute;
        top: 0;
        left: 0;
    }

    /* Hide message-list in idle mobile mode to prevent gap */
    body.idle .message-list {
        display: none !important;
    }

    body.idle .discovery-section {
        height: 100dvh;
        width: 100vw;
        flex: 1;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        position: relative;
    }

    /* Hide secondary sections on mobile to give Trending full-screen focus */
    body.idle .discovery-section:not(:first-of-type) {
        display: none !important;
    }

    /* Hide section title on mobile for cleaner look */
    body.idle .section-title {
        display: none;
    }

    /* Ensure first section (Trending) is always visible */
    body.idle .discovery-section:first-of-type {
        display: flex !important;
        flex-direction: column !important;
    }

    body.idle .section-title {
        position: absolute;
        top: 85px; /* Below absolute header */
        left: 20px;
        z-index: 20;
        background: rgba(229, 9, 20, 0.8);
        padding: 4px 12px;
        border-radius: 4px;
        backdrop-filter: blur(8px);
        font-size: 0.65rem;
        pointer-events: none;
        border: none;
        color: #fff;
        font-weight: 900;
    }

    body.idle .discovery-grid {
        height: 100dvh !important;
        width: 100vw !important;
        flex: 1;
        display: flex !important; /* Force display even when empty */
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        gap: 0;
        margin-bottom: 0;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x !important; /* ONLY allow horizontal panning */
        min-height: 240px; /* Ensure minimum height for loading state */
    }

    body.idle .discovery-grid::-webkit-scrollbar {
        display: none;
    }

    /* Ensure error messages are visible on mobile */
    body.idle .discovery-grid p {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 80% !important;
        text-align: center !important;
        font-size: 1rem !important;
        z-index: 10 !important;
    }

    body.idle .discovery-card {
        flex: 0 0 100vw;
        height: 100dvh; /* Full viewport height */
        width: 100vw;
        border-radius: 0;
        border: none;
        scroll-snap-align: center;
        transform: none !important;
        background: #0a0a0c;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        margin: 0;
        padding: 0;
        position: relative;
        overflow: hidden;
    }

    /* Full-bleed background image */
    body.idle .discovery-card img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 0;
        transform: none !important;
    }

    /* Blending metadata overlay */
    body.idle .discovery-card-info {
        position: absolute;
        bottom: 10%;
        left: 0;
        right: 0;
        background: linear-gradient(to top, 
            rgba(0, 0, 0, 0.98) 0%, 
            rgba(0, 0, 0, 0.9) 50%, 
            rgba(0, 0, 0, 0.7) 70%, 
            transparent 100%);
        padding: 100px 25px 40px; /* Pushed content much higher */
        display: flex;
        flex-direction: column;
        align-items:center;
        text-align: center;
        z-index: 1;
        backdrop-filter: blur(1px);
        -webkit-backdrop-filter: blur(1px);
    }

    body.idle .discovery-title {
        font-size: 1.5rem;
        font-weight: 800;
        color: #ffffff;
        margin-bottom: 12px;
        line-height: 1.3;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
        letter-spacing: 0.5px;
        max-width: 90%;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    }

    body.idle .discovery-meta {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.95);
        background: transparent;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        padding: 8px 20px;
        border-radius: 50px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    }

    body.idle .discovery-meta span:first-child {
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    body.idle .discovery-meta span:last-child {
        font-weight: 700;
        color: #ffd700;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    body.idle .discovery-meta i {
        font-size: 0.9em;
    }

    /* Watch Button for Mobile Discovery - Top Right Position */
    body.idle .watch-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        background: linear-gradient(135deg, var(--accent-primary) 0%, #ff1f3a 100%);
        border: none;
        color: white;
        padding: 10px 24px;
        border-radius: 50px;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 4px 15px rgba(229, 9, 20, 0.5);
        text-transform: uppercase;
        z-index: 10;
    }

    body.idle .watch-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(229, 9, 20, 0.7);
        background: linear-gradient(135deg, #ff1f3a 0%, var(--accent-primary) 100%);
    }

    body.idle .watch-btn:active {
        transform: scale(0.98);
        box-shadow: 0 2px 10px rgba(229, 9, 20, 0.4);
    }

    body.idle .watch-btn i {
        font-size: 0.7rem;
    }

    body.idle .discovery-card:hover {
        transform: scale(1.02) !important; /* Subtle zoom on hover for feedback */
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    }

    /* Content Nebula hidden on mobile slideshow */
    body.idle .content-nebula {
        display: none;
    }

    /* Adjust chat footer to overlay on mobile discovery */
    body.idle .chat-footer {
        position: fixed;
        bottom: 0;
        left: 50%;
        width: 100%;
        background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 80%, transparent 100%);
        padding: 20px 16px 30px;
        border: none;
        z-index: 1000;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    }

    body.idle .input-wrapper {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

   #movieInput::placeholder{
        font-size: 15px;
    }
}




/* Empty State */
.empty-state {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
}

.hero-icon {
    font-size: 4rem;
    color: var(--accent-primary);
    margin-bottom: 24px;
    opacity: 0.1;
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.05); }
}

.empty-state h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Chat Footer & Input */
.chat-footer {
    padding: 24px;
    background: linear-gradient(0deg, var(--background-primary) 0%, transparent 100%);
}

.suggestions-container {
    max-width: 800px;
    margin: 0 auto 20px;
}

.suggestions-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.suggestions-scroll::-webkit-scrollbar {
    display: none;
}

.pill-btn {
    white-space: nowrap;
    background: var(--background-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-quick);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pill-btn i {
    font-size: 0.75rem;
    color: var(--accent-primary);
}

.pill-btn:hover {
    background: var(--border-subtle);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 6px 10px 6px 24px;
    display: flex;
    align-items: center;
    gap: 0;
    transition: var(--transition-physical);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

#movieInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    padding: 12px 0;
    outline: none;
}

#movieInput::placeholder {
    color: #555;
}

.send-btn {
    background: var(--accent-primary);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-quick);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}



.attachment-btn, .mic-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition-quick);
}

.attachment-btn:hover, .mic-btn:hover {
    color: var(--text-primary);
}

#movieInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 12px 0;
    outline: none;
}

.send-btn {
    background: var(--accent-primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-quick);
}

.send-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.disclaimer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 12px;
    opacity: 0.5;
}

/* Message Styles */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px 150px 20px;
    transition: all 0.5s ease;
}

/* Expanded layout when no player is visible */
body.active:not(.playback) .message-list {
    max-width: 1200px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: messageAppear 300ms ease-out forwards;
    opacity: 0;
}

@keyframes messageAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.movie-stagger {
    animation: messageAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* Stagger logic via JS injection or nth-child */
.message-list > .movie-stagger:nth-child(1) { animation-delay: 50ms; }
.message-list > .movie-stagger:nth-child(2) { animation-delay: 100ms; }
.message-list > .movie-stagger:nth-child(3) { animation-delay: 150ms; }
.message-list > .movie-stagger:nth-child(4) { animation-delay: 200ms; }
.message-list > .movie-stagger:nth-child(5) { animation-delay: 250ms; }
.message-list > .movie-stagger:nth-child(6) { animation-delay: 300ms; }
.message-list > .movie-stagger:nth-child(n+7) { animation-delay: 350ms; }

.message.user {
    align-self: flex-end;
}

.message.agent {
    align-self: flex-start;
}

.bubble {
    padding: 14px 18px;
    font-size: 1rem;
    line-height: 1.5;
}

.message.user .bubble {
    background: var(--surface-chat-user);
    color: var(--text-primary);
    border-radius: 18px 18px 2px 18px;
    border: 1px solid var(--border-subtle);
}

.message.agent .bubble {
    background: var(--surface-chat-agent);
    color: var(--text-primary);
    border-radius: 18px 18px 18px 2px;
}

/* Movie Results Card */
.movie-card {
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    gap: 0;
    margin-top: 20px;
    max-width: 100%;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.05);
}

.movie-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(229, 9, 20, 0.3);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6), 0 0 20px rgba(229, 9, 20, 0.1);
}

.movie-poster {
    width: 120px;
    min-width: 120px;
    height: 180px;
    object-fit: cover;
}

.movie-details {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.movie-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    color: #fff;
}

.movie-metadata {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.movie-synopsis {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 16px;
    line-height: 1.6;
}

.movie-synopsis.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-synopsis.clamped.movie-only {
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.movie-synopsis.expanded {
    display: block;
    max-height: none;
}


.read-more-btn {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: -12px;
    margin-bottom: 16px;
    display: none; /* Hidden by default, shown via JS if needed */
}

.read-more-btn:hover {
    text-decoration: underline;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating { color: #FFD700; }

.movie-actions {
    display: flex;
    gap: 10px;
}

/* Tag Styles */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-quick);
    text-transform: capitalize;
}

.tag-pill:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(229, 9, 20, 0.3);
}

.tag-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.btn-primary {
    background: rgba(229, 9, 20, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(229, 9, 20, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-quick);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary:hover {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-quick);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Video Player State */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(0,0,0,0.98);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player-wrapper {
    width: 95vw;
    height: 90vh;
    max-width: 1400px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255,255,255,0.1);
    display: flex;
    box-sizing: border-box;
}

.video-player-wrapper:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-width: none;
}

.video-player-wrapper:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-width: none;
}

.video-player-wrapper::backdrop {
    background: black;
}

#mainVideoPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

/* Webtor Mode for Overlay */
.video-player-wrapper.webtor-mode #mainVideoPlayer,
.video-player-wrapper.webtor-mode .player-controls,
.video-player-wrapper.webtor-mode .video-loader {
    display: none !important;
}

.video-player-wrapper.webtor-mode .webtor-preloader {
    border-radius: 16px;
}

.video-player-wrapper.webtor-mode iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    border-radius: 16px;
}

.video-player-wrapper.webtor-mode .player-top-bar {
    z-index: 100; /* Ensure top bar / close button is above Webtor iframe */
}

/* Webtor Close Button Hover Effect */
.close-webtor-btn:hover {
    background: rgba(229, 9, 20, 0.9) !important;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.5);
}

.close-webtor-btn:active {
    transform: scale(0.95);
}

@media (max-width: 1024px) {
    .video-player-wrapper {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    .video-player-wrapper.webtor-mode iframe,
    .video-player-wrapper.webtor-mode .webtor-preloader {
        border-radius: 0;
    }
}

/* Player UI Overlays */
.player-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 20;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(0);
}

.player-top-bar h2 {
    color: white;
    font-size: 1.25rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin: 0;
}

.close-player-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.close-player-btn:hover {
    background: var(--accent-primary);
    transform: scale(1.1);
}

/* Loader */
.video-loader {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 10;
    color: white;
}

.spinner-wrapper {
    text-align: center;
}

.spinner-wrapper i {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 20px;
}

/* Center Play Indicator */
.center-play-indicator {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    background: rgba(0,0,0,0.5);
    color: white;
    width: 80px; height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.center-play-indicator.animate {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: fadeOutPlay 0.8s forwards;
}

@keyframes fadeOutPlay {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* Controls Bar */
.player-controls {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 0 30px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    z-index: 20;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(0);
}

/* Hide controls on inactivity */
.video-player-wrapper.idle .player-controls,
.video-player-wrapper.idle .player-top-bar {
    opacity: 0;
    pointer-events: none;
}
.video-player-wrapper.idle .player-controls { transform: translateY(20px); }
.video-player-wrapper.idle .player-top-bar { transform: translateY(-20px); }
.video-player-wrapper.idle { cursor: none; }

.progress-container {
    width: 100%;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    margin-bottom: 12px;
}

.progress-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    position: absolute;
    transition: height 0.2s ease;
}

.progress-bar-current {
    width: 0%;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 2px;
    position: absolute;
    z-index: 2;
    transition: height 0.2s ease;
}

.progress-container:hover .progress-bar-bg,
.progress-container:hover .progress-bar-current,
.progress-container.seeking .progress-bar-bg,
.progress-container.seeking .progress-bar-current {
    height: 6px;
}

.progress-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    position: absolute;
    z-index: 3;
    left: 0%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.progress-container:hover .progress-thumb,
.progress-container.seeking .progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
}

.control-btn:hover {
    opacity: 1;
    color: var(--accent-primary);
    transform: scale(1.1);
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-container:hover .volume-slider-wrapper {
    width: 80px;
    opacity: 1;
    margin-left: 8px;
}

.volume-slider-wrapper {
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}

.volume-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.time-display {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    margin-left: 10px;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    gap: 4px;
    padding: 10px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: loadingDot 1s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDot {
    0%, 100% { transform: scale(0.6); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    /* Larger touch target for the seek bar */
    .progress-container {
        height: 44px;
        margin-bottom: 4px;
    }
    /* Always show the thumb on mobile so it's easy to grab */
    .progress-thumb {
        transform: translate(-50%, -50%) scale(1);
        width: 18px;
        height: 18px;
    }

    .movie-card {
        flex-direction: column;
        align-items: center;
    }
    .movie-poster {
        width: 100%;
        height: 50dvh;
    }
    .empty-state h1 {
        font-size: 1.75rem;
    }
    .movie-details {
        text-align: center;
        align-items: center;
    }
}
/* Anime Episode Styles */
.anime-episodes-container {
    background: #0f0f0f;
    border-top: 1px solid var(--border-subtle);
    padding: 15px;
    margin-top: -1px; /* collapse border with card */
    border-radius: 0 0 var(--movie-card-radius) var(--movie-card-radius);
    max-height: 300px;
    overflow: auto;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.episode-item {
    background: var(--background-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-quick);
    position: relative;
    overflow: hidden;
}

.episode-item:hover {
    border-color: var(--accent-primary);
    background: var(--surface-chat-user);
    transform: translateY(-2px);
}

.episode-number {
    font-size: 0.75rem;
    font-weight: 700;
}

.episode-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: var(--accent-primary);
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.episode-item:hover .play-icon {
    transform: translate(-50%, -50%) scale(1);
}

.episode-item:hover .episode-number {
    opacity: 0.2;
}

/* ────────────────────────────────────────────
   Franchise Grouped UI 
   ──────────────────────────────────────────── */
.franchise-container {
    max-width: 600px;
    margin: 0 auto;
}

.franchise-card {
    border-top: 3px solid var(--accent-primary);
    overflow: auto;
}

.franchise-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-chat-user);
    color: var(--accent-primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.franchise-timeline-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 6px;
}

.franchise-timeline {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.franchise-timeline::-webkit-scrollbar {
    height: 4px;
}

.franchise-timeline::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 10px;
}

.franchise-part {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--background-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: var(--transition-quick);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    width: 130px;
    scroll-snap-align: start;
}

.franchise-part:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Part index badge overlaid on thumbnail */
.part-number {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    background: rgba(0,0,0,0.65);
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.part-info {
    padding: 8px 8px 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.part-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    /* clamp to 2 lines then ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.part-year {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.franchise-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.franchise-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.genre-tag {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Part Thumbnail — full-width cover at top of card */
.part-thumb {
    position: relative;
    width: 100%;
    height: 90px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--background-secondary);
}

.part-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.part-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 1rem;
    color: #fff;
}

.franchise-part:hover .part-thumb-overlay {
    opacity: 1;
}

/* Year Badge */
.part-year-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Part Info */
.part-meta {
    display: flex;
    gap: 6px;
    margin-top: 2px;
    flex-wrap: wrap;
}

/* Part Action / Watch button */
.part-action {
    padding: 6px 8px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: center;
}

.part-watch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--accent-primary);
    color: #fff;
    padding: 4px 0;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    width: 100%;
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.franchise-part:hover .part-watch-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Active state (when episodes are expanded) */
.franchise-part.part-active {
    border-color: var(--accent-primary);
    background: var(--surface-chat-user);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.franchise-part.part-active .part-watch-btn {
    opacity: 1;
    transform: translateX(0);
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

/* Episode expansion panel — renders below the whole franchise timeline */
.franchise-episodes-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.franchise-episodes-panel .episode-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.franchise-timeline .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
}

.franchise-episodes-panel .episode-item {
    padding: 8px 4px;
    font-size: 0.7rem;
}

/* Responsive Customization for Episodes */
@media (max-width: 480px) {
    .episode-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
}

/* Search Type Toggle */
.search-type-toggle {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.search-type-toggle::-webkit-scrollbar {
    display: none;
}

.type-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.type-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.type-btn.active {
    background: var(--hero-btn-bg);
    border-color: var(--hero-btn-bg);
    color: var(--text-primary);
}

.type-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.type-btn .badge {
    background: var(--brand-color);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* Webtor Mobile Popup Mode */
.video-player-wrapper.webtor-mode {
    background: #000;
    display: flex;
    flex-direction: column;
}

.video-player-wrapper.webtor-mode #mainVideoPlayer,
.video-player-wrapper.webtor-mode .player-controls,
.video-player-wrapper.webtor-mode .center-play-indicator {
    display: none !important;
}

.video-player-wrapper.webtor-mode .webtor-preloader {
    position: absolute;
    inset: 0;
    z-index: 5;
}

/* Ensure iframe fills the container */
.video-player-wrapper.webtor-mode [id^="webtor-"] {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 10;
}

@media (max-width: 1024px) {
    .video-overlay {
        padding: 0;
        left: 0 !important;
        width: 100% !important;
    }
    .video-player-wrapper.webtor-mode {
        width: 100%;
        height: 100dvh;
        border-radius: 0;
    }
}

/* Movie Card Progress Bar */
.card-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 5;
}

.card-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

/* Episode Progress Bar */
.episode-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 0 0 12px 12px;
    transition: width 0.3s ease;
    box-shadow: 0 -1px 4px rgba(229, 9, 20, 0.3);
}

/* Series Card Styles */
.series-badge {
    background: rgba(0, 210, 255, 0.1);
    color: #00d2ff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(0, 210, 255, 0.2);
}

.series-navigation {
    margin-top: 20px;
    position: relative;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-quick);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.seasons-panel, .episodes-panel {
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px;
    margin-top: 15px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 400px;
    overflow-y: auto;
}

/* Custom Scrollbar for Panels */
.seasons-panel::-webkit-scrollbar, .episodes-panel::-webkit-scrollbar {
    width: 4px;
}
.seasons-panel::-webkit-scrollbar-track, .episodes-panel::-webkit-scrollbar-track {
    background: transparent;
}
.seasons-panel::-webkit-scrollbar-thumb, .episodes-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
}

.panel-header span {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.03em;
}

/* Season Grid Styling */
.seasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.season-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.season-item:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

/* Episode Item Redesign */
.episode-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.episode-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.ep-badge {
    width: 32px;
    height: 32px;
    background: rgba(229, 9, 20, 0.15);
    color: var(--accent-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    flex-shrink: 0;
    border: 1px solid rgba(229, 9, 20, 0.3);
}

.ep-details {
    flex-grow: 1;
    overflow: hidden;
}

.ep-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-sub {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ep-play-icon {
    width: 36px;
    height: 36px;
    background: white;
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.episode-item:hover .ep-play-icon {
    opacity: 1;
    transform: scale(1);
}

.episode-item:active {
    transform: scale(0.98) translateX(2px);
}

/* Compact Episode Grid Styling */
.episodes-grid.compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 10px;
    padding: 10px 4px;
}

.ep-box {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.ep-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: 0.5s;
}

.ep-box:hover {
    background: rgba(229, 9, 20, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.3);
    z-index: 2;
}

.ep-box:hover::before {
    left: 100%;
}

.ep-box:active {
    transform: scale(0.95);
}

/* Episode Detail Modal */
.ep-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.ep-modal-content {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ep-detail-modal.active .ep-modal-content {
    transform: translateY(0) scale(1);
}

.ep-modal-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
}

.ep-modal-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ep-modal-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(20, 20, 20, 1), transparent);
}

.ep-modal-banner .close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.ep-modal-body {
    padding: 24px;
    padding-top: 0;
    margin-top: -30px;
    position: relative;
    z-index: 5;
}

.ep-modal-badge {
    background: var(--accent-primary);
    color: white;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(229, 9, 20, 0.3);
}

.close-modal-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.ep-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.ep-modal-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.ep-modal-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 8px;
}

.ep-modal-description::-webkit-scrollbar {
    width: 3px;
}

.ep-modal-description::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-play-btn {
    flex: 1;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.modal-play-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.5);
}

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

/* Movie Quality Modal Styles */
.quality-selection-area {
    margin-top: 24px;
    animation: slideUp 0.5s ease forwards;
}

.quality-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 8px;
    margin-top: 15px;
}

.quality-list::-webkit-scrollbar {
    width: 4px;
}

.quality-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.quality-option-wrapper {
    width: 100%;
}

.quality-option-wrapper button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quality-option-wrapper button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--accent-primary) !important;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.quality-option-wrapper .p2p-btn:hover {
    background: rgba(0, 150, 255, 0.25) !important;
}

/* Watch Now Button Styling */
.watch-now-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent-primary);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

.watch-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.5);
    filter: brightness(1.1);
}

.watch-now-btn i {
    font-size: 0.8rem;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.close-panel-btn, .back-to-seasons-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color 0.2s;
}

.close-panel-btn:hover, .back-to-seasons-btn:hover {
    color: white;
}

.seasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.season-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.season-item:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.episodes-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.episode-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.episode-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.episode-item i {
    color: var(--accent-primary);
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.episode-item:hover i {
    opacity: 1;
}

.ep-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.ep-meta {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* Unified Series & Anime Episode Selector Modal */
.series-ep-modal-content {
    max-width: 680px !important;
    width: 94% !important;
    max-height: 88vh !important;
    background: var(--bg-surface, #141416) !important;
    border: 1px solid var(--border-glass-hover, rgba(255,255,255,0.15)) !important;
    border-radius: 20px !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.ep-modal-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.ep-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.ep-modal-title-wrap img {
    width: 42px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.ep-modal-title-text {
    min-width: 0;
    flex: 1;
}

.ep-modal-title-text h3 {
    margin: 0;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-modal-title-text p {
    margin: 3px 0 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary, #9CA3AF);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-modal-tabs-bar {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
    scrollbar-width: thin;
}

.ep-modal-tabs-bar::-webkit-scrollbar {
    height: 4px;
}

.ep-modal-tabs-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.ep-modal-tab-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary, #9CA3AF);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.ep-modal-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.ep-modal-tab-btn.active {
    background: var(--accent-primary, #e50914);
    border-color: var(--accent-primary, #e50914);
    color: #fff;
    box-shadow: 0 2px 10px rgba(229, 9, 20, 0.35);
}

.ep-modal-tab-btn.active.anime-tab {
    background: var(--accent-ai, #8B5CF6);
    border-color: var(--accent-ai, #8B5CF6);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.35);
}

.ep-modal-search-box {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.015);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ep-modal-search-box i {
    color: var(--text-secondary, #9CA3AF);
    font-size: 0.85rem;
}

.ep-modal-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.85rem;
}

.ep-modal-search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.ep-modal-episodes-container {
    flex: 1;
    overflow-y: auto;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
}

.ep-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 12px;
}

.ep-card-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.ep-card-row.target-highlight {
    border-color: var(--accent-primary, #e50914);
    background: rgba(229, 9, 20, 0.1);
}

.ep-card-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.ep-card-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.ep-card-text {
    min-width: 0;
    flex: 1;
}

.ep-card-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-card-sub {
    font-size: 0.72rem;
    color: var(--text-secondary, #9CA3AF);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-card-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    background: rgba(229, 9, 20, 0.15);
    color: #ff4b4b;
    border: 1px solid rgba(229, 9, 20, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ep-card-btn:hover {
    background: var(--accent-primary, #e50914);
    color: #fff;
}

.ep-card-btn.anime-btn {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.3);
}

.ep-card-btn.anime-btn:hover {
    background: var(--accent-ai, #8B5CF6);
    color: #fff;
}

.ep-modal-badge.moviebox-badge {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.35);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

.ep-modal-tab-btn.active.moviebox-tab {
    background: #eab308;
    border-color: #eab308;
    color: #000;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(234, 179, 8, 0.35);
}

.ep-card-badge.moviebox-ep-badge {
    background: rgba(234, 179, 8, 0.12);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.ep-card-btn.moviebox-btn {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.35);
}

.ep-card-btn.moviebox-btn:hover {
    background: #eab308;
    color: #000;
    border-color: #eab308;
}

/* =========================================================================
   MAGNET & DIRECT DOWNLOAD MODALS
   ========================================================================= */
.magnet-modal-content {
    max-width: 580px;
    background: var(--bg-surface, #141416);
    border: 1px solid var(--border-glass-hover, rgba(255, 255, 255, 0.15));
    border-radius: 20px;
    padding: 24px;
    color: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.magnet-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.magnet-modal-header h3 {
    margin: 0;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.magnet-modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary, #9CA3AF);
    margin-bottom: 18px;
    line-height: 1.4;
}

.magnet-box-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px 8px;
    align-items: center;
}

.magnet-url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #60a5fa;
    font-family: monospace;
    font-size: 0.78rem;
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.magnet-copy-btn {
    background: var(--accent-primary, #e50914);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.magnet-copy-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.magnet-copy-btn.copied {
    background: #10B981 !important;
}

.magnet-actions-row {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.magnet-action-btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.magnet-action-btn.app-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.magnet-action-btn.app-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.cloud-downloader-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 18px;
}

.cloud-downloader-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #facc15;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cloud-downloader-desc {
    font-size: 0.78rem;
    color: var(--text-secondary, #9CA3AF);
    margin-bottom: 12px;
}

.cloud-downloader-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.cloud-site-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
}

.cloud-site-card:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(234, 179, 8, 0.4);
    transform: translateY(-2px);
}

.cloud-site-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cloud-site-name i {
    font-size: 0.75rem;
    color: var(--text-secondary, #9CA3AF);
}

.cloud-site-badge {
    font-size: 0.7rem;
    color: #9CA3AF;
}

.ep-card-btn.download-btn {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.ep-card-btn.download-btn:hover {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

.universal-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content {
    text-align: center;
    color: white;
}

.input-content-wrapper { flex: 1; display: flex; flex-direction: column; }
.image-preview-container { display: flex; align-items: center; padding: 8px 12px; background: rgba(255, 255, 255, 0.05); border-radius: 8px; margin-bottom: 8px; width: max-content; position: relative; }
.image-preview-container img { height: 40px; width: auto; border-radius: 4px; object-fit: cover; }
#clearImageBtn { background: rgba(255, 0, 0, 0.6); border: none; color: white; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; position: absolute; top: -5px; right: -5px; cursor: pointer; font-size: 10px; }
#clearImageBtn:hover { background: rgba(255, 0, 0, 0.9); }

.closest-match-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-primary), #ff4b4b);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Polished Elements */
.closest-match-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bookmark-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s ease;
    color: #fff;
}

.bookmark-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.bookmark-btn:hover {
    transform: scale(1.1);
    background: rgba(229, 9, 20, 0.8);
}

.movie-title {
    font-size: 1.5rem;
    line-height: 1.2;
}

.movie-metadata .meta-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary, .btn-primary {
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Quality Selector & Actions */
.movie-actions {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quality-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selector-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.quality-btns-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-progress-container {
    margin-top: 12px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.card-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag-pill {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-pill:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.error-text {
    font-size: 0.8rem;
    color: var(--error-state);
}

.retry-btn {
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
}

/* Responsive Enhancements for Mobile */
@media (max-width: 768px) {
    .message-list {
        padding: 0 12px 140px 12px;
        gap: 20px;
    }

    .message {
        max-width: 100%; /* Take full width on mobile */
    }

    .movie-card {
        flex-direction: column; /* Stack vertically for more width */
        border-radius: 20px;
    }

    .movie-poster {
        width: 100%;
        height: 240px; /* Taller poster on mobile */
        min-width: unset;
    }

    .movie-details {
        padding: 20px;
    }

    .movie-title {
        font-size: 1.3rem;
    }

    .movie-metadata {
        flex-wrap: wrap;
        gap: 8px;
    }

    .movie-actions {
        padding-top: 12px;
    }

    .btn-primary, .btn-secondary {
        width: 100%; /* Full width buttons on mobile */
        justify-content: center;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .movie-poster {
        height: 200px;
    }
    
    .movie-title {
        font-size: 1.15rem;
    }
    
    .result-filter-bar {
        padding: 12px 10px;
        margin: -12px -12px 16px -12px;
    }
}

@media (max-width: 768px) {
    .message.agent {
        max-width: 100% !important;
        width: 100%;
    }
    
    .chat-canvas {
        padding: 12px !important;
    }
}

/* Identification UI Styles */
.identification-container .bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.identification-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.identification-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.id-title-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 14px 18px;
    border-radius: 14px;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.id-title-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 5px 20px rgba(229, 9, 20, 0.2);
}

.id-title-text {
    flex: 1;
    margin-right: 15px;
    font-size: 0.9rem;
}

.btn-cue {
    font-size: 0.6rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 1px;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.id-title-btn:hover .btn-cue {
    background: var(--accent-primary);
    color: white;
}

.identification-footer {
    margin-top: 18px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.movie-stagger {
    animation: slideInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Identification Badges */
.id-btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.id-btn-main {
    display: flex;
    align-items: center;
}

.id-type-badge {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-right: 10px;
    background: rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

.id-type-badge.movie { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.id-type-badge.show { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }
.id-type-badge.anime { background: rgba(230, 126, 34, 0.2); color: #e67e22; }

.id-prob-badge {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.6;
    font-weight: 400;
    margin-left: 54px; /* Align with title start */
}

/* Search Mode Toggle */
.search-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.search-mode-toggle .switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.search-mode-toggle .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.search-mode-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-mode-toggle .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: .4s;
}

.search-mode-toggle input:checked + .slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.search-mode-toggle input:checked + .slider:before {
    transform: translateX(14px);
    background-color: white;
}

.search-mode-toggle .slider.round {
    border-radius: 34px;
}

.search-mode-toggle .slider.round:before {
    border-radius: 50%;
}

.search-mode-toggle .toggle-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.identification-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.identification-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.id-title-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 14px 18px;
    border-radius: 14px;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.id-title-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 5px 20px rgba(229, 9, 20, 0.2);
}

.id-title-text {
    flex: 1;
    margin-right: 15px;
    font-size: 0.9rem;
}

.btn-cue {
    font-size: 0.6rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 1px;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.id-title-btn:hover .btn-cue {
    background: var(--accent-primary);
    color: white;
}

.identification-footer {
    margin-top: 18px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.movie-stagger {
    animation: slideInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Identification Badges */
.id-btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.id-btn-main {
    display: flex;
    align-items: center;
}

.id-type-badge {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-right: 10px;
    background: rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

.id-type-badge.movie { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.id-type-badge.show { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }
.id-type-badge.anime { background: rgba(230, 126, 34, 0.2); color: #e67e22; }

.id-prob-badge {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.6;
    font-weight: 400;
    margin-left: 54px; /* Align with title start */
}

/* Search Mode Toggle */
.search-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.search-mode-toggle .switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.search-mode-toggle .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.search-mode-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-mode-toggle .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: .4s;
}

.search-mode-toggle input:checked + .slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.search-mode-toggle input:checked + .slider:before {
    transform: translateX(14px);
    background-color: white;
}

.search-mode-toggle .slider.round {
    border-radius: 34px;
}

.search-mode-toggle .slider.round:before {
    border-radius: 50%;
}

.search-mode-toggle .toggle-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-mode-toggle input:checked ~ .toggle-label {
    color: var(--text-primary);
}

/* Inline Movie Button */
.inline-movie-btn {
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.4);
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.inline-movie-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(229, 9, 20, 0.3);
}

/* IMDb Card & Recommendation Triggers Styles */
.imdb-card {
    border-left: 4px solid #f3ce13 !important; /* Gold accent border for IMDb */
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.7) 0%, rgba(10, 10, 15, 0.8) 100%) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(243, 206, 19, 0.15) !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease !important;
}

.imdb-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 15px rgba(243, 206, 19, 0.25) !important;
}

.imdb-badge {
    background: #f3ce13;
    color: #000000;
    font-size: 0.625rem;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.imdb-badge i {
    font-size: 1.1em;
}

.imdb-reviews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.review-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

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

.review-badge strong {
    color: var(--text-primary);
}

.imdb-loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    width: 100%;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.imdb-loading-placeholder .pulse-loader {
    width: 44px;
    height: 44px;
    border: 3px solid #f3ce13;
    border-radius: 50%;
    animation: pulseLoaderGold 2s infinite;
}

@keyframes pulseLoaderGold {
    0% { transform: scale(0.8); opacity: 0.8; box-shadow: 0 0 0 0 rgba(243, 206, 19, 0.4); }
    70% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 15px rgba(243, 206, 19, 0); }
    100% { transform: scale(0.8); opacity: 0.8; box-shadow: 0 0 0 0 rgba(243, 206, 19, 0); }
}

.imdb-card.error-state {
    border-left-color: var(--error-state) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 1px 1px rgba(255, 59, 48, 0.15) !important;
}

.imdb-card.error-state .error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

/* Custom glowing hover effect on IMDb Poster */
.imdb-card:hover .movie-poster {
    box-shadow: 0 0 20px rgba(243, 206, 19, 0.3);
    border-color: rgba(243, 206, 19, 0.4);
}

.ep-modal-footer {
    display: flex;
    gap: 12px;
    padding: 24px;
    padding-top: 0;
}

.modal-watched-toggle-btn {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-watched-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-watched-toggle-btn.watched {
    color: var(--accent-primary);
    border-color: rgba(229, 9, 20, 0.3);
    background: rgba(229, 9, 20, 0.1);
}

/* Custom Subtitles Display and Controls */
.player-subtitle-overlay {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.45;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.6);
    background-color: rgba(0, 0, 0, 0.65);
    padding: 8px 18px;
    border-radius: 8px;
    pointer-events: none;
    z-index: 15;
    max-width: 80%;
    transition: opacity 0.15s ease, bottom 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.video-player-wrapper.idle .player-subtitle-overlay {
    bottom: 35px;
}

.subtitles-container {
    position: relative;
    display: flex;
    align-items: center;
}

.subtitles-panel {
    position: absolute;
    bottom: calc(100% + 15px);
    right: -30px;
    background: rgba(15, 15, 20, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
    width: 280px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 20;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.subtitles-panel.active {
    display: flex;
}

.subtitles-panel-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.subtitles-list {
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.subtitles-list::-webkit-scrollbar {
    width: 4px;
}

.subtitles-list::-webkit-scrollbar-track {
    background: transparent;
}

.subtitles-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.subtitle-option {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
    font-weight: 500;
}

.subtitle-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.subtitle-option.active {
    border-color: var(--accent-primary);
    background: rgba(229, 9, 20, 0.12);
    color: var(--accent-primary);
    font-weight: 700;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.15);
}

.subtitle-sync-control {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.2px;
}

.sync-value {
    color: var(--accent-primary);
    font-weight: 700;
}

.sync-buttons {
    display: flex;
    gap: 6px;
}

.sync-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.sync-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.subtitle-upload-option {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.subtitle-upload-btn {
    width: 100%;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.subtitle-upload-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   CHATFLIX REDESIGN DESIGN SYSTEM: SEARCH MODE & CHAT MODE
   ========================================================================== */

:root {
    --bg-main: #08080d;
    --bg-surface: #101018;
    --bg-surface-elevated: #161622;
    --bg-glass: rgba(16, 16, 24, 0.75);
    --bg-glass-strong: rgba(16, 16, 24, 0.92);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.18);
    
    --accent-red: #E50914;
    --accent-red-hover: #F40612;
    --accent-red-glow: rgba(229, 9, 20, 0.35);
    
    --accent-ai: #8B5CF6;
    --accent-ai-hover: #7C3AED;
    --accent-ai-glow: rgba(139, 92, 246, 0.4);
    
    --rating-gold: #FFB800;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --header-height: 74px;
    --sidebar-width: 310px;
}

/* Base Body & Reset for Redesign */
body.dark-mode {
    background-color: var(--bg-main) !important;
    color: #F3F4F6;
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* App Header */
.app-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(8, 8, 13, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 1000;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.header-container {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Brand Logo */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-red), #990000);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px var(--accent-red-glow);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #fff;
}

.logo-accent {
    color: var(--accent-red);
    text-shadow: 0 0 12px var(--accent-red-glow);
}

/* Mode Switcher Segmented Control */
.mode-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(22, 22, 34, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: 40px;
    padding: 4px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}

.mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 30px;
    border: none;
    background: transparent;
    color: #9CA3AF;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.mode-btn:hover {
    color: #fff;
}

.mode-btn.active[data-mode="search"] {
    background: linear-gradient(135deg, #E50914, #B81D24);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-red-glow);
}

.mode-btn.active[data-mode="chat"] {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-ai-glow);
}

.badge-ai-pill {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    letter-spacing: 0.05em;
}

/* Header Right Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: #D1D5DB;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.icon-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: var(--border-glass-hover);
}

.genre-pill-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: #D1D5DB;
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.genre-pill-btn:hover {
    background: rgba(229, 9, 20, 0.15);
    color: #fff;
}

/* Viewport Canvas & Mode Views */
.viewport-canvas {
    width: 100%;
    min-height: calc(100vh - var(--header-height));
    position: relative;
    box-sizing: border-box;
}

.mode-view {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mode-view.active {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   MODE 1: SEARCH MODE (HOME PAGE)
   ========================================================================== */

.search-view-container {
    max-width: 1540px;
    margin: 0 auto;
    padding: 40px 28px 100px;
    box-sizing: border-box;
}

/* Search Hero */
.search-hero {
    text-align: center;
    max-width: 880px;
    margin: 0 auto 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(229, 9, 20, 0.12);
    border: 1px solid rgba(229, 9, 20, 0.25);
    color: #FF6B6B;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(229, 9, 20, 0.1);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 16px;
    color: #fff;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 30%, #E50914 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: #9CA3AF;
    line-height: 1.6;
    margin: 0 0 36px;
    max-width: 680px;
}

/* Supercharged Search Console */
.search-console-wrapper {
    width: 100%;
    max-width: 820px;
}

.search-console {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 12px 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-console:focus-within {
    border-color: rgba(229, 9, 20, 0.4);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 24px rgba(229, 9, 20, 0.15);
}

.search-console.ai-active-glow:focus-within {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 24px rgba(139, 92, 246, 0.2);
}

/* Image Attachment Badge in Console */
.image-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(22, 22, 34, 0.9);
    border: 1px solid var(--border-glass-hover);
    padding: 6px 12px 6px 6px;
    border-radius: 12px;
    width: fit-content;
}

.image-preview-badge img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
}

.clear-img-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.2s ease;
}

.clear-img-btn:hover {
    background: var(--accent-red);
}

/* Search Input Row */
.search-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-icon {
    color: #6B7280;
    font-size: 1.15rem;
    padding-left: 6px;
}

.search-main-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 500;
}

.search-main-input::placeholder {
    color: #6B7280;
}

.clear-input-btn {
    background: transparent;
    border: none;
    color: #6B7280;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s ease;
}

.clear-input-btn:hover {
    color: #fff;
}

/* AI Assist Toggle Pill */
.ai-assist-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 30px;
    color: #C4B5FD;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.ai-assist-toggle:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    color: #fff;
}

.ai-assist-toggle.active {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    border-color: #A78BFA;
    color: #fff;
    box-shadow: 0 0 16px var(--accent-ai-glow);
}

.ai-status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6B7280;
    transition: all 0.2s ease;
}

.ai-assist-toggle.active .ai-status-indicator {
    background: #10B981;
    box-shadow: 0 0 8px #10B981;
}

/* Camera Image Search Button */
.image-search-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: #9CA3AF;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.image-search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: var(--border-glass-hover);
}

/* Submit Search Button */
.search-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-red);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--accent-red-glow);
    transition: all 0.2s ease;
}

.search-submit-btn:hover {
    background: var(--accent-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-red-glow);
}

/* Filter Chips Bar */
.search-filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.type-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 5px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 20px;
    color: #9CA3AF;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.filter-chip.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.search-hint {
    font-size: 0.75rem;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 5px;
}

.kbd-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-family: monospace;
    color: #D1D5DB;
}

/* Quick Inspiration Prompts Row */
.quick-prompts-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    justify-content: center;
}

.prompts-label {
    font-size: 0.78rem;
    color: #6B7280;
    font-weight: 600;
}

.prompt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    color: #9CA3AF;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-1px);
}

/* ==========================================================================
   SEARCH RESULTS SECTION (ON HOME PAGE)
   ========================================================================== */

.search-results-section {
    margin-top: 20px;
    animation: fadeIn 0.4s ease;
}

.results-header-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.results-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: #fff;
    letter-spacing: -0.01em;
}

.results-subtitle {
    margin: 0;
    color: #9CA3AF;
    font-size: 0.92rem;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sort-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #9CA3AF;
}

.sort-select {
    background: rgba(22, 22, 34, 0.9);
    border: 1px solid var(--border-glass);
    color: #fff;
    padding: 7px 12px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
}

.back-discovery-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: #D1D5DB;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-discovery-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* AI Insights Banner */
.ai-insights-banner {
    display: flex;
    gap: 16px;
    background: rgba(14, 15, 24, 0.85);
    border: 1px solid rgba(229, 9, 20, 0.25);
    border-radius: 18px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    align-items: flex-start;
    backdrop-filter: blur(20px);
}

.banner-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(229, 9, 20, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(229, 9, 20, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.banner-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.banner-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #D1D5DB;
}

.banner-text p {
    margin-bottom: 0.45rem;
}

.banner-text p:last-child {
    margin-bottom: 0;
}

.banner-text strong {
    color: #ffffff;
    font-weight: 600;
}

.banner-text .movie-mention-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    margin: 0 2px;
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.35);
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    font-size: 0.85em;
}

.banner-text .timeline-mini-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 6px 0;
    font-size: 0.85rem;
    color: #D1D5DB;
}

/* Search Loader */
.search-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 16px;
}

.loader-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    font-size: 0.95rem;
    color: #9CA3AF;
    font-weight: 500;
}

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

/* No Results State */
.no-results-state {
    text-align: center;
    padding: 80px 20px;
    max-width: 480px;
    margin: 0 auto;
}

.no-results-icon {
    font-size: 3rem;
    color: #4B5563;
    margin-bottom: 16px;
}

.no-results-state h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
}

.no-results-state p {
    color: #9CA3AF;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 24px;
}

/* ==========================================================================
   ORGANIZED 2:3 CINEMATIC MEDIA CARD SYSTEM
   ========================================================================== */

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 26px 20px;
}

.media-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0,0,0,0.4);
}

.media-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(229, 9, 20, 0.4);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 24px rgba(229, 9, 20, 0.2);
    z-index: 10;
}

/* Poster Container (2:3 Aspect Ratio) */
.card-poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #181826 0%, #0e0e16 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-poster-wrapper::before {
    content: '\f008';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    color: rgba(255, 255, 255, 0.08);
    font-size: 2.5rem;
    pointer-events: none;
}

.card-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.media-card:hover .card-poster-img {
    transform: scale(1.06);
}

.card-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(16, 16, 24, 0.95) 0%, rgba(16, 16, 24, 0.2) 50%, transparent 100%);
    pointer-events: none;
}

/* Card Top Badges */
.card-top-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.type-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.type-badge.movie {
    background: rgba(229, 9, 20, 0.85);
    color: #fff;
}

.type-badge.tv {
    background: rgba(59, 130, 246, 0.85);
    color: #fff;
}

.type-badge.anime {
    background: rgba(168, 85, 247, 0.85);
    color: #fff;
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rating-badge i {
    color: var(--rating-gold);
    font-size: 0.68rem;
}

/* Bookmark Button (Top Right) */
.card-bookmark-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #D1D5DB;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    z-index: 5;
    transition: all 0.2s ease;
}

.card-bookmark-btn:hover {
    background: rgba(229, 9, 20, 0.8);
    color: #fff;
    border-color: transparent;
    transform: scale(1.1);
}

.card-bookmark-btn.active {
    background: var(--accent-red);
    color: #fff;
    border-color: transparent;
}

/* Hover Action Overlay */
.card-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 13, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 4;
}

.media-card:hover .card-hover-overlay {
    opacity: 1;
}

.card-action-btn {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    transition: all 0.2s ease;
}

.card-action-btn.primary {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-red-glow);
}

.card-action-btn.primary:hover {
    background: var(--accent-red-hover);
    transform: scale(1.02);
}

.card-action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
}

.card-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Card Body & Info */
.card-info {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #9CA3AF;
    font-weight: 600;
}

.card-year {
    color: #9CA3AF;
}

.card-sources-count {
    color: var(--accent-ai);
    font-weight: 700;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-genres {
    font-size: 0.72rem;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-quality-tags {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.quality-pill {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #D1D5DB;
}

/* ==========================================================================
   DISCOVERY HUB & HERO SPOTLIGHT
   ========================================================================== */

.discovery-hub {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

/* Spotlight Banner */
.hero-spotlight {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    padding: 48px;
    border: 1px solid var(--border-glass);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.spotlight-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 25%;
    filter: brightness(0.65);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-spotlight:hover .spotlight-backdrop {
    transform: scale(1.03);
}

.spotlight-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(8, 8, 13, 0.95) 0%, rgba(8, 8, 13, 0.6) 50%, transparent 100%),
                linear-gradient(to top, rgba(8, 8, 13, 0.95) 0%, transparent 60%);
}

.spotlight-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.spotlight-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(229, 9, 20, 0.25);
    border: 1px solid rgba(229, 9, 20, 0.4);
    color: #FF8080;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.spotlight-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    margin: 0 0 12px;
    color: #fff;
    line-height: 1.15;
}

.spotlight-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.85rem;
    color: #D1D5DB;
    margin-bottom: 14px;
    font-weight: 600;
}

.spotlight-synopsis {
    font-size: 0.95rem;
    color: #9CA3AF;
    line-height: 1.6;
    margin: 0 0 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spotlight-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-red);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--accent-red-glow);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px var(--accent-red-glow);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.btn-icon-round {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-icon-round:hover {
    background: var(--accent-red);
    border-color: transparent;
    transform: scale(1.05);
}

/* Discovery Shelves */
.discovery-shelf {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shelf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.shelf-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.shelf-title i {
    color: var(--accent-red);
}

.shelf-badge {
    font-size: 0.72rem;
    color: #6B7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shelf-link {
    color: #9CA3AF;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.shelf-link:hover {
    color: #fff;
}

/* ==========================================================================
   MODE 2: CHAT MODE (IN-BROWSER MULTI-CHAT AI CONCIERGE)
   ========================================================================== */

.chat-app-layout {
    display: flex;
    height: calc(100vh - var(--header-height));
    width: 100%;
    background: var(--bg-main);
    overflow: hidden;
    position: relative;
}

/* Left Sidebar / Chat Manager */
.chat-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: rgba(12, 12, 18, 0.95);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.sidebar-header {
    padding: 20px 18px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title i {
    color: var(--accent-ai);
}

.sidebar-close-btn {
    display: none; /* Visible on mobile */
    background: transparent;
    border: none;
    color: #9CA3AF;
    font-size: 1.1rem;
    cursor: pointer;
}

.sidebar-actions {
    padding: 0 16px 12px;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(229, 9, 20, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.new-chat-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(229, 9, 20, 0.3));
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.2);
}

.sidebar-search {
    padding: 0 16px 14px;
    position: relative;
}

.sidebar-search i {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7280;
    font-size: 0.82rem;
}

.sidebar-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 8px 12px 8px 34px;
    color: #fff;
    font-size: 0.8rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.sidebar-search input:focus {
    border-color: var(--accent-ai);
}

/* Conversations List */
.chat-sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: #9CA3AF;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.session-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.session-item.active {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
    color: #fff;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.session-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-time {
    font-size: 0.7rem;
    color: #6B7280;
}

.session-delete-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: #6B7280;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.session-item:hover .session-delete-btn {
    opacity: 1;
}

.session-delete-btn:hover {
    color: var(--accent-red);
    background: rgba(229, 9, 20, 0.15);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.clear-all-chats-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #6B7280;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.clear-all-chats-btn:hover {
    color: var(--accent-red);
    background: rgba(229, 9, 20, 0.1);
}

/* Main Chat Stage */
.chat-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at top center, rgba(22, 22, 34, 0.4) 0%, transparent 70%);
}

.chat-stage-header {
    height: 56px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(8, 8, 13, 0.4);
    backdrop-filter: blur(10px);
}

.chat-stage-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stage-sidebar-toggle {
    background: transparent;
    border: none;
    color: #9CA3AF;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
}

.stage-sidebar-toggle:hover {
    color: #fff;
}

.active-chat-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    cursor: pointer;
}

.active-chat-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-ai);
    margin-left: 8px;
    background: rgba(139, 92, 246, 0.12);
    padding: 2px 8px;
    border-radius: 10px;
}

.chat-stage-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-action-btn {
    background: transparent;
    border: none;
    color: #6B7280;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.header-action-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* Chat Messages Container */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 28px 40px 180px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Chat Welcome / Empty State */
.chat-welcome-state {
    margin: auto;
    max-width: 720px;
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-icon-glow {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(229, 9, 20, 0.3));
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px var(--accent-ai-glow);
}

.welcome-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 10px;
    color: #fff;
}

.welcome-subtitle {
    color: #9CA3AF;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 32px;
    max-width: 580px;
}

.starter-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.starter-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.starter-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(22, 22, 34, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.starter-card .card-icon {
    font-size: 1.2rem;
    color: var(--accent-ai);
    margin-top: 2px;
}

.starter-card .card-text strong {
    display: block;
    color: #fff;
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.starter-card .card-text span {
    display: block;
    color: #9CA3AF;
    font-size: 0.78rem;
    line-height: 1.4;
}

/* Chat Message Thread */
.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
}

.chat-bubble-wrapper {
    display: flex;
    gap: 14px;
    width: 100%;
}

.chat-bubble-wrapper.user {
    justify-content: flex-end;
}

.chat-bubble-wrapper.agent {
    justify-content: flex-start;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.chat-avatar.agent-avatar {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-ai-glow);
}

.chat-bubble {
    max-width: 82%;
    padding: 16px 20px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.65;
    box-sizing: border-box;
}

.chat-bubble.user-bubble {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.85), rgba(139, 92, 246, 0.85));
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.chat-bubble.agent-bubble {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-glass);
    color: #E5E7EB;
    border-bottom-left-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* Streamlined Recommendation Deck in Chat */
.streamlined-recommendation-deck {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    width: 100%;
}

.deck-mini-card {
    background: rgba(10, 10, 15, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    align-items: center;
}

.deck-mini-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(22, 22, 34, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

.deck-mini-poster {
    width: 54px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.deck-mini-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.deck-mini-title {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deck-mini-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: #9CA3AF;
}

.deck-mini-meta .rating {
    color: var(--rating-gold);
    font-weight: 700;
}

.deck-mini-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.deck-mini-btn {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.deck-mini-btn.play {
    background: var(--accent-red);
    color: #fff;
}

.deck-mini-btn.play:hover {
    background: var(--accent-red-hover);
}

.deck-mini-btn.details {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.deck-mini-btn.details:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Fixed Chat Input Console */
.chat-input-bar-container {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 860px;
    z-index: 50;
}

.chat-attachment-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(16, 16, 24, 0.95);
    border: 1px solid var(--border-glass-hover);
    padding: 8px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    backdrop-filter: blur(12px);
    width: fit-content;
}

.chat-attachment-preview img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.preview-filename {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    display: block;
}

.preview-note {
    font-size: 0.7rem;
    color: var(--accent-ai);
    display: block;
}

.remove-attach-btn {
    background: transparent;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
}

.remove-attach-btn:hover {
    color: var(--accent-red);
}

.chat-input-form {
    background: rgba(14, 14, 22, 0.9);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.chat-input-form:focus-within {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 16px 50px rgba(0,0,0,0.7), 0 0 20px rgba(139, 92, 246, 0.15);
}

.chat-tool-btn {
    background: transparent;
    border: none;
    color: #9CA3AF;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: color 0.2s ease;
}

.chat-tool-btn:hover {
    color: #fff;
}

.chat-direct-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: #9CA3AF;
    font-weight: 600;
    white-space: nowrap;
}

.chat-switch {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 16px;
}

.chat-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.chat-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    transition: 0.2s;
}

.chat-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}

.chat-switch input:checked + .chat-slider {
    background-color: var(--accent-red);
}

.chat-switch input:checked + .chat-slider:before {
    transform: translateX(12px);
}

.chat-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    padding: 4px 0;
}

.chat-textarea::placeholder {
    color: #6B7280;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-ai), #6D28D9);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px var(--accent-ai-glow);
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--accent-ai-glow);
}

/* ==========================================================================
   UNIVERSAL MEDIA DETAILS MODAL / INSPECTOR DRAWER
   ========================================================================== */

.media-details-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.media-details-modal.active {
    display: flex;
}

.details-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.details-modal-dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass-hover);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px rgba(0,0,0,0.8);
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close-icon-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    z-index: 10;
    transition: all 0.2s ease;
}

.modal-close-icon-btn:hover {
    background: var(--accent-red);
    transform: rotate(90deg);
}

.details-modal-content {
    overflow-y: auto;
    max-height: 90vh;
}

/* Details Modal Banner */
.details-banner {
    position: relative;
    height: 280px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 24px 32px;
}

.details-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-surface) 0%, rgba(16, 16, 24, 0.4) 60%, transparent 100%);
}

.details-body {
    padding: 24px 32px 36px;
    display: flex;
    gap: 28px;
}

.details-left {
    width: 160px;
    flex-shrink: 0;
}

.details-poster-large {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    border: 1px solid var(--border-glass);
}

.details-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.details-title-large {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
}

.details-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #D1D5DB;
    flex-wrap: wrap;
}

.details-synopsis-full {
    font-size: 0.95rem;
    color: #9CA3AF;
    line-height: 1.65;
    margin: 6px 0;
}

.details-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* ==========================================================================
   UNIVERSAL THEATER PLAYER OVERLAY
   ========================================================================== */

#player-container {
    position: fixed;
    inset: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #000 !important;
    z-index: 99999 !important;
    display: none;
    align-items: center;
    justify-content: center;
}

body.playback #player-container,
#player-container.active {
    display: flex !important;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .chat-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.7);
    }

    .chat-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: block;
    }

    .chat-sidebar-toggle {
        display: flex !important;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 18px 14px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }

    .search-view-container {
        padding: 24px 16px 80px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .starter-cards-grid {
        grid-template-columns: 1fr;
    }

    .details-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .details-left {
        width: 140px;
    }

    .details-actions-bar {
        justify-content: center;
    }

    .chat-messages-container {
        padding: 20px 16px 180px;
    }
}

/* ==========================================================================
   CHATFLIX IMMERSIVE CINEMA REDESIGN ENHANCEMENTS
   ========================================================================== */

/* Mode Switching & Canvas Integration */
.mode-view {
    display: none;
}
.mode-view.active {
    display: block;
}

body.chat-mode-active #cinemaWaterfallCanvas {
    opacity: 0.18;
    filter: blur(8px);
    pointer-events: none;
    transition: opacity 0.6s ease, filter 0.6s ease;
}

#cinemaWaterfallCanvas {
    transition: opacity 0.6s ease, filter 0.6s ease;
}

/* Continuous Upward Float Animations for Parallax Depth */
@keyframes floatUpSeamless {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

.waterfall-col-1 {
    animation: floatUpSeamless 52s linear infinite;
}
.waterfall-col-2 {
    animation: floatUpSeamless 40s linear infinite;
}
.waterfall-col-3 {
    animation: floatUpSeamless 62s linear infinite;
}
.waterfall-col-4 {
    animation: floatUpSeamless 44s linear infinite;
}
.waterfall-col-5 {
    animation: floatUpSeamless 56s linear infinite;
}
.waterfall-col-6 {
    animation: floatUpSeamless 48s linear infinite;
}

/* CRITICAL: Pause Animation when ANY Poster is Highlighted / Hovered / Focused */
.waterfall-track:hover .waterfall-col,
.waterfall-track:has(.glass-poster-card:hover) .waterfall-col,
.waterfall-track:has(.glass-poster-card:focus-within) .waterfall-col,
.waterfall-track.is-paused .waterfall-col,
body.poster-highlighted .waterfall-col {
    animation-play-state: paused !important;
}

/* Interactive Highlight State on Poster Cards */
.glass-poster-card {
    pointer-events: auto;
    background: rgba(14, 15, 22, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease,
                filter 0.4s ease,
                opacity 0.4s ease;
    will-change: transform, box-shadow;
    cursor: pointer;
    position: relative;
}

.glass-poster-card:hover,
.glass-poster-card.is-highlighted {
    border-color: rgba(229, 9, 20, 0.9) !important;
    transform: translateY(-8px) scale(1.06) !important;
    box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.95), 0 0 35px rgba(229, 9, 20, 0.45) !important;
    z-index: 50 !important;
    filter: brightness(1.15) !important;
    opacity: 1 !important;
}

/* Spotlighting effect: Gently dim other cards in the track when one is scrutinized */
.waterfall-track:has(.glass-poster-card:hover) .glass-poster-card:not(:hover),
.waterfall-track.is-paused .glass-poster-card:not(.is-highlighted) {
    opacity: 0.55;
    filter: brightness(0.65) blur(0.3px);
}

/* Perspective Canvas & 3D Tilted Grid Plane */
.cinema-canvas-perspective {
    perspective: 1400px;
    perspective-origin: 50% 50%;
}

.cinema-grid-plane {
    transform: perspective(1400px) rotateX(16deg) rotateY(-8deg) rotateZ(5deg) scale(1.08);
    transform-origin: center center;
    will-change: transform;
}

/* Active Segmented Mode Button Glow */
.mode-btn.active {
    background-color: #E50914 !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 40px -10px rgba(229, 9, 20, 0.6) !important;
}

/* Drawer Genre Tags */
.drawer-genre-tag {
    transition: all 0.25s ease;
}
.drawer-genre-tag.active {
    background-color: rgba(229, 9, 20, 0.2) !important;
    color: #FF1E27 !important;
    border-color: rgba(229, 9, 20, 0.5) !important;
}

/* ========================================================================= */
/* IMAGE A & B: DIRECT SEARCH RESULTS & AI CANONICAL TIMELINE STYLES         */
/* ========================================================================= */

/* Timeline vertical track and step connectors */
.timeline-track-container {
    position: relative;
    border-left: 2px solid rgba(229, 9, 20, 0.3);
    padding-left: 1.5rem;
}
@media (min-width: 768px) {
    .timeline-track-container {
        padding-left: 2rem;
    }
}

.timeline-step-node {
    position: absolute;
    left: -31px;
    top: 1.5rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background-color: #08080c;
    border: 2px solid #FF1E27;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}
@media (min-width: 768px) {
    .timeline-step-node {
        left: -39px;
    }
}

.timeline-step-node .node-inner-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background-color: #FF1E27;
    transition: all 0.3s ease;
}

.timeline-step-node.node-active {
    background-color: #FF1E27;
    border-color: #FFFFFF;
    box-shadow: 0 0 25px rgba(229, 9, 20, 0.9);
}
.timeline-step-node.node-active .node-inner-dot {
    background-color: #FFFFFF;
}

.timeline-step-node.node-emerald {
    border-color: #10B981;
}
.timeline-step-node.node-emerald .node-inner-dot {
    background-color: #10B981;
}

.timeline-step-node.node-neutral {
    border-color: #52525B;
}
.timeline-step-node.node-neutral .node-inner-dot {
    background-color: #52525B;
}

/* AI Franchise Overview Card Glow & Transitions */
#aiFranchiseOverviewCard {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-launcher-pill {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.25) 0%, rgba(147, 51, 234, 0.25) 100%);
    border: 1px solid rgba(229, 9, 20, 0.4);
    backdrop-filter: blur(16px);
    transition: all 0.3s ease;
}
.chat-launcher-pill:hover {
    border-color: rgba(229, 9, 20, 0.8);
    box-shadow: 0 0 30px rgba(229, 9, 20, 0.35);
    transform: translateY(-2px);
}

/* Results Mode Switcher (Image A vs Image B) */
.results-view-toggle-btn {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.results-view-toggle-btn.active {
    background-color: #E50914 !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 35px -5px rgba(229, 9, 20, 0.6) !important;
}

/* Line clamp 2 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

