/* --- Theme Variables --- */
:root {
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --bg-jumbotron: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #212529;
    --text-muted: #6c757d;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --card-shadow-hover: rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --bg-jumbotron: linear-gradient(135deg, #3a1c71 0%, #d76d77 50%, #ffaf7b 100%);
    --text-primary: #e0e0e0;
    --text-muted: #adb5bd;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --card-shadow-hover: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.movie-card {
    transition: transform 0.2s, box-shadow 0.3s, background-color 0.3s;
    border: none;
    box-shadow: 0 2px 4px var(--card-shadow);
    background-color: var(--bg-card);
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px var(--card-shadow-hover);
}

.movie-card img {
    height: 450px;
    object-fit: cover;
}

.jumbotron {
    background: var(--bg-jumbotron);
    color: white;
}

/* Dark mode overrides */
[data-bs-theme="dark"] .card {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: var(--text-primary);
}

/* Dark mode toggle button */
.dark-mode-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.2s;
    font-size: 1.1rem;
    padding: 0;
}

.dark-mode-toggle:hover {
    border-color: white;
    transform: scale(1.1);
}

.navbar-dark {
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 100%) !important;
}

.card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Movie detail page - original backdrop header (kept for compatibility) */
.movie-backdrop {
    height: 300px;
    background-size: cover;
    background-position: center top;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.backdrop-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

/* Movie detail page - trailer embed */
.card .ratio iframe {
    border: none;
}


/* ========================================
   FEATURE 1: Enhanced Backdrop Banner Styles
   ======================================== */

/* Backdrop Banner */
.backdrop-banner {
    position: relative;
    width: calc(100% + 30px);
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
    margin-left: -15px;
    margin-right: -15px;
    margin-top: -15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.backdrop-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.backdrop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.6) 70%,
        rgba(0, 0, 0, 0.9) 100%
    );
}

.backdrop-content {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    z-index: 10;
}

.backdrop-content h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.backdrop-content p {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Dark mode backdrop adjustments */
[data-bs-theme="dark"] .backdrop-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.8) 70%,
        rgba(18, 18, 18, 0.95) 100%
    );
}

