/* ================================================================
   css-header-EN.css
   site header (desktop + mobile): logo, main menu, login/panel/subscribe
   buttons, app download modal. Load after css-body.css (depends on
   base colors/fonts from body, though it shares no classes with it).
   ================================================================ */

/* ================================================================
   HEADER - desktop
   ================================================================ */
.site-header {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 500;
    height: 72px;
    align-items: center;
    padding: 0 20px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--on-surface-06);
}

@media (min-width: 992px) {
    .site-header {
        display: flex;
    }
}

/* once the page has scrolled, add a touch of depth (shadow) and a
   slightly darker background so the fixed header reads as a separate
   layer above the content sliding underneath it */
body.scrolled .site-header {
    background: var(--header-bg-scrolled);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.header-inner {
    max-width: var(--site-content-width);
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.site-logo img {
    height: 38px;
    width: auto;
    border-radius: 6px;
}
.site-logo span {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-text);
    display: inline;
}

/* ===== desktop menu ===== */
.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}
.site-nav a,
.nav-dropdown-toggle {
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--menu-text-color);
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.site-nav a:hover,
.nav-dropdown-toggle:hover {
    color: var(--menu-text-hover-color);
    background: var(--menu-hover-bg);
}

.nav-dropdown {
    position: relative;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 2000;
    background: var(--bg-base);
    border-radius: 12px;
    min-width: 180px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--on-surface-06);
    overflow: hidden;
}
.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

/* first-level dropdown (Movies/Series/Genres/other collections) with a
   background image (random new-release thumbnail poster, picked in PHP).

   Note: the image sits in its own ::before (not directly as background on
   .nav-dropdown-menu-bg itself), because a filter (grayscale) on an element
   applies to its *entire subtree* including children - putting grayscale
   directly on .nav-dropdown-menu-bg would also gray out the accent hover
   color on links. With a separate ::before, grayscale only affects the
   image and everything else (dark gradient + the links themselves) stays
   untouched.
   The image is set from PHP as a CSS variable (--bg-url), not directly as
   background-image, since ::before can't take an inline style separate
   from its parent. */
.nav-dropdown-menu-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--bg-url);
    background-size: cover;
    background-position: center;
    filter: grayscale(1);
    z-index: 0;
}
.nav-dropdown-menu-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 10, 0.55) 0%,
        rgba(10, 10, 10, 0.65) 60%,
        rgba(10, 10, 10, 0.78) 100%
    );
    z-index: 1;
}
.nav-dropdown-menu-inner {
    position: relative;
    z-index: 2;
    padding: 6px 0;
}

.nav-dropdown-menu a {
    padding: 9px 18px;
    font-size: 14px;
    color: var(--submenu-text-color);
    display: block;
    border-radius: 0;
}
.nav-dropdown-menu a:hover {
    background: var(--submenu-hover-bg);
    color: var(--submenu-text-hover-color);
}

/* ===== right-side header buttons ===== */
.site-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.site-actions .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--on-surface-70);
    transition: all 0.2s;
    background: var(--on-surface-06);
    backdrop-filter: blur(4px);
}
.site-actions .icon-btn:hover {
    background: var(--on-surface-15);
    color: #fff;
}

/* search button: color/hover kept separate from other header icon-btns (like app download) */
#btnSearch {
    color: var(--search-icon-color);
}
#btnSearch:hover {
    color: var(--search-icon-hover-color);
    background: var(--search-icon-hover-bg);
}

/* language button (links out to the English subdomain) */
#btnLangTop {
    color: var(--lang-icon-color);
}
#btnLangTop:hover {
    color: var(--lang-icon-hover-color);
    background: var(--lang-icon-hover-bg);
}

/* login button (blue) */
.site-actions .btn-login {
    height: 40px;
    padding: 0 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--btn-login-text);
    transition: all 0.2s;
    background: var(--btn-login-bg);
    border: none;
}
.site-actions .btn-login:hover {
    background: var(--btn-login-hover-bg);
    transform: scale(1.05);
}
.site-actions .btn-login span {
    font-size: 13px;
    font-weight: 600;
    color: var(--btn-login-text);
}

