/* ==========================================================================
   1. GLOBAL VARIABLES & RESET
   ========================================================================== */
:root {
    --color-bg: #0f0f0f;           /* ខ្មៅជ្រៅជាងមុន */
    --color-bg-card: #181818;      /* ពណ៌កាត */
    --color-primary: #e50914;      /* ក្រហម Netflix */
    --color-secondary: #00d4f5;    /* ខៀវ Cyan */
    --color-text-main: #ffffff;
    --color-text-muted: #b3b3b3;
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 20px rgba(229, 9, 20, 0.3);
    --glass-bg: rgba(20, 20, 20, 0.85);
}

* { box-sizing: border-box; }

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    color: var(--color-text-main);
    text-decoration: none;
    transition: all 0.3s ease;
}
a:hover { color: var(--color-secondary); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

::selection { background: var(--color-primary); color: #fff; }

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    background-color: var(--glass-bg) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-link {
    font-weight: 500;
    margin-right: 20px;
    font-size: 0.95rem;
    opacity: 0.8;
}
.nav-link:hover {
    opacity: 1;
    color: var(--color-secondary) !important;
    text-shadow: 0 0 10px rgba(0, 212, 245, 0.4);
}

/* --- Search Box --- */
.search-box-wrapper { position: relative; }
.search-input {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 50px !important;
    padding-left: 20px !important;
    padding-right: 45px !important;
    width: 220px !important;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.search-input:focus {
    width: 300px !important;
    background-color: #000 !important;
    border-color: var(--color-secondary) !important;
    box-shadow: 0 0 15px rgba(0, 212, 245, 0.25) !important;
}
.search-input::placeholder { color: #6c757d; font-size: 0.9rem; }
.search-icon {
    position: absolute; right: 15px; top: 50%;
    transform: translateY(-50%); color: #888;
    pointer-events: none; z-index: 5;
}

/* Search Results Dropdown */
#search-results {
    background-color: #1a1a1a;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
}
#search-results .list-group-item {
    background-color: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: #ddd;
    transition: background 0.2s;
}
#search-results .list-group-item:hover {
    background-color: var(--color-primary) !important;
    color: #fff;
}

/* ==========================================================================
   3. MOBILE MENU FIX (សំខាន់ខ្លាំង)
   ========================================================================== */
@media (max-width: 991px) {
    /* 1. លាក់ Menu ជាមុនសិន */
    #main-header-content {
        position: fixed; /* ឬ absolute */
        top: 70px; /* កម្ពស់ Header */
        left: 0;
        width: 100%;
        height: auto;
        background-color: rgba(15, 15, 15, 0.98);
        backdrop-filter: blur(15px);
        border-bottom: 1px solid var(--border-light);
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        
        /* Animation Setup */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s ease;
        z-index: 999;
    }

    /* 2. បង្ហាញ Menu ពេលមាន Class 'active' (Add ដោយ JS) */
    #main-header-content.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        display: flex !important; /* បង្ខំអោយចេញ */
    }

    /* តម្រឹម Link ក្នុង Menu អោយស្អាត */
    #main-header-content .navbar-nav {
        width: 100%;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    #main-header-content .search-box-wrapper {
        width: 100%;
    }
    #main-header-content .search-input {
        width: 100% !important; /* Search ពេញអេក្រង់លើទូរស័ព្ទ */
    }
}

/* ==========================================================================
   4. PREMIUM HERO SLIDER (Main + Sync Thumb)
   ========================================================================== */
.premium-hero-wrap {
    width: 100%;
    position: relative;
    background-color: #000;
    overflow: hidden;
    aspect-ratio: 21 / 9;
    min-height: 600px;
}

.main-hero-swiper { width: 100%; height: 100%; z-index: 1; }
.main-hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center top;
    transition: transform 0.5s ease-out;
}
.main-hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, 
        rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 35%, rgba(0,0,0,0.1) 100%),
        linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 50%);
    z-index: 2;
}

.hero-content-wrapper { position: relative; z-index: 3; padding-left: 40px; }

