/* ========================================
   Header Component Styles
   Base layout + Navigation + Actions
   Loaded globally via head_resources.php
   ======================================== */

/* ========== Global Design Tokens ========== */
:root {
    --bg-primary: #18181b;
    --bg-secondary: #27272a;
    --bg-card: #27272a;
    --accent: #8a2128;
    --accent-hover: #6e1a20;
    --text: #ffffff;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --border-color: #3f3f46;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* ========== Global Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: auto;
    min-height: 100%;
    scrollbar-gutter: stable;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #18181b;
    color: var(--text);
    overflow-x: hidden;
}

/* ========== SITE HEADER (Base Layout) ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(24, 24, 27, 0.95), rgba(24, 24, 27, 0.8));
    backdrop-filter: blur(10px);
}

.header-logo a {
    text-decoration: none;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -1px;
}

.logo-accent {
    color: var(--accent);
}

.logo-text {
    color: var(--text);
}

/* Header Logo Image - prevents header shifting */
.header-logo-img {
    max-height: 30px;
    height: auto;
    width: auto;
    display: block;
}

.header-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 32px;
}

.header-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 4px;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--text);
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.header-nav a:hover::after,
.header-nav a.active::after {
    width: 100%;
}

/* Home icon - no underline by default, only on hover */
.header-nav a.nav-home {
    display: flex;
    align-items: center;
    padding-bottom: 4px;
}

.header-nav a.nav-home::after {
    width: 0;
}

.header-nav a.nav-home:hover::after {
    width: 100%;
}

.header-nav a.nav-home svg {
    fill: var(--text-muted);
    transition: fill 0.3s ease;
}

.header-nav a.nav-home:hover svg {
    fill: var(--accent);
}

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

.btn-signin {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text);
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-signin:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

/* Auth Skeleton — shimmer placeholder while auth state loads */
.auth-skeleton {
    width: 70px;
    height: 31px;
    border-radius: 6px;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: auth-shimmer 1.5s ease-in-out infinite;
}

.auth-skeleton-mobile {
    width: 100%;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: auth-shimmer 1.5s ease-in-out infinite;
}

@keyframes auth-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.user-name {
    font-size: 13px;
    color: var(--text-muted);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

/* ========== LANGUAGE SELECTOR ========== */

.lang-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    height: 31px;
    box-sizing: border-box;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lang-btn .fi {
    width: 20px;
    height: 15px;
    border-radius: 2px;
}

.lang-arrow {
    transition: transform 0.2s;
}

.lang-selector.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
}

.lang-selector.open .lang-dropdown {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #e5e7eb;
    text-decoration: none;
    transition: background 0.2s;
}

.lang-option:hover {
    background: rgba(138, 33, 40, 0.3);
}

.lang-option.active {
    background: rgba(138, 33, 40, 0.5);
}

.lang-option .fi {
    width: 20px;
    height: 15px;
    border-radius: 2px;
}

/* User Dropdown - Specific to header-actions */
.header-actions .user-dropdown {
    position: relative;
}

.header-actions .user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s;
    height: 31px;
    box-sizing: border-box;
}

.header-actions .user-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-actions .user-dropdown .user-name {
    font-size: 12px;
    font-weight: 500;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}

.header-actions .user-dropdown .user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8a2128, #6e1a20);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
}

.header-actions .user-dropdown .user-avatar-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 9999;
    overflow: hidden;
}

.user-dropdown.open .user-dropdown-menu {
    display: block;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-dropdown-item svg {
    opacity: 0.7;
}

.user-dropdown-admin {
    color: #fbbf24;
}

.user-dropdown-admin:hover {
    background: rgba(251, 191, 36, 0.1);
}

.user-dropdown-logout {
    color: #ef4444;
}

.user-dropdown-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.user-dropdown-divider {
    height: 1px;
    background: #374151;
    margin: 4px 0;
}

/* ========================================
   Mobile Menu Accordion (Genre/Year)
   ======================================== */

.mobile-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 16px 20px;
}

.mobile-accordion {
    margin: 0 10px;
}

.mobile-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: #e5e7eb;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 8px;
}

.mobile-accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-accordion-header.open {
    background: rgba(138, 33, 40, 0.2);
    color: #fff;
}

.mobile-accordion-header .accordion-arrow {
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.mobile-accordion-header.open .accordion-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.mobile-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 8px 8px;
    margin: 0 8px 8px 8px;
}

.mobile-accordion-content.open {
    max-height: 400px;
    overflow-y: auto;
}

.mobile-accordion-link {
    display: block;
    padding: 10px 20px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-accordion-link:last-child {
    border-bottom: none;
}

.mobile-accordion-link:hover,
.mobile-accordion-link:active {
    background: rgba(138, 33, 40, 0.3);
    color: #fff;
}

/* ========================================
   Hamburger Menu Component
   Moved from home.css — used by all pages
   ======================================== */

/* Hamburger Button - Hidden on Desktop */
.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
    display: block;
    opacity: 1;
}

/* Mobile Menu Panel */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: linear-gradient(180deg, #1a1a1d 0%, #141416 100%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu.open {
    right: 0;
}

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

.mobile-menu-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.mobile-menu-title::first-letter {
    color: var(--accent, #8a2128);
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.mobile-menu-close:hover {
    color: #fff;
}

.mobile-menu-links {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: #a1a1aa;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
    color: #fff;
    background: rgba(138, 33, 40, 0.15);
    border-left-color: var(--accent, #8a2128);
}

.mobile-menu-link svg {
    flex-shrink: 0;
    fill: currentColor;
}

.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: var(--accent, #8a2128);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
    background: #6e1a20;
}

/* Body scroll lock when menu open */
body.menu-open {
    overflow: hidden;
}

/* ========================================
   Header Responsive Overrides
   ======================================== */

/* Desktop / Small Laptop */
@media (max-width: 1024px) {
    .header-nav {
        gap: 20px;
    }

    .header-nav a {
        font-size: 13px;
    }
}

/* Tablet / iPad */
@media (max-width: 900px) {

    /* Hide main nav, show hamburger */
    .header-nav {
        display: none;
    }

    .hamburger-btn {
        display: block;
        order: -1;
        margin-right: 10px;
    }

    .site-header {
        padding: 12px 20px;
    }

    .header-logo a {
        font-size: 20px;
    }
}

/* Small Tablet / Large Phone */
@media (max-width: 768px) {
    .site-header {
        padding: 10px 16px;
    }

    .header-logo a {
        font-size: 18px;
    }
}

/* Mobile - 576px and below */
@media (max-width: 576px) {
    .site-header {
        padding: 8px 12px;
    }
}

/* ========================================
   Global Utility Classes
   ======================================== */

/* Screen reader only - SEO için görünmez içerik */
.sr-only {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* Hidden element utility */
.hidden {
    display: none !important;
}

/* Section title - used by home, tv_home, profile/list, tv_detail */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #fff;
}

/* Main container - used by contact, cast, profile */
.main-container {
    padding-top: 70px;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 40px;
    padding-right: 40px;
}

/* ========================================
   Main Container & Section Title Responsive
   (Moved from home.css — Aşama 3)
   ======================================== */

@media (max-width: 1400px) {
    .main-container {
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (max-width: 1024px) {
    .main-container {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding-left: 16px;
        padding-right: 16px;
        min-height: auto;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
}

@media (max-width: 576px) {
    .main-container {
        padding-left: 12px;
        padding-right: 12px;
        overflow-x: hidden;
    }

    .section-title {
        font-size: 14px;
        margin-bottom: 10px;
    }
}