/* --- SYSTEM DESIGN & VARIABLES --- */
:root {
    --bg-dark: #000000;
    --bg-surface: rgba(255, 255, 255, 0.04);
    --bg-surface-hover: rgba(255, 255, 255, 0.08);
    --primary: #ffffff; /* Apple White focus */
    --primary-glow: rgba(255, 255, 255, 0.25);
    --primary-hover: #e5e5ea;
    --accent: #5856d6; /* iOS Indigo */
    --accent-glow: rgba(88, 86, 214, 0.35);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-dark: rgba(255, 255, 255, 0.35);
    --glass-bg: rgba(18, 18, 23, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-focus: rgba(255, 255, 255, 0.25);
    --card-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    --hover-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 30px rgba(255, 255, 255, 0.06);
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro Icons", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-medium: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.15s ease;
}

/* --- RESET & GLOBAL STYLES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
    letter-spacing: -0.015em;
}

/* Liquid Ambient Background */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-color: var(--bg-dark);
    overflow: hidden;
    pointer-events: none;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.45;
    animation: float 28s infinite alternate ease-in-out;
}
.blob1 {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.65) 0%, rgba(99, 102, 241, 0) 70%);
    animation-duration: 32s;
}
.blob2 {
    bottom: -20%;
    right: -10%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.55) 0%, rgba(236, 72, 153, 0) 70%);
    animation-duration: 38s;
    animation-delay: -6s;
}
.blob3 {
    top: 35%;
    left: 25%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.45) 0%, rgba(20, 184, 166, 0) 70%);
    animation-duration: 25s;
    animation-delay: -12s;
}
@keyframes float {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    50% {
        transform: translate(8%, 12%) scale(1.15) rotate(180deg);
    }
    100% {
        transform: translate(-4%, -8%) scale(0.9) rotate(360deg);
    }
}

/* SVG Icon Helper Styles */
.svg-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
}
.btn-icon-svg {
    margin-right: 8px;
    width: 22px;
    height: 22px;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
}

body {
    background-color: transparent;
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.45;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* --- HEADER & NAVIGATION (APPLE DUAL NAVBAR) --- */
#global-announcement-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 38px;
    background-color: #161617;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.announcement-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f5f5f7;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.announcement-dot {
    width: 6px;
    height: 6px;
    background-color: #30d158;
    border-radius: 50%;
    box-shadow: 0 0 6px #30d158;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
    position: fixed;
    top: 38px;
    left: 0;
    width: 100%;
    margin-top: 0;
    z-index: 999;
    background: rgba(22, 22, 23, 0.72);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

header.scrolled {
    margin-top: 0;
    background: rgba(10, 10, 12, 0.85);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 0 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.brand {
    display: flex;
    align-items: center;
    color: var(--text-main);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.brand:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 6px;
}

.nav-link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    transition: var(--transition-medium);
}

.nav-link-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-link-btn.active {
    color: #000000 !important;
    background-color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25);
}

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

/* Search Box Custom styling */
.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 4px 6px;
    transition: var(--transition-smooth);
    width: 42px; /* Trạng thái thu gọn */
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.search-container.active {
    width: 260px; /* Trạng thái mở rộng */
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.06);
}

.search-icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.search-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.search-container input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.9rem;
    width: 0;
    padding: 0;
    transition: var(--transition-smooth);
}

.search-container.active input {
    width: 175px;
    padding: 0 8px;
}

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

.search-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition-fast);
}

.search-clear-btn:hover {
    color: var(--text-main);
}

/* User Status Indicator */
.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: #30d158; /* Apple green */
    box-shadow: 0 0 8px #30d158;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}