.hero-tag span {
    color: #e50914; letter-spacing: 2px;
    font-size: 0.9rem; text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-title-premium {
    font-size: 4rem; font-weight: 900; color: #fff; line-height: 1.1;
    margin-bottom: 20px; text-transform: capitalize;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}
.hero-desc-premium {
    font-size: 1.15rem; color: rgba(255, 255, 255, 0.85);
    max-width: 600px; line-height: 1.7; margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.hero-meta-premium { font-size: 1rem; font-weight: 600; color: #fff; }
.badge-outline {
    border: 1px solid rgba(255,255,255,0.4);
    padding: 2px 8px; border-radius: 4px; font-size: 0.85rem;
}

.fade-up {
    opacity: 0; transform: translateY(30px); transition: all 0.6s ease-out;
}
.swiper-slide-active .fade-up {
    opacity: 1; transform: translateY(0);
}

.btn-premium-watch {
    background-color: #e50914; color: #fff !important;
    padding: 12px 35px; border-radius: 4px; font-weight: bold;
    font-size: 1.1rem; border: none; transition: all 0.3s ease;
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-premium-watch:hover {
    background-color: #b20710; transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(229, 9, 20, 0.4);
}

.btn-premium-list {
    background-color: rgba(255,255,255,0.1); color: #fff !important;
    padding: 12px 30px; border-radius: 4px; font-weight: bold;
    font-size: 1.1rem; border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(5px); transition: all 0.3s ease;
}
.btn-premium-list:hover {
    background-color: #fff; color: #000 !important; border-color: #fff;
    transform: translateY(-3px);
}

/* --- Single Thumbnail (3:4 Poster) --- */
.thumb-layer-wrapper {
    position: absolute; bottom: 50px; right: 50px;
    width: 180px; z-index: 10;
}
.thumb-hero-swiper {
    width: 100%; padding-bottom: 0;
    border-radius: 8px 8px 0 0; overflow: hidden;
    background: #000; box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}
.thumb-hero-slide {
    width: 100%; opacity: 0; transition: opacity 0.4s ease;
}
.thumb-hero-slide.swiper-slide-thumb-active { opacity: 1; }
.thumb-img-wrap {
    width: 100%; aspect-ratio: 3 / 4;
    position: relative; overflow: hidden;
}
.thumb-img-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

.thumb-controls {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(20, 20, 20, 0.9); backdrop-filter: blur(10px);
    padding: 10px 15px; border-radius: 0 0 8px 8px;
    border-top: 1px solid rgba(255,255,255,0.15);
}
.swiper-pagination-fraction {
    position: static; width: auto; font-size: 0.9rem;
    font-weight: bold; color: #fff; letter-spacing: 1px;
}
.nav-arrows { display: flex; gap: 10px; }
.premium-prev, .premium-next {
    width: 32px; height: 32px; border-radius: 5px;
    background: rgba(255,255,255,0.15); color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s; font-size: 16px;
}
.premium-prev:hover, .premium-next:hover {
    background-color: #e50914; transform: scale(1.1);
}

/* --- Hero Responsive --- */
@media (max-width: 991px) {
    .premium-hero-wrap { aspect-ratio: 16 / 9; min-height: auto; }
    .thumb-layer-wrapper { display: none; }
    .hero-content-wrapper {
        padding-left: 0; text-align: center; display: flex;
        flex-direction: column; justify-content: center;
        align-items: center; padding-bottom: 40px;
    }
    .hero-title-premium { font-size: 2.8rem; }
    .hero-desc-premium { display: none; }
    .hero-meta-premium { justify-content: center; }
}
@media (max-width: 576px) {
    .hero-title-premium { font-size: 2.2rem; }
    .btn-premium-watch, .btn-premium-list { padding: 10px 20px; font-size: 0.95rem; }
}

/* ==========================================================================
   5. MOVIE CARDS
   ========================================================================== */
.poster-wrapper {
    position: relative; border-radius: 8px; overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); transition: all 0.3s ease;
}
.card-img-top {
    aspect-ratio: 3/4 !important; object-fit: cover !important;
    width: 100%; height: auto; transition: transform 0.4s ease;
}

.badge-ribbon {
    position: absolute; top: 12px; left: -5px; padding: 4px 12px;
    color: #fff; font-weight: 700; font-size: 0.65rem;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    border-radius: 4px 4px 4px 0; z-index: 5;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-ribbon::after {
    content: ''; position: absolute; top: 100%; left: 0;
    border-top: 5px solid rgba(0,0,0,0.4); border-left: 5px solid transparent;
}
.ribbon-movie { background: var(--color-secondary); }
.ribbon-movie::after { border-top-color: #009db5; }
.ribbon-tv { background: #10b981; }
.ribbon-tv::after { border-top-color: #047857; }

.badge-quality {
    position: absolute; top: 12px; right: 10px;
    background: #4ade80; color: #000; font-weight: 800;
    font-size: 0.7rem; padding: 3px 8px; border-radius: 4px;
    z-index: 5; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.card-title a { color: #fff; font-weight: 600; transition: color 0.2s; }
.card-title a:hover { color: var(--color-primary) !important; }
.movie-meta-info { font-size: 0.85rem; margin-top: 8px; opacity: 0.8; }

/* ==========================================================================
   6. TRENDING SECTION & COMPONENTS
   ========================================================================== */
.trending-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 25px; border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
}
.trending-title {
    font-weight: 800; font-size: 1.8rem; margin-right: 20px;
    border-left: 5px solid var(--color-primary); padding-left: 15px;
}
.trending-tabs {
    background-color: rgba(255,255,255,0.05); padding: 5px;
    border-radius: 30px; display: inline-flex; gap: 5px;
}
.trending-tab-btn {
    background: transparent; border: none; color: var(--color-text-muted);
    padding: 6px 18px; border-radius: 20px; font-size: 0.9rem;
    font-weight: 500; cursor: pointer; transition: all 0.3s;
}
.trending-tab-btn.active {
    background-color: #fff; color: #000; font-weight: 700;
    box-shadow: 0 2px 10px rgba(255,255,255,0.2);
}
.trending-tab-btn:hover:not(.active) { color: #fff; }

.nav-btn-custom, .trend-prev, .trend-next {
    width: 36px; height: 36px; background-color: rgba(255,255,255,0.1);
    color: #fff; border-radius: 5px; display: flex; align-items: center;
    justify-content: center; cursor: pointer; transition: all 0.2s;
    border: 1px solid transparent;
}
.nav-btn-custom:hover, .trend-prev:hover, .trend-next:hover {
    background-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.4); transform: scale(1.1);
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.site-footer {
    background-color: #080808; border-top: 1px solid var(--border-light);
    padding-top: 60px; padding-bottom: 30px; margin-top: 80px; font-size: 0.95rem;
}
.footer-title {
    color: #fff; font-weight: 700; text-transform: uppercase;
    margin-bottom: 25px; letter-spacing: 1px; position: relative; display: inline-block;
}
.footer-title::after {
    content: ''; display: block; width: 40px; height: 3px;
    background: var(--color-secondary); margin-top: 8px; border-radius: 2px;
}
.footer-menu-list li { margin-bottom: 12px; }
.footer-menu-list li a { color: var(--color-text-muted); transition: all 0.2s; }
.footer-menu-list li a:hover {
    color: var(--color-secondary); padding-left: 5px;
}

/* ==========================================================================
   8. EXTRAS (SHARE, COMMENTS, BACK TO TOP)
   ========================================================================== */
.share-box {
    background: linear-gradient(145deg, #1c1c1c, #0d0d0d) !important;
    border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); position: relative; overflow: hidden;
}
.share-box::before {
    content: ''; position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
    pointer-events: none;
}
.btn-share {
    width: 48px; height: 48px; display: flex; align-items: center;
    justify-content: center; border-radius: 12px; color: #fff;
    transition: all 0.3s; position: relative; overflow: hidden; border: none;
}
.btn-share:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); }
.btn-share svg { width: 24px; height: 24px; fill: currentColor; transition: transform 0.3s; }
.btn-share:hover svg { transform: scale(1.15); }

/* Share Colors */
.btn-fb { background: linear-gradient(45deg, #1877f2, #3b5998); }
.btn-x { background: #000; border: 1px solid #333; }
.btn-telegram { background: linear-gradient(45deg, #24A1DE, #0088cc); }
.btn-messenger { background: linear-gradient(45deg, #00B2FF, #006AFF); }
.btn-whatsapp { background: linear-gradient(45deg, #25D366, #128C7E); }

@media (max-width: 768px) {
    .share-box { gap: 15px; text-align: center; }
    .share-text { margin-bottom: 10px; }
}

/* Comments */
.comment-box-wrapper {
    background-color: #1a1a1a !important;
    border: 1px solid var(--border-light); border-radius: 12px;
}
#commentform textarea, #commentform input {
    background-color: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: #fff; border-radius: 8px;
}
textarea#comment{width:100%;}
#commentform textarea:focus {
    border-color: var(--color-secondary); background-color: rgba(0,0,0,0.5); outline: none;
}
#commentform .submit {
    background: var(--color-primary); color: #fff; border: none;
    padding: 10px 30px; border-radius: 50px; font-weight: bold; cursor: pointer;
}
.comment-list li.comment {
    background-color: #161616; border: 1px solid var(--border-light);
    border-radius: 10px; padding: 20px; margin-bottom: 20px;
}

/* Back to Top */
#back-to-top {
    display: flex; align-items: center; justify-content: center;
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background-color: var(--color-primary); color: #fff; border: none;
    border-radius: 50%; cursor: pointer; z-index: 1000;
    opacity: 0; visibility: hidden; transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}
#back-to-top:hover { background-color: #b20710; transform: translateY(-5px); }
#back-to-top.show { opacity: 1; visibility: visible; }
#back-to-top i { font-size: 24px; }

/* Pagination */
.pagination-wrapper ul.page-numbers {
    background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(5px);
    border-radius: 50px; padding: 8px 20px;
}
.pagination-wrapper ul.page-numbers li span.current {
    background-color: #fff; color: #000; font-weight: bold;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* Watchlist Active State */
.add-to-watchlist.active {
    background-color: #fff !important; color: #e50914 !important;
    border-color: #fff !important;
}
.add-to-watchlist.active i::before { content: "\f147"; }

/* Typography Fixes */
.movie-content-body h1, .movie-content-body h2, 
.movie-content-body h3, .movie-content-body h4 {
    color: #ffffff; font-weight: 700; margin-top: 25px; margin-bottom: 15px;
}
.movie-content-body a { color: #00d4f5; text-decoration: underline; }
.movie-content-body p { margin-bottom: 15px; }

/* ==========================================================================
   9. DROPDOWN MENU (HOVER EFFECT)
   ========================================================================== */
@media (min-width: 992px) { /* ដំណើរការតែលើ Desktop ប៉ុណ្ណោះ */
    
    /* 1. កំណត់ Position របស់ Parent Menu */
    .main-navigation .nav-links > li {
        position: relative;
        padding-bottom: 10px; /* បន្ថែម Space បន្តិចដើម្បីកុំអោយដាច់ពេល Mouse ឆ្លង */
        margin-bottom: -10px;
    }

    /* 2. រចនា Sub Menu (លាក់ជាមុនសិន) */
    .main-navigation .nav-links .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 220px; /* ទំហំ Dropdown */
        background-color: #1a1a1a; /* ពណ៌ផ្ទៃខាងក្រោយ (យកតាម Theme របស់អ្នក) */
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        border: 1px solid var(--border-light);
        border-radius: 8px;
        padding: 10px 0;
        list-style: none;
        z-index: 1100;
        
        /* Animation ពេលបង្ហាញ */
        opacity: 0;
        visibility: hidden;
        transform: translateY(15px);
        transition: all 0.3s ease;
        display: block; /* WordPress ជួនកាលដាក់ display:none, យើងប្រើ opacity វិញ */
    }

    /* 3. បង្ហាញ Sub Menu ពេលដាក់ Mouse លើ (Hover) */
    .main-navigation .nav-links li:hover > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* 4. រចនា Link នៅក្នុង Sub Menu */
    .main-navigation .nav-links .sub-menu li {
        margin: 0;
        display: block;
        width: 100%;
    }

    .main-navigation .nav-links .sub-menu li a {
        display: block;
        padding: 10px;
        color: #b3b3b3;
        font-size: 0.9rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        text-decoration: none;
        transition: all 0.2s;
        margin: 0 10px;
        border-radius: 20px;
    }

    /* Hover លើ Link ខាងក្នុង */
    .main-navigation .nav-links .sub-menu li a:hover {
        background-color: var(--color-primary); /* ពណ៌ក្រហមតាម Theme */
        color: #fff !important;
        padding-left: 25px; /* Effect រុញអក្សរទៅមុខបន្តិច */
    }
    
    /* លុប Border សម្រាប់កូនចុងក្រោយ */
    .main-navigation .nav-links .sub-menu li:last-child a {
        border-bottom: none;
    }
}

/* Custom Edit */
.trending-nav {display: flex;gap: 10px;}
.text-muted{color:#fff !important;}
.play-overlay {
    position: absolute;
    z-index: 6;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    place-items: center;
    justify-content: center;
    align-items: center;
    display: flex;
    opacity: 0;
}
.play-overlay:hover {
    opacity: 1;
}
.play-overlayx {
    opacity: 1;
    border-radius: 100px;
    background: #00000061;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breadcrumb-item+.breadcrumb-item::before{color:#fff;}



































