@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-color: #141414; 
    --primary-color: #e50914; 
    --text-color: #ffffff;
}

body { background-color: var(--bg-color); color: var(--text-color); font-family: 'Montserrat', sans-serif; overflow-x: hidden; }

/* Avatar & Lịch sử */
.avatar-user { width: 35px; height: 35px; background: url('https://upload.wikimedia.org/wikipedia/commons/0/0b/Netflix-avatar.png') center/cover; border-radius: 4px; cursor: pointer; transition: 0.2s; }
.avatar-user:hover { border: 2px solid white; }
.history-menu::-webkit-scrollbar { width: 6px; }
.history-menu::-webkit-scrollbar-thumb { background: #e50914; border-radius: 3px; }
.history-item-hover:hover { background-color: rgba(255,255,255,0.1); }

/* Grid & Card */
.main-content { margin-top: -150px; position: relative; z-index: 20; }
.section-title { font-weight: 700; color: #e5e5e5; margin-bottom: 15px; }

.movie-card { position: relative; border-radius: 4px; overflow: hidden; cursor: pointer; background-color: #222; aspect-ratio: 16 / 9; transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease; }
.movie-card:hover { transform: scale(1.15) translateY(-5px); z-index: 99; box-shadow: 0 10px 20px rgba(0,0,0,0.9); border-radius: 6px; }
.movie-card img { width: 100%; height: 100%; object-fit: cover; }
.ep-badge { position: absolute; top: 8px; right: 8px; background-color: var(--primary-color); color: white; padding: 3px 8px; font-size: 11px; font-weight: 800; border-radius: 3px; z-index: 2; }

.card-gradient { 
    position: absolute; inset: 0; 
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 60%); 
    opacity: 1; 
    display: flex; align-items: flex-end; padding: 15px; transition: 0.4s ease; 
}
.movie-card:hover .card-gradient { 
    background: linear-gradient(to top, rgba(229,9,20,0.8) 0%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0) 80%); 
}
.card-title { font-size: 14px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; overflow-x: auto; scroll-behavior: smooth; padding-bottom: 20px; }
.movie-wrapper { width: 280px; flex: 0 0 auto; padding-right: 10px; transition: 0.3s; }
.movie-wrapper:hover { padding-right: 15px; padding-left: 5px; }

/* Thẻ Xem Tất Cả ở cuối thanh trượt */
.see-more-card {
    background-color: #222;
    border-radius: 4px;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.4s ease;
}
.see-more-card:hover {
    transform: scale(1.15) translateY(-5px);
    z-index: 99;
    background-color: #333;
    box-shadow: 0 10px 20px rgba(0,0,0,0.9);
    border-radius: 6px;
}
.see-more-card i { transition: 0.3s; }
.see-more-card:hover i { transform: translateX(5px); }

/* Trình phát Video (Cinema Style) */
.cinema-player-wrapper {
    background-color: #000;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}
.player-header { background: linear-gradient(to right, #1a1a1a, #000); border-bottom: 1px solid #333; }
.cinema-player-wrapper iframe { border-radius: 0 0 8px 8px; }

/* Utilities */
.dropdown-menu-dark { background-color: rgba(0,0,0,0.95); border: 1px solid #333; backdrop-filter: blur(10px); }
.dropdown-item { font-size: 14px; transition: 0.2s; color: #fff; }
.dropdown-item:hover { background-color: rgba(255,255,255,0.1); color: white; }
#search-input:focus { box-shadow: none; border-color: var(--primary-color); }
.d-none { display: none !important; }

/* =========================================
   FIX CHO PC: Cố định Menu to ra, không bị ép chữ
   ========================================= */
@media (min-width: 992px) {
    .dropdown-the-loai { min-width: 450px !important; }
    .dropdown-quoc-gia { min-width: 300px !important; }
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 991px) {
    .movie-wrapper { width: 220px; }
    
    #navbarNav {
        background-color: rgba(0, 0, 0, 0.95);
        padding: 15px;
        border-radius: 10px;
        margin-top: 15px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    }
    #navbarNav .navbar-nav {
        align-items: flex-start !important;
    }
    #navbarNav .d-flex.align-items-center.gap-3 {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #333;
        width: 100%;
        justify-content: space-between;
    }
}
@media (max-width: 768px) {
    .main-content { margin-top: -60px; }
    .section-title { font-size: 1.2rem; }
    .movie-wrapper { width: 160px; }
    .movie-card:hover { transform: scale(1.05) translateY(-2px); }
    .see-more-card:hover { transform: scale(1.05) translateY(-2px); }
    
    .card-gradient { background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 80%); padding: 10px;}
    .card-title { font-size: 12px; }
    .ep-badge { font-size: 9px; padding: 2px 5px; top: 5px; right: 5px; }
    .cinema-player-wrapper { height: 300px !important; }

    .dropdown-menu-dark { min-width: 100% !important; }
    .dropdown-menu-dark .row .col-4, .dropdown-menu-dark .row .col-6 { width: 50%; margin-bottom: 10px; }
    
    .search-mobile { width: 150px !important; }
    
    .hero-content { width: 90%; left: 5%; top: 50%; transform: translateY(-50%); }
    .hero-title { font-size: 1.8rem; }
    
    .d-flex.gap-3.mb-4 { flex-direction: column; align-items: center; text-align: center; }
    #detail-poster { width: 160px !important; height: 240px !important; }
}
@media (max-width: 480px) {
    .movie-wrapper { width: 140px; }
    .cinema-player-wrapper { height: 240px !important; }
}

/* =========================================
   LOGO PHIMHAY MỚI (INTRO 4.5S + LOOP)
   ========================================= */
.logo-camera-focus {
    font-family: 'Montserrat', sans-serif;
    font-size: 30px; 
    font-weight: 200;
    color: #ffffff !important;
    letter-spacing: 8px; 
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    animation: 
        intro-camera 4.5s cubic-bezier(0.2, 0.8, 0.2, 1) 1 forwards,
        loop-text 4s ease-in-out 4.5s infinite; 
    transform: translateZ(0); 
}

.icon-play {
    font-size: 20px;
    color: #E50914;
    margin-right: -5px; 
    transform: scaleY(1.1); 
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
    animation: loop-icon 4s ease-in-out 4.5s infinite;
}

.logo-camera-focus strong {
    font-weight: 900;
    position: relative;
    display: inline-block;
    z-index: 10;
}

.logo-camera-focus strong::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 350px; height: 2px;  
    background: radial-gradient(ellipse at center, rgba(255, 245, 210, 0.9) 0%, rgba(255, 230, 150, 0.5) 40%, transparent 80%);
    box-shadow: 0 0 10px rgba(255, 230, 150, 0.4);
    transform: translate(-50%, -50%) scaleX(0);
    opacity: 0;
    animation: intro-flare-streak 4.5s cubic-bezier(0.4, 0, 0.2, 1) 1 forwards;
    pointer-events: none; 
}

.logo-camera-focus strong::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 120px; height: 60px; 
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 230, 150, 0.3) 30%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    animation: intro-flare-core 4.5s cubic-bezier(0.4, 0, 0.2, 1) 1 forwards;
    pointer-events: none;
}