/* --- MOBILE BOTTOM NAVIGATION --- */
.mobile-nav-bar {
    display: none; /* Ẩn trên desktop */
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    width: 100%;
    height: 80vh;
    background-size: cover;
    background-position: center 20%;
    display: flex;
    align-items: center;
    transition: background-image 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #000000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 90%),
                linear-gradient(to top, #000000 0%, rgba(0, 0, 0, 0.25) 20%, transparent 60%);
}

.hero-content {
    position: relative;
    padding-left: 6%;
    max-width: 650px;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.15;
    letter-spacing: -0.025em;
    text-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 500;
}

.hero-meta .rating {
    color: #ffb83b;
    font-weight: 700;
}

.hero-meta .year {
    color: var(--text-main);
}

.hero-meta .duration {
    color: var(--text-muted);
}

.hero-meta .quality-tag {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-overview {
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 30px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 14px;
}

.btn {
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-medium);
}

.btn-icon-symbol {
    font-size: 1.1rem;
}

.btn-play {
    background-color: #ffffff;
    color: #000000;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}

.btn-play:hover {
    background-color: #f2f2f7;
    transform: scale(1.04);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.35);
}

.btn-info {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-info:hover {
    background-color: rgba(255, 255, 255, 0.16);
    border-color: rgba(255,255,255,0.22);
    transform: scale(1.04);
}

/* --- MOVIE CATEGORY ROWS --- */
.rows-container {
    padding: 0 4% 80px 4%;
    position: relative;
    top: -65px;
    z-index: 5;
}

.movie-row {
    margin-bottom: 36px;
    position: relative;
}

.row-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.015em;
    color: var(--text-main);
}

.row-title span {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 10px;
    opacity: 0.8;
}

/* Horizontal Scroll logic */
.row-slider-wrapper {
    position: relative;
}

.row-slider {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    scroll-behavior: smooth;
    padding: 10px 0 24px 0;
    scrollbar-width: none; /* Firefox */
}

.row-slider::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

/* Slider Controls (Hover Arrows) */
.slider-arrow {
    position: absolute;
    top: calc(50% - 12px);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    opacity: 0;
    transform: translateY(-50%) scale(0.9);
    transition: var(--transition-medium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.row-slider-wrapper:hover .slider-arrow {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.slider-arrow:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.25);
}

.slider-arrow.left-arrow { left: -22px; }
.slider-arrow.right-arrow { right: -22px; }

/* MOVIE CARD IN ROW */
.movie-card {
    flex: 0 0 calc(100% / 6 - 14px); /* 6 cards per row on desktop */
    min-width: 175px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    position: relative;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    transition: var(--transition-medium);
}

/* Apple Poster Image Container */
.movie-card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: var(--transition-smooth);
}

/* Light brightness dim overlay on hover */
.movie-card-poster::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: var(--transition-medium);
    z-index: 1;
}

/* Hover effects for Apple cards */
.movie-card:hover .movie-card-poster {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--hover-shadow);
    border-color: rgba(255, 255, 255, 0.22);
}

.movie-card:hover .movie-card-poster::after {
    opacity: 1;
}

/* Card Episode Badge (for TV shows) */
.card-episode-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(88, 86, 214, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    pointer-events: none;
}

/* Play button hover overlay (Clean SVG inside circle) */
.play-card-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    z-index: 3;
    transition: var(--transition-smooth);
    color: white;
}

.movie-card:hover .play-card-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-play-svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
    fill: currentColor;
}

/* Apple Card Text Information underneath */
.movie-card-info {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: none;
    padding: 2px 4px;
    transition: var(--transition-medium);
}

.card-title {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-meta {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #86868b; /* Apple Gray secondary */
}

.card-meta .card-rating {
    color: #ffb83b;
    font-weight: 600;
}

/* Loading spinner */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    gap: 16px;
    color: var(--text-muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- SECTION: BROWSE GRID (FILTERS & RESULTS) --- */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

#section-browse {
    padding: 130px 4% 100px 4%;
}

.browse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 14px;
}

.browse-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.browse-filters select {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-medium);
}

.browse-filters select:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

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

.no-results {
    text-align: center;
    padding: 100px 0;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.no-results p {
    color: var(--text-muted);
}
/* --- DETAILS MODAL --- */
.details-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

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

.details-content {
    width: 90%;
    max-width: 860px;
    background: rgba(22, 22, 28, 0.5);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    position: relative;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(35px) saturate(190%);
    -webkit-backdrop-filter: blur(35px) saturate(190%);
    transform: scale(0.94) translateY(10px);
    transition: var(--transition-smooth);
}

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

.details-close-btn {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.1rem;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition-fast);
}

