/* ============================================
   Drishya - Component Styles (Apple TV+ Style)
   ============================================ */

/* ============================================
   Content Cards - The "Cinematic" Look
   ============================================ */
/* ============================================
   Content Cards - The "Cinematic" Look
   ============================================ */
.card-wrapper {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Reduced from 12px */
    width: 160px;
    /* Reduced width to effectively reduce height (aspect ratio maintained) */
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

/* Status Indicator (Searching/Loading) */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 20px;
    max-width: 100%;
}

.card {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    /* Standard poster ratio */
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    transform-origin: center center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Landscape/Backdrop cards override (if needed specifically) */
.card-wrapper.backdrop .card {
    aspect-ratio: 16/9;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

/* Hover Effect: Scale Up + Glow */
.card-wrapper:hover {
    transform: translateY(-4px);
    /* Reduced lift */
    z-index: 10;
}

.card-wrapper:hover .card {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow), 0 10px 30px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Compact Info Area */
.card-info {
    padding: 0 2px;
}

.card-title {
    font-size: 0.85rem;
    /* Smaller font */
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.card-meta {
    font-size: 0.75rem;
    /* Smaller meta info */
    color: var(--text-tertiary);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-meta .dot {
    opacity: 0.5;
}

.card-wrapper:hover .card-title {
    color: #fff;
}

/* Overlays (Progress Bars etc) */
.card-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.4);
    z-index: 5;
    /* Ensure it stays at the bottom */
}

.card-progress-bar {
    height: 100%;
    background: var(--accent-color, #e50914);
    box-shadow: 0 0 4px rgba(229, 9, 20, 0.6);
    transition: width 0.3s ease;
}

.card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
    /* Move to right for posters looks cleaner */
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Upcoming Badge - For unreleased content */
.upcoming-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 5;
}

/* Top 10 Rank Number (Apple TV+ style - large number on card) */
.card-wrapper.has-rank {
    position: relative;
}

.card-wrapper.has-rank .card {
    position: relative;
}

.rank-number {
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e0f7fa 0%, #ffffff 40%, #b0bec5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    z-index: 5;
    line-height: 1;
}

/* Hide legacy overlay text to keep it clean */
.card-overlay {
    display: none;
}

/* ============================================
   Content Grid
   ============================================ */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 24px 16px;
    padding: 30px 24px var(--space-lg);
}

.content-grid .card-wrapper {
    width: 100%;
}

.content-grid .card {
    aspect-ratio: 2/2.8;
}

/* ============================================
   Detail Page - Immersive Glass
   ============================================ */
.detail-hero {
    position: relative;
    min-height: 85vh;
    /* Almost full screen */
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.detail-hero-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Gradient Overlay - Smooth fade at bottom to content */


.detail-hero-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.detail-type-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 6px 12px;
    border-radius: 20px;
}

.detail-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: var(--space-md);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-lg);
    font-weight: 500;
}

.detail-rating-badge {
    color: var(--accent-gold);
}

.detail-year {
    opacity: 0.8;
}

.detail-age-rating {
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.genre-pill {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.detail-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    max-width: 100%;
}

.detail-primary-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

/* ============================================
   Detail Sections (Cast, Episodes)
   ============================================ */
.detail-body {
    background: var(--bg-base);
    position: relative;
    z-index: 5;
}

.detail-section {
    padding: var(--space-lg) var(--content-padding);
    position: relative;
    z-index: 2;
}

.detail-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

/* Episodes - Horizontal List usually, or Grid */
.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Joined list look? No, lets do separated glass cards */
    gap: 16px;
}

.episode-card {
    display: flex;
    gap: 24px;
    padding: 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    border: 1px solid transparent;
}

