/* ═══════════════════════════════════════════════════
   MOVIES PAGE STYLES - movies.css
   Extends base styles.css
═══════════════════════════════════════════════════ */

/* ── Nav overrides for movies page ── */
.movies-nav-right {
    gap: 16px;
}

.movies-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 8px 18px;
    width: 280px;
    transition: all 0.3s ease;
}

.movies-search-bar:focus-within {
    border-color: rgba(14, 165, 233, 0.5);
    background: rgba(14, 165, 233, 0.06);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.1);
}

.movies-search-bar i {
    color: var(--text-muted);
    font-size: 18px;
    flex-shrink: 0;
}

.movies-search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    width: 100%;
}

.movies-search-bar input::placeholder {
    color: var(--text-muted);
}

/* ── Movies Page Container ── */
.movies-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
}

/* ── HERO ── */
.movies-hero {
    position: relative;
    width: 100%;
    height: 480px;
    background: linear-gradient(135deg, #0a0528, #06091e, #010210);
    overflow: hidden;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.movies-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(14, 165, 233, 0.15) 0%, transparent 50%);
    z-index: 0;
}

/* Animated film strip pattern */
.movies-hero::after {
    content: '🎬🎞️🎬🎞️🎬🎞️🎬🎞️🎬🎞️🎬🎞️🎬🎞️';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    font-size: 60px;
    opacity: 0.03;
    white-space: nowrap;
    animation: filmScroll 20s linear infinite;
    z-index: 0;
}

@keyframes filmScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.hero-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(2, 3, 10, 0.95) 35%, rgba(2, 3, 10, 0.5) 100%);
    z-index: 1;
}

/* Hero BG image - injected by JS */
.movies-hero[style*="background-image"] .hero-bg-overlay {
    background: linear-gradient(to right, rgba(2, 3, 10, 0.97) 35%, rgba(2, 3, 10, 0.6) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 60px;
    max-width: 700px;
    animation: slideInUp 0.6s ease;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 800;
    color: #c4b5fd;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.hero-title {
    font-size: 42px;
    font-weight: 900;
    line-height: 1.15;
    color: #fff;
    margin-bottom: 14px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.6;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

.hero-btn-play {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 40px;
    padding: 12px 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}

.hero-btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5);
}

.hero-btn-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.hero-btn-info:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ── GENRE FILTER ── */
.genre-filter-wrap {
    background: rgba(5, 7, 20, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 40px;
    position: sticky;
    top: 80px;
    z-index: 50;
    backdrop-filter: blur(20px);
}

.genre-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px 0;
    scrollbar-width: none;
}

.genre-filters::-webkit-scrollbar {
    display: none;
}

.genre-pill {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 7px 18px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
}

.genre-pill:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
}

.genre-pill.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(99, 102, 241, 0.3));
    border-color: rgba(139, 92, 246, 0.6);
    color: #fff;
}

/* ── MOVIES MAIN CONTENT ── */
.movies-main {
    flex: 1;
    padding: 40px 40px 20px;
}

.movies-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.movies-section-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.movies-section-header h2 i {
    color: var(--accent-purple);
}

.movie-count {
    font-size: 13px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 4px 14px;
}

/* ── LOADING ── */
.movies-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.movies-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 12px;
    color: var(--text-muted);
    text-align: center;
}

.movies-empty i {
    font-size: 60px;
    color: rgba(255, 255, 255, 0.1);
}

.movies-empty h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
}

.movies-empty p {
    font-size: 13px;
}

/* ── MOVIES GRID ── */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 22px;
}

/* ── MOVIE CARD ── */
.movie-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(12, 14, 28, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeIn 0.4s ease;
}

.movie-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.1);
}

/* Poster */
.movie-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: linear-gradient(135deg, #0d0f22, #1a1d36);
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover .movie-poster img {
    transform: scale(1.08);
}

/* Poster fallback (no image) */
.movie-poster-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #0e0c2e, #1e1a4a);
}