[data-bs-theme="dark"] .backdrop-banner {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments for backdrop */
@media (max-width: 768px) {
    .backdrop-banner {
        height: 300px;
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
    }

    .backdrop-content {
        bottom: 20px;
        left: 20px;
        right: 20px;
    }

    .backdrop-content h1 {
        font-size: 2rem !important;
    }

    .backdrop-content p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .backdrop-banner {
        height: 250px;
    }

    .backdrop-content h1 {
        font-size: 1.5rem !important;
    }
}


/* ========================================
   FEATURE 4: Pagination Styles
   ======================================== */

/* Pagination */
.pagination-wrapper {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.pagination {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.page-link {
    color: #007bff;
    border-radius: 4px;
    margin: 0 2px;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
}

.page-link:hover {
    background-color: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    color: white;
    font-weight: 600;
}

.page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
}

/* Dark mode pagination */
[data-bs-theme="dark"] .page-link {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .page-link:hover {
    background-color: #3d3d3d;
    border-color: #555;
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
    background-color: #1a1a1a;
    border-color: #333;
    color: #555;
}

/* Responsive pagination */
@media (max-width: 576px) {
    .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.875rem;
    }

    .pagination {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
}


/* ========================================
   FEATURE 5: Similar Movies Card Hover Effects
   ======================================== */

.similar-movie-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.similar-movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.similar-movie-card img {
    transition: opacity 0.2s ease;
}

.similar-movie-card:hover img {
    opacity: 0.9;
}

/* Dark mode adjustments for similar movies */
[data-bs-theme="dark"] .similar-movie-card {
    background-color: #2d2d2d;
    border-color: #444;
}

[data-bs-theme="dark"] .similar-movie-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}


/* ========================================
   Additional General Improvements
   ======================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading animation for images */
img {
    image-rendering: -webkit-optimize-contrast;
}

/* Better link hover states */
a {
    transition: color 0.2s ease;
}

/* Badge improvements */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Alert improvements */
.alert {
    border-radius: 8px;
}

/* Card improvements */
.card {
    border-radius: 8px;
    overflow: hidden;
}

/* Progress bar improvements */
.progress {
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Button improvements */
.btn {
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Form improvements */
.form-select,
.form-control {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus,
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

/* Dark mode form improvements */
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-control:focus {
    background-color: #3d3d3d;
    border-color: #007bff;
}

/* Utility classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1090;
    max-width: 360px;
    width: 100%;
}

.toast {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    margin-bottom: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}

.toast-success { background-color: #198754; color: white; }
.toast-danger  { background-color: #dc3545; color: white; }
.toast-warning { background-color: #ffc107; color: #212529; }
.toast-info    { background-color: #0dcaf0; color: #212529; }

.toast .btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

[data-bs-theme="dark"] .toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 576px) {
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        max-width: 100%;
    }
}

/* ========================================
   SEARCH AUTOCOMPLETE
   ======================================== */

.autocomplete-wrapper {
    min-width: 220px;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    max-height: 360px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: #212529;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f0f4ff;
    color: #212529;
}

.autocomplete-poster {
    width: 36px;
    height: 54px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.autocomplete-poster-placeholder {
    width: 36px;
    height: 54px;
    background: #dee2e6;
    border-radius: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #6c757d;
}

.autocomplete-title {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.autocomplete-meta {
    font-size: 0.75rem;
    margin-top: 2px;
}

[data-bs-theme="dark"] .autocomplete-dropdown {
    background: #2d2d2d;
    border-color: #444;
}

[data-bs-theme="dark"] .autocomplete-item {
    color: #e0e0e0;
    border-bottom-color: #3d3d3d;
}

[data-bs-theme="dark"] .autocomplete-item:hover,
[data-bs-theme="dark"] .autocomplete-item.active {
    background-color: #3a3a5c;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .autocomplete-poster-placeholder {
    background: #444;
    color: #888;
}


/* ========================================
   MOVIE COMPARISON
   ======================================== */

.movie-card-wrapper {
    position: relative;
}

.compare-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    cursor: pointer;
    z-index: 5;
    padding: 0;
    line-height: 1;
}

.movie-card-wrapper:hover .compare-toggle,
.compare-toggle.selected {
    opacity: 1;
}

.compare-toggle.selected {
    background: #0d6efd;
    border-color: #0d6efd;
}

.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    color: #fff;
    padding: 12px 20px;
    z-index: 1050;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.compare-bar.visible {
    transform: translateY(0);
}

.compare-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.compare-bar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #adb5bd;
    white-space: nowrap;
}

.compare-bar-movies {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.compare-bar-movie {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 4px 10px 4px 6px;
    font-size: 0.8rem;
    max-width: 180px;
}

.compare-bar-movie img {
    width: 20px;
    height: 30px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.compare-bar-movie span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compare-bar-movie-remove {
    margin-left: 2px;
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.compare-bar-movie-remove:hover {
    opacity: 1;
}

.compare-bar-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .compare-bar {
        padding: 10px 12px;
    }
    .compare-bar-movie {
        max-width: 130px;
    }
}


/* =============================================
   Skeleton Loading Screens
   ============================================= */

@keyframes skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--skeleton-base) 25%,
        var(--skeleton-highlight) 50%,
        var(--skeleton-base) 75%
    );
    background-size: 800px 100%;
    animation: skeleton-shimmer 1.4s infinite linear;
    border-radius: 4px;
}

:root {
    --skeleton-base:      #e0e0e0;
    --skeleton-highlight: #f0f0f0;
}

[data-bs-theme="dark"] {
    --skeleton-base:      #2a2a2a;
    --skeleton-highlight: #3a3a3a;
}

/* Skeleton movie card — mirrors .movie-card structure */
.skeleton-card {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--card-shadow);
}

.skeleton-poster {
    width: 100%;
    height: 450px;
}

.skeleton-card-body {
    padding: 8px;
    background-color: var(--bg-card);
}

.skeleton-title {
    height: 14px;
    width: 85%;
    margin-bottom: 8px;
}

.skeleton-meta {
    height: 12px;
    width: 50%;
    margin-bottom: 8px;
}

.skeleton-badge {
    height: 20px;
    width: 55px;
    border-radius: 12px;
}

/* Button spinner helper */
.btn-loading {
    pointer-events: none;
    opacity: 0.75;
}

/* ========================================
   HOME PAGE
   ======================================== */

/* Hero */
.home-hero {
    background: var(--bg-jumbotron);
    color: white;
    padding: 2.5rem 3rem;
    min-height: 240px;
    display: flex;
    align-items: center;
}

.home-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 2rem;
}

.home-hero-left {
    flex: 1;
}

.home-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    letter-spacing: -0.5px;
}

.home-hero-sub {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 1.25rem;
}

.home-hero-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.home-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.home-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.home-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
    margin-top: 2px;
}

