* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 20%),
                linear-gradient(180deg, #050505 0%, #070707 55%, #0d0d0d 100%);
    color: #f1f1f1;
    min-height: 100vh;
    padding: 16px;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

header.header {
    display: grid;
    gap: 18px;
    padding: 22px 24px;
    border-radius: 24px;
    background: rgba(6, 6, 6, 0.95);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 60px rgba(0,0,0,0.35);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.brand-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.brand-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-title i {
    font-size: 2.2rem;
    color: #e50914;
}

.brand-title h1 {
    font-size: 2rem;
    margin-bottom: 4px;
    letter-spacing: -0.04em;
}

.brand-title p {
    color: #c1c7d0;
    font-size: 0.95rem;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.nav-btn,
.primary-btn,
.secondary-btn,
.tab-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.nav-btn,
.secondary-btn,
.tab-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #f6f6f6;
}

.nav-btn.active,
.primary-btn,
.tab-btn.active {
    background: #e50914;
    color: #ffffff;
}

.primary-btn {
    background: #e50914;
    color: #ffffff;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #eef2ff;
}

.nav-btn:hover,
.primary-btn:hover,
.secondary-btn:hover,
.tab-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.user-box span {
    color: #ffffffcc;
}

.user-box button {
    padding: 8px 16px;
}

main {
    display: grid;
    gap: 24px;
}

.view-section {
    display: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.view-section.active {
    display: block;
}

.welcome-card,
.auth-card,
.player-card {
    background: rgba(16, 22, 40, 0.82);
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.welcome-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

.welcome-card h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.welcome-card p {
    color: #c2c8d7;
    max-width: 600px;
}

.welcome-action {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.overview-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 18px;
    text-align: center;
}

.overview-number {
    font-size: 2rem;
    font-weight: 700;
    color: #ffb347;
}

.overview-label {
    margin-top: 8px;
    color: #bfc7d7;
}

.section-header {
    margin-top: 28px;
}

.section-header h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.section-header p {
    color: #a3abbf;
}

.home-hero {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(340px, 1.8fr) minmax(320px, 1fr);
    gap: 24px;
    border-radius: 30px;
    overflow: hidden;
    min-height: 520px;
    background: #060606;
    border: 1px solid rgba(255, 255, 255, 0.08);
    align-items: stretch;
    box-shadow: 0 40px 100px rgba(0,0,0,0.65);
}

.hero-image {
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    min-height: 520px;
    position: relative;
}

.hero-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.12), rgba(10, 10, 10, 0.95));
}

.hero-copy {
    position: relative;
    padding: 48px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    background: linear-gradient(180deg, rgba(0,0,0,0.16), rgba(0,0,0,0.96));
}

.hero-copy::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.22);
    pointer-events: none;
}

.hero-copy > * {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(3rem, 4vw, 4.2rem);
    letter-spacing: -0.05em;
    line-height: 1.02;
}

.hero-text {
    color: #d9d9d9;
    max-width: 700px;
    font-size: 1.05rem;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.2);
    color: #ffffff;
    font-weight: 700;
}

.recommendation-section {
    margin-top: 32px;
}

.recommendation-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 20px;
}

.recommendation-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    display: grid;
    grid-template-rows: 180px auto;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.recommendation-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
    border-color: rgba(255, 255, 255, 0.18);
}

.recommendation-image {
    background-size: cover;
    background-position: center;
}

.recommendation-info {
    padding: 20px;
    display: grid;
    gap: 10px;
}

.recommendation-info strong {
    font-size: 1.1rem;
    color: #ffffff;
}

.recommendation-info p {
    color: #cfd5e3;
    font-size: 0.96rem;
    line-height: 1.6;
}

.seasons-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.season-card {
    padding: 26px;
    border-radius: 24px;
    background: rgba(12, 12, 12, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 18px;
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.season-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.season-card h4 {
    margin-bottom: 6px;
}

.season-card p {
    color: #9aa9bf;
    line-height: 1.5;
}

.season-card button {
    width: fit-content;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.episode-card {
    position: relative;
    min-height: 160px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
    display: grid;
    align-items: flex-end;
}

.episode-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.18);
}

.episode-card.active {
    box-shadow: 0 30px 90px rgba(229, 9, 20, 0.24);
    border-color: #e50914;
}

.episode-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.78));
    opacity: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 16px;
    transition: opacity 0.2s ease;
}

.episode-card:hover .episode-card-overlay {
    opacity: 1;
}

.episode-card-overlay span {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.video-meta .movie-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-meta .movie-title i {
    color: #ffb347;
}

.player-status {
    color: #c2c8d7;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    align-self: center;
}

.video-wrapper {
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    position: relative;
}

.subtitle-overlay {
    position: absolute;
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%);
    max-width: 85%;
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

.subtitle-overlay .subtitle-line {
    display: inline-block;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: clamp(14px, 2.1vw, 22px);
    font-weight: 500;
    line-height: 1.4;
    padding: 0.25em 0.6em;
    border-radius: 6px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    white-space: pre-line;
}

.video-placeholder {
    height: 100%;
    width: 100%;
    display: grid;
    place-items: center;
    color: #9aa9bf;
    text-align: center;
    padding: 24px;
}

.video-placeholder i {
    font-size: 2rem;
    margin-bottom: 12px;
    color: #ffb347;
}

.auth-card {
    max-width: 560px;
    margin: 0 auto;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.tab-btn {
    flex: 1;
}

.auth-body {
    display: grid;
    gap: 18px;
}

.auth-form {
    display: none;
    gap: 14px;
}

.auth-form.active {
    display: grid;
}

.auth-form label {
    color: #d4d9e8;
    font-size: 0.9rem;
}

.auth-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #eef2ff;
}

.auth-form input::placeholder {
    color: #9aa9bf;
}

.auth-message {
    color: #ffd966;
    min-height: 22px;
}

.hidden {
    display: none !important;
}

.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 22, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    display: grid;
    gap: 12px;
    align-items: center;
    justify-items: center;
    padding: 24px 30px;
    border-radius: 24px;
    background: rgba(14, 20, 38, 0.95);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.loading-content .spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(255, 255, 255, 0.12);
    border-top-color: #ffb347;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-placeholder {
    padding: 30px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #c2c8d7;
    text-align: center;
}

