/* ========================================
   MODERN HEADER WITH MOBILE MENU
   ======================================== */

/* Font Ayarları - FAQ ile Uyumlu */
.navbar,
.navbar p,
.navbar span,
.navbar label,
.navbar input,
.navbar select,
.navbar textarea,
.navbar button,
.navbar a,
.navbar small,
.navbar strong,
.top-social-bar,
.top-social-bar p,
.top-social-bar span,
.top-social-bar a {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

.navbar h1,
.navbar h2,
.navbar h3,
.navbar h4,
.navbar h5,
.navbar h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Icon'ları koru */
.navbar i,
.navbar .fas,
.navbar .far,
.navbar .fab,
.navbar .fal,
.navbar .fad,
.top-social-bar i,
.top-social-bar .fas,
.top-social-bar .far,
.top-social-bar .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
}

/* Top Social Bar */
.top-social-bar {
    background: var(--dark-surface);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: var(--z-sticky);
}

.top-social-container {
    max-width: min(1400px, 100%);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--text-light);
    font-size: 16px;
    transition: color 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Main Navigation - Modern Theme (Download/Footer ile Uyumlu) */
.navbar {
    background: rgba(30, 41, 59, 0.5) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: var(--z-header) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
    pointer-events: none;
}

.navbar.scrolled {
    background: rgba(30, 41, 59, 0.7) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    border-bottom-color: rgba(148, 163, 184, 0.2) !important;
}

.nav-container,
.navbar .container {
    max-width: min(1400px, 100%) !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 72px !important;
    position: relative !important;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: var(--z-sidebar);
    position: relative;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-pink) 50%, var(--accent-cyan) 100%);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

/* Navigation Menu - Base Styles (Mobile First) */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Desktop View - Desktop stilleri buraya hapsedildi */
@media (min-width: 993px) {
    .nav-menu {
        display: flex;
        gap: 5px;
        flex: 1;
        justify-content: center;
        align-items: center;
    }

    .nav-menu a {
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        padding: 25px 16px;
        display: flex;
        align-items: center;
        font-size: 13px;
        font-weight: 600;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
            'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
        letter-spacing: 0.3px;
        text-transform: uppercase;
        transition: all 0.3s ease;
        border-bottom: 3px solid transparent;
        border-radius: 0;
        white-space: nowrap;
        position: relative;
    }

    .nav-menu a i {
        margin-right: 8px;
        font-size: 14px;
        color: rgba(139, 92, 246, 0.6);
        transition: all 0.3s ease;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        color: rgba(255, 255, 255, 0.9);
        background: rgba(139, 92, 246, 0.1);
        border-bottom-color: var(--accent-purple);
    }

    .nav-menu a:hover i,
    .nav-menu a.active i {
        color: var(--accent-purple);
    }
    
    .navbar .container {
        justify-content: center;
    }
}