@keyframes intro-camera {
    0% { filter: blur(12px); opacity: 0; letter-spacing: 20px; }
    50% { filter: blur(0px); opacity: 1; letter-spacing: 8px; }
    100% { filter: blur(0px); opacity: 1; letter-spacing: 8px; }
}
@keyframes intro-flare-streak {
    0% { transform: translate(-50%, -50%) scaleX(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scaleX(1); opacity: 0.8; } 
    100% { transform: translate(-50%, -50%) scaleX(0.2); opacity: 0; } 
}
@keyframes intro-flare-core {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.9; } 
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; } 
}
@keyframes loop-text {
    0%, 100% { text-shadow: 0 0 0px transparent; }
    50% { text-shadow: 0 0 15px rgba(255, 255, 255, 0.3), 0 0 25px rgba(255, 255, 255, 0.1); }
}
@keyframes loop-icon {
    0%, 100% { text-shadow: 0 0 10px rgba(229, 9, 20, 0.5); transform: scaleY(1.1) scaleX(1); }
    50% { text-shadow: 0 0 20px rgba(229, 9, 20, 0.9), 0 0 35px rgba(229, 9, 20, 0.5); transform: scaleY(1.12) scaleX(1.05); }
}

/* =========================================
   BANNER TRƯỢT NETFLIX STYLE 
   ========================================= */
.hero-container {
    position: relative;
    width: 100%;
    height: 85vh; 
    background-color: #141414;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center top;
}

.hero-slide.active { opacity: 1; z-index: 1; }

.hero-overlay-netflix {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        linear-gradient(to right, rgba(20, 20, 20, 1) 0%, rgba(20, 20, 20, 0.5) 45%, transparent 100%),
        linear-gradient(to top, #141414 0%, transparent 20%);
}

.hero-content {
    position: absolute;
    top: 55%;
    left: 4%; 
    transform: translateY(-50%);
    width: 45%; 
    color: #fff;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.2;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.6);
}

.hero-meta {
    font-size: 1rem;
    color: #a3a3a3;
    margin-bottom: 15px;
    font-weight: 600;
}

.hero-desc {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 30px;
    color: #e5e5e5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.hero-buttons { display: flex; gap: 15px; }

.hero-btn {
    padding: 10px 24px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.btn-play { background: #fff; color: #000; }
.btn-play:hover { background: rgba(255,255,255,0.7); }

.btn-info { background: rgba(109, 109, 110, 0.7); color: #fff; }
.btn-info:hover { background: rgba(109, 109, 110, 0.4); }

@media (max-width: 768px) {
    .hero-container { height: 60vh; }
    .hero-content { width: 90%; left: 5%; top: 60%; }
    .hero-title { font-size: 2rem; }
    .hero-desc { font-size: 0.9rem; -webkit-line-clamp: 2; }
    .hero-btn { font-size: 1rem; padding: 8px 16px; }
}