.episode-card:hover {
    background: var(--bg-hover);
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

.episode-thumbnail {
    width: 240px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.episode-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.episode-card:hover .episode-thumbnail img {
    transform: scale(1.05);
}

.episode-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.episode-number {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.episode-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.episode-desc {
    font-size: 0.95rem;
    color: var(--text-tertiary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Sources & Server List
   ============================================ */
/* ============================================
   Sources Page Styles
   ============================================ */
.sources-page {
    padding: 100px var(--content-padding) 60px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.stat-value.success {
    color: var(--accent-success);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Source List Grid */
.source-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

/* Source Card */
.source-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
}

.source-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.source-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.source-info {
    flex: 1;
    min-width: 0;
}

.source-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-url {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #fff;
}

.empty-state-description {
    max-width: 400px;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Page Header Adjustments */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
        justify-content: center;
        white-space: nowrap;
        font-size: 0.9rem;
        padding: 10px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .source-list {
        grid-template-columns: 1fr;
    }

    .source-card {
        padding: 16px;
    }
}

/* ============================================
   Form Styles
   ============================================ */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 1rem;
    color: #fff;
    transition: all var(--transition-fast);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
    line-height: 1.5;
}

.form-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 8px;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

/* ============================================
   Settings Panel - Glass Overlay
   ============================================ */
.settings-panel {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(40px) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    width: 380px;
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.settings-panel.active {
    transform: translateX(0);
}

.settings-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
}

.settings-title {
    font-weight: 600;
    letter-spacing: -0.5px;
}

.settings-item {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.settings-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   Loading
   ============================================ */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--text-primary);
    /* White spinner */
}

/* ============================================
   Modal Overlay (Generic)
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: rgba(30, 30, 30, 0.85);
    /* Glass */
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    color: #fff;
}

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

.modal-header h3 {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

/* ============================================
   Search Modal - Liquid Glass
   ============================================ */
.search-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.search-modal {
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.search-modal-overlay.active .search-modal {
    transform: translateY(0);
}

.search-modal-input-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(50, 50, 55, 0.7);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 16px 24px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.search-modal-input-wrap svg {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.search-modal-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 400;
}

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

.search-modal-hint {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Page Transitions & Loading Animations
   ============================================ */

/* Page Fade Transition */
.page-transition {
    animation: fadeIn 0.4s ease-out forwards;
}

.page-exit {
    animation: fadeOut 0.3s ease-in forwards;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Skeleton Loading System */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.08) 37%,
            rgba(255, 255, 255, 0.03) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.skeleton-card {
    aspect-ratio: 2/3;
    width: 170px;
    flex-shrink: 0;
}

.skeleton-title {
    height: 1rem;
    width: 80%;
    margin-top: 12px;
}

.skeleton-meta {
    height: 0.8rem;
    width: 40%;
    margin-top: 6px;
}

.skeleton-hero {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    margin-bottom: var(--space-lg);
}

/* Staggered entrance for cards */
.stagger-in>* {
    opacity: 0;
    animation: staggerFadeIn 0.5s ease-out forwards;
}

@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add delays via JS or a few classes */
.stagger-in>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-in>*:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-in>*:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger-in>*:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger-in>*:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger-in>*:nth-child(6) {
    animation-delay: 0.3s;
}

/* ==========================================================================
   APPLE TV AESTHETICS - DETAIL PAGE & HERO
   ========================================================================== */

/* Metadata Badges */
.badge-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0;
    flex-wrap: wrap;
}

.badge-capsule {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: normal;
}

.badge-capsule.badge-solid {
    background: #fff;
    color: #000;
    border: none;
}

.detail-type-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 8px;
}

/* Superhero Lockup (Detail Hero Improvements) */
.detail-hero {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 var(--content-padding) 10px;
    overflow: hidden;
}

.detail-hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.detail-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 30%, transparent 60%),
        linear-gradient(180deg,
            transparent 0%,
            rgba(0, 0, 0, 0) 30%,
            rgba(0, 0, 0, 0.1) 45%,
            rgba(0, 0, 0, 0.3) 60%,
            rgba(0, 0, 0, 0.5) 75%,
            rgba(0, 0, 0, 0.8) 88%,
            rgba(0, 0, 0, 0.95) 96%,
            var(--bg-base) 100%);
    z-index: 2;
    pointer-events: none;
}

.detail-poster-compact {
    width: 140px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    display: block;
    aspect-ratio: 2/3;
    object-fit: cover;
}

@media (max-width: 768px) {
    .detail-poster-compact {
        display: none;
    }

    .detail-hero {
        min-height: 50vh;
        padding-bottom: 20px;
    }
}

.detail-hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
}

.detail-title-logo {
    max-width: 450px;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.detail-description-immersive {
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    max-width: 550px;
    margin: 12px 0 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Premium Buttons */
.apple-btn-play {
    background: #fff;
    color: #000;
    border: none;
    padding: 10px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.apple-btn-play:hover {
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
}

.apple-btn-play:active {
    transform: scale(0.95);
}

.apple-btn-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apple-btn-circle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.detail-hero-aside {
    position: absolute;
    bottom: 80px;
    right: var(--content-padding);
    text-align: left;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    z-index: 3;
    max-width: 280px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 20px;
}

.aside-item {
    margin-bottom: 16px;
}

.aside-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    margin-bottom: 4px;
}

.aside-value {
    color: #fff;
    font-weight: 500;
}

@media (max-width: 1024px) {
    .detail-hero-aside {
        display: none;
    }
}

@media (max-width: 768px) {
    .detail-hero {
        height: auto;
        padding-top: 120px;
        min-height: 500px;
        padding-bottom: 40px;
    }

    .detail-description-immersive {
        font-size: 1rem;
        margin: 16px 0 24px;
    }

}

/* ============================================
   Cast Layout (Circular)
   ============================================ */
.cast-scroller {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 0 10px;
    /* Reduced padding from 10px 0 30px */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.cast-scroller::-webkit-scrollbar {
    display: none;
}

.cast-card {
    flex: 0 0 auto;
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.cast-card:hover {
    transform: scale(1.05);
}

.cast-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    background: #333;
    display: block;
}

.cast-card:hover .cast-avatar {
    border-color: #fff;
}

.cast-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 2px;
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cast-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ============================================
   Toast Notifications
   ============================================ */
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(20px);
    animation: slideUp 0.3s forwards;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    border-left: 3px solid #2ecc71;
}

.toast.error {
    border-left: 3px solid #e74c3c;
}

.toast.info {
    border-left: 3px solid #3498db;
}

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

/* ============================================
   Detail Info Layout (Plot + Aside)
   ============================================ */
.detail-info-container {
    display: flex;
    flex-direction: column;
    /* Stack Info Panel on top of Summary */
    gap: 20px;
    align-items: flex-start;
}

.plot-summary-wrapper {
    width: 100%;
}

.detail-description-immersive {
    font-size: 0.95rem;
    /* Reduced font size */
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    /* Reduced "boldness" via opacity */
    margin-top: 10px;
    font-weight: 400;
    /* Ensure not bold */
}

.about-grid {
    width: 100%;
    /* Full width */
    display: flex;
    flex-direction: row;
    /* Horizontal on Desktop */
    flex-wrap: wrap;
    gap: 25px;
    /* Space between items */
    padding-left: 0;
    border-left: none;
    margin-bottom: 20px;
}

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

.aside-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

.aside-value {
    color: #fff;
    font-weight: 500;
    font-size: 1.1rem;
}

.genre-value {
    /* Smaller font for genres */
    line-height: 1.4;
    opacity: 0.9;
}

/* Mobile Layout for Detail Info */
@media (max-width: 768px) {
    .detail-info-container {
        gap: 12px;
    }

    .about-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* 2 Columns on Mobile */
        gap: 20px;
        margin-bottom: 10px;
    }

    .detail-description {
        font-size: 0.9rem;
    }
}

/* ============================================
   Hero Aside (Starring / Director on Right)
   ============================================ */
.detail-hero-aside {
    position: absolute;
    bottom: 25px;
    /* Moved closer to bottom */
    right: 40px;
    /* Moved closer to right edge */
    z-index: 10;
    text-align: left;
    /* Changed from right to left */
    display: flex;
    flex-direction: column;

    border-left: 1px solid rgba(255, 255, 255, 0.3);
    /* Vertical Line */

}

.detail-hero-aside .aside-item {
    display: grid;
    grid-template-columns: max-content 1fr;
    /* Tightest possible column */
    align-items: baseline;
    gap: 12px;
    /* Fixed gap between label and value */
}

.detail-hero-aside .aside-label {
    font-size: 0.65rem;
    /* Ultra compact label */
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
}

.detail-hero-aside .aside-value {
    font-size: 0.85rem;
    /* Compact value */
    color: #fff;
    font-weight: 500;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .detail-hero-aside {
        display: none;
        /* Hide on mobile to avoid clutter */
    }
}

/* ============================================
   OTT Availability Panel
   ============================================ */
.ott-btn-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Pill-style OTT button */
.ott-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

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

.ott-btn svg {
    flex-shrink: 0;
}

/* Floating dropdown panel */
.ott-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(18, 18, 20, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 8px;
    min-width: 230px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.ott-panel.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

/* Panel header */
.ott-panel-header {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 6px 12px 8px;
}

/* Individual OTT link */
.ott-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    transition: background 0.15s;
    cursor: pointer;
}

.ott-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ott-item-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ott-item-info {
    flex: 1;
    min-width: 0;
}

.ott-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ott-item-type {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 1px;
    text-transform: capitalize;
}

.ott-item-arrow {
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* No sources badge */
.no-source-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 60, 60, 0.12);
    border: 1px solid rgba(255, 60, 60, 0.3);
    border-radius: 40px;
    color: rgba(255, 140, 140, 0.9);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: default;
    white-space: nowrap;
}

/* ============================================
   OTT Modal Items (No Source Found modal)
   ============================================ */
.ott-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    transition: background 0.15s;
}

.ott-modal-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ott-modal-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ott-modal-item-info {
    flex: 1;
    min-width: 0;
}

.ott-modal-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ott-modal-item-type {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 1px;
    text-transform: capitalize;
}