.home-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.3);
}

.home-hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.home-btn {
    font-weight: 600;
    padding: 0.6rem 1.4rem;
}

/* Logo in hero */
.home-hero-right {
    flex-shrink: 0;
}

.home-hero-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.35));
    transition: transform 0.3s ease;
}

.home-hero-logo:hover {
    transform: scale(1.05) rotate(3deg);
}

/* Feature cards */
.home-feature-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: 0 2px 8px var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.home-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px var(--card-shadow-hover);
}

.home-feature-icon {
    font-size: 2rem;
    color: #4f86f7;
    display: block;
    margin-bottom: 0.5rem;
}

.home-feature-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.home-feature-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Section header with "See all" link */
.home-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(128,128,128,0.15);
    padding-bottom: 0.5rem;
}

.home-see-all {
    font-size: 0.85rem;
    color: #4f86f7;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.home-see-all:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Responsive hero */
@media (max-width: 768px) {
    .home-hero {
        padding: 2rem 1.5rem;
    }

    .home-hero-title {
        font-size: 1.8rem;
    }

    .home-hero-logo {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 576px) {
    .home-hero-right {
        display: none;
    }

    .home-hero-stats {
        gap: 0.75rem;
    }

    .home-stat-value {
        font-size: 1.1rem;
    }
}

/* Print styles */
@media print {
    .backdrop-banner,
    .pagination,
    .btn,
    .navbar {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* ========================================
   NAVBAR HOVER DROPDOWNS
   ======================================== */

@media (min-width: 992px) {
    .navbar .dropdown:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
    }

    .navbar .dropdown > .dropdown-toggle:active {
        pointer-events: none;
    }
}

/* ========================================
   WATCH PROVIDERS
   ======================================== */

.watch-provider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 56px;
    text-align: center;
}

.watch-provider-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 1px 4px var(--card-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.watch-provider:hover .watch-provider-logo {
    transform: scale(1.08);
    box-shadow: 0 3px 8px var(--card-shadow-hover);
}

.watch-provider-name {
    font-size: 0.6rem;
    color: var(--text-muted);
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* Page header */
.as-header {
    background: var(--bg-jumbotron);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    color: white;
}

.as-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.as-title {
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
    letter-spacing: -0.3px;
}

.as-subtitle {
    margin: 0;
    opacity: 0.85;
    font-size: 0.95rem;
}

.as-result-badge {
    text-align: center;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    flex-shrink: 0;
}

.as-result-count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.as-result-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
}

/* Two-column layout */
.as-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Sidebar filter panel */
.as-sidebar {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--card-shadow);
    position: sticky;
    top: 80px;
}

.as-filter-group {
    margin-bottom: 1.25rem;
}

.as-filter-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.as-search-input-wrap {
    position: relative;
}

.as-search-input {
    padding-right: 2rem;
}

.as-clear-input {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

.as-clear-input:hover {
    color: var(--text-primary);
}

.as-select,
.as-input {
    font-size: 0.875rem;
}

.as-or-divider {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.4rem 0;
    position: relative;
}

.as-or-divider::before,
.as-or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: rgba(128,128,128,0.2);
}

.as-or-divider::before { left: 0; }
.as-or-divider::after  { right: 0; }

.as-range-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.as-range-sep {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.as-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 0.25rem;
}

.as-filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.as-search-btn {
    flex: 1;
    font-weight: 600;
}

.as-reset-btn {
    flex-shrink: 0;
    font-size: 0.85rem;
}

/* Active filter pills */
.as-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(128,128,128,0.15);
}

.as-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(79, 134, 247, 0.12);
    border: 1px solid rgba(79, 134, 247, 0.3);
    color: #4f86f7;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.as-pill-remove {
    color: inherit;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.7;
}

.as-pill-remove:hover {
    opacity: 1;
    color: inherit;
}

/* Results section */
.as-results-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.as-movie-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.as-movie-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--card-shadow-hover);
}

/* Genre tags on result cards */
.as-genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.as-genre-tag {
    font-size: 0.65rem;
    background: rgba(128,128,128,0.12);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Empty state */
.as-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.as-empty-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.35;
}