@media (min-width: 768px) {
    .brand-box {
        grid-template-columns: 1fr auto auto;
        align-items: center;
    }
    .welcome-card {
        padding: 32px;
    }
    .auth-card,
    .player-card {
        padding: 32px;
    }
}

@media (max-width: 900px) {
    .overview-cards {
        grid-template-columns: 1fr;
    }
    .season-card,
    .episodes-grid {
        grid-template-columns: 1fr;
    }
    .nav-links {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-btn,
    .primary-btn,
    .secondary-btn,
    .tab-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 680px) {
    .welcome-card {
        flex-direction: column;
        align-items: stretch;
    }
    .overview-cards {
        gap: 12px;
    }
    .video-meta {
        flex-direction: column;
        align-items: stretch;
    }
    .user-box {
        justify-content: flex-start;
    }
    .player-status {
        width: 100%;
        text-align: left;
    }
    .video-wrapper {
        aspect-ratio: auto;
        height: 240px;
    }
    .episodes-grid {
        grid-template-columns: 1fr;
    }
    .episode-btn {
        justify-content: flex-start;
        width: 100%;
    }
    .auth-card,
    .player-card,
    .welcome-card {
        padding: 20px;
    }
    main {
        gap: 18px;
    }
}

.movie-card {
    background: rgba(18, 25, 45, 0.75);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.movie-poster {
    height: 200px;
    background: linear-gradient(135deg, #1e2a44, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
}

.film-viewer {
    display: grid;
    gap: 18px;
}

.film-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 420px;
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background-size: cover;
    background-position: center;
}

.film-video iframe {
    width: 100%;
    height: 100%;
}

.film-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.85));
    color: #fff;
    display: grid;
    place-items: end start;
    padding: 32px;
    pointer-events: none;
}

.film-info-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
    margin: 24px 0 0;
}

.film-poster {
    width: 100%;
    min-height: 320px;
    border-radius: 24px;
    background: #111;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.film-details {
    display: grid;
    gap: 14px;
}

.film-header {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.film-header h2 {
    margin: 0;
    font-size: clamp(2.5rem, 4vw, 4.2rem);
    line-height: 1.05;
}

.film-header p {
    max-width: 760px;
    color: #cbd5f0;
    line-height: 1.8;
    font-size: 1rem;
}

.film-info-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
    margin: 24px 0 0;
}

.film-poster {
    width: 100%;
    min-height: 320px;
    border-radius: 24px;
    background: #111;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.film-details {
    display: grid;
    gap: 12px;
}

.film-subtitle,
.film-detail-text {
    color: #c2c8d7;
    line-height: 1.8;
}

.film-episode-title {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.film-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.18);
    color: #fff;
    font-weight: 700;
}

.film-detail-text p {
    color: #d4d9e8;
    line-height: 1.7;
    max-width: 760px;
}

.film-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.2);
    color: #fff;
    font-weight: 700;
}

.film-related-header {
    margin-top: 20px;
}


.movie-poster i {
    font-size: 64px;
    color: #FFB347;
    opacity: 0.8;
}

.movie-info {
    padding: 16px;
}

.movie-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #FFD966;
}

.movie-info p {
    font-size: 0.85rem;
    color: #9aa9bf;
    line-height: 1.4;
    margin-bottom: 12px;
}

.movie-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: #8e9baf;
}

.movie-meta i {
    margin-right: 4px;
}

.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    padding: 8px 16px;
    background: #1e2a44;
    border-radius: 40px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #FFB347;
    color: #0a0e1a;
}

.netflix-video-container {
    position: relative;
    width: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
}

video::cue {
    background: transparent !important; 
    color: #ffffff !important; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.3;
    text-shadow: 
        2px 2px 2px #000, 
       -2px -2px 2px #000, 
        2px -2px 2px #000, 
       -2px 2px 2px #000,
        0px 2px 4px rgba(0, 0, 0, 0.9);
}

.netflix-controls-overlay {
    position: absolute;
    bottom: 25px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 20;
}

.netflix-icon-btn {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.netflix-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    border-color: #fff;
}

.netflix-sub-menu-wrapper {
    position: relative;
}

.netflix-popup-menu {
    position: absolute;
    bottom: 55px;
    right: 0;
    width: 180px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    transition: opacity 0.2s ease;
}

.netflix-popup-menu.hidden {
    display: none;
}

.netflix-popup-menu .menu-title {
    color: #808080;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sub-option {
    color: #b3b3b3;
    padding: 8px 10px;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sub-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Item phụ đề đang được chọn */
.sub-option.active {
    color: #fff;
    font-weight: 600;
}

.sub-option.active::after {
    content: '✓';
    color: #e50914; /* Dấu tick đỏ đặc trưng Netflix */
    font-weight: bold;
}