.movie-poster-fallback i {
    font-size: 50px;
    color: rgba(139, 92, 246, 0.4);
}

.movie-poster-fallback span {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 0 10px;
}

/* Hover Play Button */
.movie-card-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.movie-card:hover .movie-card-play-overlay {
    opacity: 1;
}

.movie-card-play-overlay i {
    font-size: 56px;
    color: white;
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.8));
    transform: scale(0.8);
    transition: transform 0.3s;
}

.movie-card:hover .movie-card-play-overlay i {
    transform: scale(1);
}

/* Genre badge on card */
.movie-genre-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(139, 92, 246, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Type badge on card */
.movie-type-badge {
    background: rgba(14, 165, 233, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

.movie-type-badge.tv-series {
    background: rgba(245, 158, 11, 0.85);
}

/* Info section */
.movie-card-info {
    padding: 12px 14px 14px;
}

.movie-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status Badge in Title Area */
.movie-status-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.movie-status-badge.ongoing {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.movie-status-badge.completed {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.movie-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.movie-card-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ═══════════════════════════════════════════════════
   MOVIE MODAL / PLAYER
═══════════════════════════════════════════════════ */
.movie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.movie-modal-overlay.hidden {
    display: none;
}

.movie-modal {
    background: linear-gradient(180deg, #0c0e1e, #080a18);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(139, 92, 246, 0.08);
    animation: slideInUp 0.3s ease;
}

.movie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
}

.modal-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 900;
    color: var(--accent-purple);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.movie-modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

/* Player Area */
.movie-player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

/* Facebook video wrapper */
.fb-video-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fb-video-wrapper iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
}

/* The FB iFrame SDK uses div.fb-video */
.fb-video-wrapper .fb-video {
    width: 100%;
    height: 100%;
}

/* Raw video / other embed */
.raw-video-wrapper {
    position: absolute;
    inset: 0;
}

.raw-video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Player loading overlay */
.player-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 14px;
    z-index: 5;
    transition: opacity 0.3s;
}

.player-loading-overlay.hidden {
    display: none;
}

/* Modal Meta */
.modal-movie-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px 0;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.modal-movie-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-movie-meta span:not(:last-child)::after {
    content: '·';
    margin-left: 16px;
    color: rgba(255, 255, 255, 0.2);
}

.modal-movie-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    padding: 10px 24px 0;
    max-width: 650px;
}

.modal-help-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 24px 20px;
    background: rgba(14, 165, 233, 0.06);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-help-note i {
    color: var(--accent-blue);
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero-content {
        padding: 0 24px;
    }

    .hero-title {
        font-size: 28px;
    }

    .movies-hero {
        height: 360px;
    }

    .genre-filter-wrap {
        padding: 0 20px;
    }

    .movies-main {
        padding: 24px 20px;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .movies-search-bar {
        width: 200px;
    }

    .movie-modal {
        border-radius: 14px;
        width: 100%;
        margin: 0;
    }

    .movie-modal-header h3 {
        font-size: 15px;
    }

    .nav-links {
        display: none;
    }

    .movie-modal-overlay {
        padding: 10px;
    }

    .movie-modal-header {
        padding: 14px 16px;
    }

    .modal-movie-meta,
    .modal-movie-desc,
    .modal-help-note {
        padding-left: 16px;
        padding-right: 16px;
        margin-left: 0;
        margin-right: 0;
    }

    .episodes-list-container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 480px) {
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Episodes List in Modal ── */
.episodes-list-container {
    padding: 0 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.episodes-list-container.hidden {
    display: none;
}

.episodes-list-container h4 {
    font-size: 15px;
    font-weight: 800;
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.episodes-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 10px;
    padding-left: 10px;
}

.episodes-grid::-webkit-scrollbar {
    width: 6px;
}

.episodes-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.episodes-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.episode-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    width: 100%;
    max-width: 500px;
}

.episode-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.episode-item.active {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.4);
    color: #0ea5e9;
}

.episode-item i {
    font-size: 18px;
    flex-shrink: 0;
}

.ep-title-txt {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}