/* account panel button (soft red, to stand out from the rest) */
.site-actions .btn-panel {
    height: 40px;
    padding: 0 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--btn-panel-text);
    transition: all 0.2s;
    background: var(--btn-panel-bg);
    border: none;
}
.site-actions .btn-panel:hover {
    background: var(--btn-panel-hover-bg);
    transform: scale(1.05);
}
.site-actions .btn-panel span {
    font-size: 13px;
    font-weight: 600;
    color: var(--btn-panel-text);
}

/* buy subscription button (green) */
.site-actions .btn-subscribe {
    height: 40px;
    padding: 0 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--btn-subscribe-text);
    transition: all 0.2s;
    background: var(--btn-subscribe-bg);
    border: none;
    box-shadow: 0 4px 16px rgba(11, 111, 44, 0.3);
}
.site-actions .btn-subscribe:hover {
    background: var(--btn-subscribe-hover-bg);
    transform: scale(1.05);
}
.site-actions .btn-subscribe i {
    margin-right: 4px;
    font-size: 14px;
}

/* ================================================================
   app download modal (desktop + mobile) - opened from the header's app
   download icon and from the mobile category menu's download button
   ================================================================ */
.app-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.app-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}
.app-modal {
    background: var(--bg-base);
    border-radius: 24px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 420px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transform: translateY(16px);
    transition: transform .2s;
}
.app-modal-overlay.open .app-modal {
    transform: translateY(0);
}

.app-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-elevated);
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s;
}
.app-modal-close:hover {
    background: var(--bg-elevated-2);
    color: #fff;
}

.app-modal-head {
    display: flex;
    align-items: center;
    gap: 14px;
}
.app-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    flex-shrink: 0;
}
.app-modal-head h2 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}
.app-modal-head p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.app-modal-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-modal-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 16px 18px;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: border-color .15s, background .15s;
}
.app-modal-card:hover {
    background: var(--bg-elevated-2);
}
.app-mc-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--on-surface-08);
}
.app-mc-icon.android { background: rgba(11, 111, 44, .15); }
.app-mc-icon.ios     { background: var(--on-surface-06); }
.app-mc-icon.web     { background: var(--accent-soft); }

.app-mc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.app-mc-body strong { font-size: 14px; font-weight: 700; color: #fff; }
.app-mc-body span   { font-size: 12px; color: var(--text-muted); }
.app-mc-arrow { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.app-modal-card:hover .app-mc-arrow { color: var(--accent-text); }

/* iOS install guide */
.app-modal-ios-guide {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 14px 18px;
    display: none;
}
.app-modal-ios-guide.open { display: block; }
.app-modal-ios-guide ol {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 2.2;
}
.app-modal-ios-guide ol b { color: var(--accent-text); }

/* link to the full download guide page */
.app-modal-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    padding: 8px;
    transition: color .15s;
}
.app-modal-more:hover { color: var(--accent-text); }

/* manual PWA install guide */
.app-pwa-manual-guide {
    background: var(--bg-elevated);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pwa-guide-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.pwa-guide-row b { color: var(--accent-text); }
.pwa-guide-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pwa-guide-tip {
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--on-surface-06);
    padding-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pwa-guide-tip i { color: var(--text-muted); }

/* app download button at the bottom of the mobile category menu */
.menu-app-btn-wrap {
    padding: 14px 16px 8px;
    border-top: 1px solid var(--on-surface-06);
}
.menu-app-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent-soft);
    border-radius: 14px;
    color: var(--accent-text);
    font-size: 15px;
    font-weight: 600;
    padding: 14px;
    cursor: pointer;
    transition: background .15s;
}
.menu-app-btn:hover { background: var(--accent-glow); }
.menu-app-btn i { font-size: 18px; }