.details-close-btn:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.25);
}

.details-banner {
    height: 360px;
    background-size: cover;
    background-position: center 20%;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.details-banner-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(22, 22, 28, 0.95) 0%, rgba(22, 22, 28, 0.4) 50%, transparent 100%);
}

.details-banner-info {
    position: relative;
    padding: 30px;
    z-index: 2;
    max-width: 80%;
}

.modal-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.modal-title {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 18px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.details-body {
    padding: 30px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    background-color: transparent;
}

.details-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.details-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.95rem;
    font-weight: 600;
}

.modal-rating { color: #ffb83b; }
.modal-quality {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
}

.modal-overview {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.55;
    font-size: 0.95rem;
}

.details-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.meta-item {
    font-size: 0.9rem;
}

.meta-label {
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.meta-value {
    color: var(--text-main);
    font-weight: 600;
}

.meta-value.highlight {
    color: #7c7aff; /* Apple Indigo light glow */
}

.btn-clear-resume {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 10px;
}
.btn-clear-resume:hover { color: #ffffff; }

/* --- CUSTOM VIDEO PLAYER MODAL --- */
.player-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #000;
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.custom-player {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#main-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    outline: none;
}

/* Custom Controller Overlay */
.player-controls {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(7, 7, 9, 0.6) 0%, transparent 18%, transparent 80%, rgba(7, 7, 9, 0.75) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
    opacity: 0; /* Mặc định ẩn, sẽ hiện qua JS class */
    transition: opacity 0.35s ease;
}

.custom-player.controls-visible .player-controls {
    opacity: 1;
}

/* Player Header */
.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 6%;
}

.player-back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    font-weight: 555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.85;
    transition: var(--transition-fast);
}

.player-back-btn:hover {
    opacity: 1;
    transform: translateX(-4px);
}

.player-title {
    font-size: 1.15rem;
    font-weight: 600;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.95);
}

.player-status-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Center Play/Pause button overlay */
.player-center-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 36px;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

.center-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.15rem;
    width: 55px; height: 55px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-medium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.center-btn:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.center-btn.play-pause-main {
    width: 76px; height: 76px;
    font-size: 1.8rem;
    padding-left: 4px;
}

/* Player Toast notification message */
.player-toast {
    position: absolute;
    background: rgba(20, 20, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    z-index: 12;
    pointer-events: none;
    animation: toastPop 0.8s ease forwards;
}

@keyframes toastPop {
    0% { opacity: 0; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
    70% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.9); }
}