/* Tablet and Mobile View - Mobil stilleri buraya hapsedildi */
@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .navbar .container {
        justify-content: space-between;
    }
    
    /* Mobil menü için özel scope - parent elementlerden bağımsız */
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 85vw;
        max-width: 320px;
        height: calc(100vh - 70px);
        background: rgba(30, 41, 59, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 20px 0;
        gap: 0;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        overflow-y: auto;
        z-index: calc(var(--z-sidebar) + 1);
        border-left: 1px solid rgba(148, 163, 184, 0.1);
        /* Kendi stacking context'ini oluştur */
        isolation: isolate;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    /* Mobil menü linkleri - daha spesifik seçici ile renk garantisi */
    .nav-menu a {
        width: calc(100% - 20px);
        padding: 18px 30px;
        margin: 0 10px 4px 10px;
        border-bottom: none;
        border-left: 3px solid transparent;
        border-radius: 0.5rem;
        font-size: 14px;
        justify-content: flex-start;
        background: rgba(15, 23, 42, 0.3);
        border: 1px solid rgba(148, 163, 184, 0.1);
        transition: all 0.3s ease;
        /* Renk tanımı - parent'tan bağımsız */
        color: #ffffff;
        text-decoration: none;
        display: flex;
        align-items: center;
        font-weight: 600;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    }
    
    .nav-menu a i {
        width: 24px;
        margin-right: 15px;
        font-size: 16px;
        text-align: center;
        color: rgba(255, 255, 255, 0.8);
        transition: all 0.3s ease;
    }
    
    .nav-menu a:hover,
    .nav-menu a.active {
        background: rgba(30, 41, 59, 0.5);
        border-left-color: var(--accent-purple);
        border-color: rgba(139, 92, 246, 0.3);
        color: #ffffff;
        padding-left: 35px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .nav-menu a:hover i,
    .nav-menu a.active i {
        color: var(--accent-purple);
    }
    
    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: var(--z-dropdown);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* Small Mobile */
@media (max-width: 576px) {
    .navbar .container {
        padding: 0 15px;
    }
    
    .nav-menu {
        width: 90vw;
        max-width: 280px;
    }
    
    .nav-menu a {
        padding: 16px 25px;
        font-size: 13px;
    }
    
    .nav-menu a i {
        width: 20px;
        margin-right: 12px;
        font-size: 15px;
    }
}

/* Dropdown Menu */
.nav-more {
    position: relative;
}

.nav-more > a i.fa-chevron-down {
    margin-left: 5px;
    margin-right: 0 !important;
    font-size: 10px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 0.75rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    list-style: none;
    padding: 8px 0;
    margin: 8px 0 0 0;
    z-index: var(--z-dropdown);
}

.nav-more:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    padding: 12px 20px !important;
    font-size: 13px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
    text-transform: none !important;
    border: none !important;
    display: block !important;
}

.dropdown-menu a:hover {
    background: rgba(139, 92, 246, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Scrollbar for Mobile Menu */
.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-menu::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 3px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 3px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* Animation for menu items on mobile */
@media (max-width: 992px) {
    .nav-menu.active a {
        animation: slideInRight 0.4s ease forwards;
        opacity: 0;
    }
    
    .nav-menu.active a:nth-child(1) { animation-delay: 0.05s; }
    .nav-menu.active a:nth-child(2) { animation-delay: 0.1s; }
    .nav-menu.active a:nth-child(3) { animation-delay: 0.15s; }
    .nav-menu.active a:nth-child(4) { animation-delay: 0.2s; }
    .nav-menu.active a:nth-child(5) { animation-delay: 0.25s; }
    .nav-menu.active a:nth-child(6) { animation-delay: 0.3s; }
    .nav-menu.active a:nth-child(7) { animation-delay: 0.35s; }
    .nav-menu.active a:nth-child(8) { animation-delay: 0.4s; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse animation for critical alerts */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Critical Alert Styles */
.nav-menu a[style*="background: #e74c3c"],
.nav-menu a[style*="background: #f39c12"] {
    position: relative;
    overflow: visible;
}

.nav-menu a[style*="background: #e74c3c"] {
    background: linear-gradient(135deg, var(--color-danger) 0%, #c0392b 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4) !important;
}

.nav-menu a[style*="background: #e74c3c"]:hover {
    background: linear-gradient(135deg, #ec7063 0%, var(--color-danger) 100%) !important;
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.5) !important;
    transform: translateY(-2px) !important;
}

.nav-menu a[style*="background: #f39c12"] {
    background: linear-gradient(135deg, var(--color-warning) 0%, #e67e22 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4) !important;
}

.nav-menu a[style*="background: #f39c12"]:hover {
    background: linear-gradient(135deg, #f5b041 0%, var(--color-warning) 100%) !important;
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.5) !important;
    transform: translateY(-2px) !important;
}

.nav-menu a[style*="background: #e74c3c"] i,
.nav-menu a[style*="background: #f39c12"] i {
    color: white !important;
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Admin Alert Styles (HTML Hijyen Temizliği) */
.nav-menu a.alert-critical {
    background: var(--color-danger) !important;
    animation: pulse 2s infinite;
}

.nav-menu a.alert-warning {
    background: var(--color-warning) !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ========================================
   MOBILE MENU FINAL FIX (Cleaned & Refactored)
   ======================================== */

@media (max-width: 991px) {
    /* Overlay Katmanı - Menüden düşük z-index */
    .mobile-menu-overlay,
    #mobileMenuOverlay {
        z-index: 999998 !important;
        background: rgba(0, 0, 0, 0.7) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Menü Konteyneri - En üstte */
    .nav-menu,
    #navMenu {
        background-color: #0f172a !important;
        z-index: 999999 !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: fixed !important;
    }

    /* Menü Aktif Olduğunda */
    .nav-menu.active,
    #navMenu.active {
        z-index: 999999 !important;
        right: 0 !important;
    }

    /* Linkler ve Metin Elementleri */
    .nav-menu a,
    .nav-menu span,
    .nav-menu li,
    #navMenu a,
    #navMenu span {
        color: #ffffff !important;
        opacity: 1 !important;
        display: block !important;
        text-shadow: none !important;
        text-decoration: none !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    /* İkonlar - Normal Linkler */
    .nav-menu i,
    #navMenu a i {
        color: #FFA500 !important;
        opacity: 1 !important;
    }

    /* Hover Durumları */
    .nav-menu a:hover,
    .nav-menu a:active,
    .nav-menu a:focus,
    #navMenu a:hover,
    #navMenu a:active,
    #navMenu a:focus {
        color: #ffffff !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
    }

    /* Alert Class'ları - Kritik Uyarılar */
    .nav-menu a.alert-critical,
    #navMenu a.alert-critical {
        color: #ffffff !important;
        background: var(--color-danger) !important;
    }

    .nav-menu a.alert-critical i,
    #navMenu a.alert-critical i {
        color: #ffffff !important;
    }

    /* Alert Class'ları - Uyarılar */
    .nav-menu a.alert-warning,
    #navMenu a.alert-warning {
        color: #ffffff !important;
        background: var(--color-warning) !important;
    }

    .nav-menu a.alert-warning i,
    #navMenu a.alert-warning i {
        color: #ffffff !important;
    }
}