.as-empty-state h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.as-empty-state p {
    max-width: 400px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* Quick-search buttons on empty state */
.as-quick-searches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.as-qs-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.as-qs-btn {
    font-size: 0.82rem;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    border: 1px solid rgba(79,134,247,0.4);
    color: #4f86f7;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    background: rgba(79,134,247,0.07);
}

.as-qs-btn:hover {
    background: #4f86f7;
    color: white;
    border-color: #4f86f7;
}

/* Responsive */
@media (max-width: 992px) {
    .as-layout {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 768px) {
    .as-layout {
        grid-template-columns: 1fr;
    }

    .as-sidebar {
        position: static;
    }

    .as-header {
        padding: 1.5rem;
    }

    .as-title {
        font-size: 1.5rem;
    }
}

/* ========================================
   ACTOR COLLABORATION NETWORK
   ======================================== */

.an-header {
    background: var(--bg-jumbotron);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    color: white;
}

.an-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.an-header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.an-actor-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.an-header-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.75;
    margin: 0 0 0.2rem;
}

.an-header-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    letter-spacing: -0.3px;
}

.an-header-meta {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0;
}

/* Controls bar */
.an-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.an-legend {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.an-legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid transparent;
}

.an-legend-focal {
    background: #4f86f7;
    border-color: #2563eb;
}

.an-legend-collab {
    background: #e8eeff;
    border-color: #4f86f7;
}

[data-bs-theme="dark"] .an-legend-collab {
    background: #3a3a5c;
    border-color: #6366f1;
}

.an-legend-line {
    display: inline-block;
    width: 24px;
    height: 2px;
    background: rgba(79,134,247,0.5);
    border-radius: 2px;
    vertical-align: middle;
}

.an-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Graph canvas */
.an-graph-wrap {
    position: relative;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--card-shadow);
    overflow: hidden;
    width: 100%;
}

#an-svg {
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
}

/* Tooltip */
.an-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(15,15,30,0.92);
    color: #fff;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
    line-height: 1.5;
}

.an-tt-sub {
    opacity: 0.75;
    font-size: 0.75rem;
}

.an-tt-movie {
    display: block;
    font-size: 0.75rem;
    opacity: 0.9;
    padding: 1px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* Empty state */
.an-empty {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
}

.an-empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.an-empty h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

@media (max-width: 576px) {
    .an-header {
        padding: 1.25rem;
    }
    .an-header-name {
        font-size: 1.35rem;
    }
    .an-actor-thumb {
        width: 52px;
        height: 52px;
    }
}

/* ========================================
   COMMON FILMS PAGE
   ======================================== */

.cf-header {
    background: var(--bg-jumbotron);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    color: white;
}

.cf-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cf-title {
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
}

.cf-subtitle {
    margin: 0;
    opacity: 0.85;
    font-size: 0.95rem;
}

.cf-result-badge {
    text-align: center;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    flex-shrink: 0;
}

.cf-result-count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.cf-result-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
}

/* Search panel */
.cf-search-panel {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 8px var(--card-shadow);
}

.cf-selected-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
}

/* Actor chips */
.cf-actor-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(79,134,247,0.12);
    border: 1px solid rgba(79,134,247,0.35);
    border-radius: 24px;
    padding: 4px 10px 4px 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4f86f7;
}

.cf-chip-photo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cf-chip-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-chip-remove {
    background: none;
    border: none;
    color: #4f86f7;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.7;
    flex-shrink: 0;
}

.cf-chip-remove:hover { opacity: 1; }

/* Search input */
.cf-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.cf-actor-input {
    font-size: 0.9rem;
}

/* Dropdown */
.cf-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid rgba(128,128,128,0.2);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px var(--card-shadow);
    z-index: 1100;
    max-height: 320px;
    overflow-y: auto;
}

.cf-dd-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(128,128,128,0.08);
    transition: background 0.12s;
}

.cf-dd-item:last-child { border-bottom: none; }

.cf-dd-item:hover,
.cf-dd-item.active {
    background: rgba(79,134,247,0.08);
}

.cf-dd-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cf-dd-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.cf-dd-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cf-dd-empty {
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Hint bar */
.cf-actor-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Results meta */
.cf-results-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Movie cards */
.cf-movie-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cf-movie-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--card-shadow-hover);
}

/* Empty state */
.cf-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.cf-empty-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.cf-empty-state h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cf-empty-state p {
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.6;
}

.cf-quick-pairs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cf-qs-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.cf-qs-example {
    font-size: 0.82rem;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    border: 1px solid rgba(128,128,128,0.2);
    color: var(--text-muted);
    background: rgba(128,128,128,0.05);
}

@media (max-width: 576px) {
    .cf-header { padding: 1.5rem; }
    .cf-title  { font-size: 1.5rem; }
    .cf-search-wrap { min-width: 100%; }
}