/* Player Bottom controls */
.player-bottom-bar {
    padding: 0 6% 30px 6%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Progress Slider Custom */
.progress-container {
    position: relative;
    width: 100%;
    height: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.progress-bar-bg {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    position: relative;
    transition: height 0.15s;
}

.progress-container:hover .progress-bar-bg {
    height: 5px;
}

.progress-buffered {
    position: absolute;
    top: 0; left: 0; height: 100%;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 2px;
}

.progress-current {
    position: absolute;
    top: 0; left: 0; height: 100%;
    background: #ffffff; /* Apple TV White bar */
    border-radius: 2px;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 12px; height: 12px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.15s;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

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

/* Time seeking preview */
.seek-preview-time {
    position: absolute;
    bottom: 15px;
    transform: translateX(-50%);
    background: rgba(20, 20, 26, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    pointer-events: none;
}

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

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

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.35rem;
    cursor: pointer;
    width: 38px; height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
    opacity: 0.85;
}

.control-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.control-btn.small-btn {
    font-size: 1.1rem;
}

.control-btn.text-btn {
    font-size: 0.9rem;
    font-weight: 600;
    width: auto;
    padding: 0 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.control-btn.text-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Volume Slider */
.volume-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.volume-slider-container {
    width: 0;
    overflow: hidden;
    transition: width 0.25s ease;
    display: flex;
    align-items: center;
}

.volume-control:hover .volume-slider-container,
.volume-slider-container:focus-within {
    width: 75px;
}

#volume-slider {
    width: 65px;
    height: 3px;
    outline: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.18);
    -webkit-appearance: none;
    border-radius: 2px;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #ffffff;
}

.time-display {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.time-display #time-current {
    color: white;
    font-weight: 600;
}

.time-separator {
    margin: 0 4px;
    opacity: 0.6;
}

/* Speed Selector Menu */
.speed-selector {
    position: relative;
}

.speed-dropdown-menu {
    position: absolute;
    bottom: 50px;
    right: 0;
    background: rgba(25, 25, 30, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--hover-shadow);
    display: flex;
    flex-direction: column;
    min-width: 100px;
    z-index: 15;
}

.speed-dropdown-menu button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.speed-dropdown-menu button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.speed-dropdown-menu button.active {
    color: white;
    background: rgba(255, 255, 255, 0.16);
    font-weight: 700;
}

/* --- FOOTER --- */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 12, 16, 0.35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 50px 4% 40px 4%;
    margin-top: 50px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.footer-logo {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-dot {
    color: var(--text-dark);
}

.footer-copyright {
    color: var(--text-dark);
    font-size: 0.78rem;
    margin-top: 8px;
    opacity: 0.8;
}

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 1024px) {
    .movie-card {
        flex: 0 0 calc(100% / 4 - 12px); /* 4 cards per row */
    }
}

@media (max-width: 768px) {
    /* Hide top nav items and adjust logo */
    header {
        left: 0 !important;
        width: 100% !important;
        margin-top: 0 !important;
        top: 38px !important;
        justify-content: center;
        background: rgba(22, 22, 23, 0.72) !important;
        backdrop-filter: blur(20px) saturate(190%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 0 !important;
        padding: 0 16px;
        height: 48px !important;
    }

    header.scrolled {
        padding: 0 16px;
    }

    .brand {
        font-size: 1.2rem;
    }

    .nav-links, .header-right {
        display: none; /* Trốn trên mobile, chuyển sang Bottom bar */
    }

    /* Show Mobile Nav */
    .mobile-nav-bar {
        display: flex;
        position: fixed;
        bottom: 16px; left: 6%;
        width: 88%;
        background: rgba(20, 20, 25, 0.6);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.12);
        padding: 6px 0;
        justify-content: space-around;
        z-index: 1000;
        border-radius: 20px;
        box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
    }

    .mobile-tab-btn {
        background: none;
        border: none;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        cursor: pointer;
        padding: 6px 0;
        margin: 0 4px;
        border-radius: 14px;
        transition: var(--transition-medium);
    }

    .mobile-tab-btn.active {
        color: #000000 !important;
        background-color: #ffffff !important;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    }

    .tab-icon {
        font-size: 1.15rem;
    }

    .tab-label {
        font-size: 0.7rem;
        font-weight: 600;
    }

    /* Adjust Hero */
    .hero {
        height: 60vh;
    }

    .hero-content {
        padding: 0 16px;
        bottom: -20px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-overview {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
        margin-bottom: 20px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    /* Adjust Rows */
    .rows-container {
        padding: 0 16px 140px 16px; /* Cách đáy để không bị Bottom bar đè */
        top: -30px;
    }

    .row-title {
        font-size: 1.25rem;
        margin-bottom: 10px;
    }

    .movie-card {
        flex: 0 0 130px; /* Thẻ nhỏ hơn, vuốt mượt */
    }

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

    .slider-arrow {
        display: none !important; /* Ẩn nút mũi tên trên di động */
    }

    /* Browse Section */
    #section-browse {
        padding: 110px 16px 140px 16px;
    }

    .browse-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .browse-title {
        font-size: 1.6rem;
    }

    .browse-filters {
        width: 100%;
    }

    .browse-filters select {
        width: 100%;
    }

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

    /* Details Modal */
    .details-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .details-banner {
        height: 240px;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .details-body {
        grid-template-columns: 1fr; /* 1 cột trên điện thoại */
        padding: 20px;
        gap: 20px;
    }

    /* Player adjustments for mobile */
    .player-header {
        padding: 15px 4%;
    }

    .back-text {
        display: none; /* Chỉ hiện mũi tên quay lại */
    }

    .player-center-controls {
        gap: 25px;
    }

    .center-btn {
        width: 50px; height: 50px;
        font-size: 1rem;
    }

    .center-btn.play-pause-main {
        width: 70px; height: 70px;
        font-size: 1.6rem;
    }

    .controls-row {
        flex-wrap: wrap;
        gap: 15px;
    }

    .time-display {
        font-size: 0.85rem;
    }

    .volume-slider-container {
        display: none !important; /* Ẩn slider âm lượng trên mobile */
    }
}

/* --- SUBTITLE CUE & CC BUTTON STYLING --- */
video::cue {
    background: rgba(0, 0, 0, 0.75) !important;
    color: #ffffff !important;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 24px !important; /* Tăng cỡ mặc định từ 20px lên 24px */
    font-weight: 600 !important; /* Làm chữ dày và đậm nét hơn */
    line-height: 1.35 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9) !important;
}

/* Đẩy khung phụ đề lên cao hơn để tránh sát đáy và không bị đè bởi thanh điều khiển */
video::-webkit-media-text-track-container {
    transform: translateY(-45px) !important;
}
video::-webkit-media-text-track-display {
    transform: translateY(-45px) !important;
}

/* Cỡ chữ phụ đề khi xem trên màn hình lớn hoặc toàn màn hình */
@media (min-width: 1200px) {
    video::cue {
        font-size: 32px !important; /* Tăng từ 26px lên 32px */
    }
    video::-webkit-media-text-track-container {
        transform: translateY(-60px) !important; /* Đẩy cao hơn nữa trên màn hình lớn/toàn màn hình */
    }
    video::-webkit-media-text-track-display {
        transform: translateY(-60px) !important;
    }
}

@media (max-width: 768px) {
    video::cue {
        font-size: 17px !important; /* Tăng từ 15px lên 17px */
    }
    video::-webkit-media-text-track-container {
        transform: translateY(-20px) !important;
    }
    video::-webkit-media-text-track-display {
        transform: translateY(-20px) !important;
    }
}

.control-btn#btn-cc.active {
    color: var(--primary) !important;
}

/* --- HỖ TRỢ TRÌNH PHÁT MẶC ĐỊNH TRÊN DI ĐỘNG (MOBILE NATIVE PLAYER) --- */
.custom-player.use-native-player .player-controls {
    pointer-events: none !important; /* Cho phép chạm xuyên qua lớp phủ xuống thẻ video di động để gọi bộ điều khiển mặc định */
}

.custom-player.use-native-player .player-bottom-bar,
.custom-player.use-native-player .player-center-controls,
.custom-player.use-native-player .player-toast {
    display: none !important;
}

/* Tối ưu hóa phần header chứa nút Quay lại trên điện thoại */
.custom-player.use-native-player .player-header {
    background: linear-gradient(to bottom, rgba(10, 10, 12, 0.95) 0%, transparent 100%) !important;
    z-index: 999999 !important;
    pointer-events: none; /* Cho phép chạm xuyên qua header xuống video */
}

/* Cho phép nút quay lại nhận sự kiện chạm */
.custom-player.use-native-player .player-back-btn {
    pointer-events: auto !important;
}

/* --- EPISODES LIST & SEASON TABS IN MODAL --- */
.episodes-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.episodes-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.season-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.season-tabs::-webkit-scrollbar {
    display: none;
}

.season-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.season-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.season-tab-btn.active {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.25);
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom scrollbar for episodes grid if they overflow */
.episodes-grid::-webkit-scrollbar {
    width: 6px;
}
.episodes-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.episodes-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.episodes-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.episode-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 6px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-fast);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 44px;
}

.episode-btn:hover {
    background: var(--bg-surface-hover);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.episode-btn.active {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
}

.ep-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #ffffff;
    border-radius: 0 0 0 6px;
    transition: width 0.3s ease;
}

