/* ===================================
   HEADER & NAVIGATION STYLES
   new_header.css - Yeni Header İçin
   home.css ile çakışmayı önlemek için
   spesifik seçiciler kullanılmıştır
   =================================== */

/* --- RESET: home.css çakışmalarını önle --- */
#main-header,
#main-header *,
#mobile-menu,
#mobile-menu * {
    box-sizing: border-box;
}

/* GLOBAL OVERFLOW FIX - KESİN ÇÖZÜM */
html,
body {
    overflow-x: hidden !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    /* Scrollbar Gizleme */
    scrollbar-width: none !important;
    /* Firefox */
    -ms-overflow-style: none !important;
    /* IE/Edge */
}

/* Chrome, Safari, Opera için scrollbar gizleme */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    background: transparent !important;
}

/* --- HEADER TEMEL --- */
#main-header {
    transition: transform 0.4s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    height: 56px !important;
    /* h-14 = 3.5rem = 56px */
    z-index: 9999 !important;
    /* Ensure header is always on top */
}

/* Masaüstü header yüksekliği */
@media (min-width: 1024px) {
    #main-header {
        height: 64px !important;
        /* lg:h-16 = 4rem = 64px */
    }
}

/* CSS Değişkenleri (Diğer bileşenler için) */
:root {
    --header-height: 64px;
    --header-height-mobile: 56px;
    --top-bar-height: 40px;
    /* Top bar h-10 = 2.5rem = 40px */
}

/* --- Font Awesome Icon Görünürlük --- */
#main-header i.fas,
#main-header i.fab,
#main-header i.far,
#mobile-menu i.fas,
#mobile-menu i.fab,
#mobile-menu i.far {
    display: inline-block !important;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", FontAwesome !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

.header-hidden {
    transform: translateY(-100%);
}

.header-visible {
    transform: translateY(0);
}

/* Masaüstünde (lg) header her zaman görünür ve sabit olsun */
@media (min-width: 1024px) {
    .header-hidden {
        transform: translateY(0) !important;
    }
}

/* Header Scroll Stil Değişimi */
#main-header.scrolled {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    border-bottom-color: #e5e7eb;
}

/* --- NAV LINK HOVER ALT ÇİZGİ ANİMASYONU --- */
#main-header .nav-link {
    position: relative;
    padding-bottom: 4px;
    text-decoration: none;
}

#main-header .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #111;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

#main-header .nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

#main-header .nav-link:hover {
    color: #000;
}

/* --- DESKTOP DROPDOWN (Spesifik Seçiciler) --- */
#main-header .dropdown-menu {
    position: absolute !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

/* Dropdown Grid Düzeltmesi - home.css çakışmasını önle */
#main-header .dropdown-menu .grid {
    display: grid !important;
}

#main-header .dropdown-menu .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

#main-header .dropdown-menu .gap-8 {
    gap: 2rem !important;
}

#main-header .dropdown-menu .flex-col {
    display: flex !important;
    flex-direction: column !important;
}

#main-header .dropdown-menu .gap-4 {
    gap: 1rem !important;
}

#main-header .dropdown-menu .gap-3 {
    gap: 0.75rem !important;
}

/* Dropdown içerik max-width override */
#main-header .dropdown-menu,
#main-header .dropdown-menu * {
    max-width: none !important;
}

#main-header .group:hover>.dropdown-menu,
#main-header .group:focus-within>.dropdown-menu,
#main-header .dropdown-menu.show-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Dropdown içindeki linkler */
#main-header .dropdown-menu a {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    transition: all 0.2s ease;
}

#main-header .dropdown-menu a:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* --- MOBİL ACCORDION (Spesifik) --- */
#mobile-menu .accordion-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease-in-out, margin 0.3s ease;
}

#mobile-menu .accordion-content.active {
    max-height: 600px;
    opacity: 1;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* --- MOBİL MENÜ (Spesifik) --- */
#mobile-menu {
    transition: opacity 0.4s ease-in-out, visibility 0.4s step-end;
    opacity: 0;
    z-index: 9999 !important;
}

#mobile-menu.menu-open {
    transition: opacity 0.4s ease-in-out, visibility 0s;
    opacity: 1;
    visibility: visible !important;
}

/* --- STAGGERED ANİMASYON --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-nav-item {
    opacity: 0;
    transform: translateY(20px);
}

#mobile-menu.menu-open .mobile-nav-item {
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#mobile-menu.menu-open .mobile-nav-item:nth-child(1) {
    animation-delay: 0.1s;
}

#mobile-menu.menu-open .mobile-nav-item:nth-child(2) {
    animation-delay: 0.2s;
}

#mobile-menu.menu-open .mobile-nav-item:nth-child(3) {
    animation-delay: 0.3s;
}

#mobile-menu.menu-open .mobile-nav-item:nth-child(4) {
    animation-delay: 0.4s;
}

#mobile-menu.menu-open .mobile-nav-item:nth-child(5) {
    animation-delay: 0.5s;
}

#mobile-menu.menu-open .mobile-nav-item:nth-child(6) {
    animation-delay: 0.6s;
}

#mobile-menu.menu-open .mobile-nav-item:nth-child(7) {
    animation-delay: 0.7s;
}

/* --- FIXES FOR SUBPAGES --- */

/* Ensure Header is always on top */
#main-header {
    z-index: 1000 !important;
}

/* Ensure Dropdowns are above everything */
#main-header .dropdown-menu {
    z-index: 1100 !important;
}

/* Top Bar Visibility & Layout */
#top-bar-section {
    display: none;
    z-index: 1001 !important;
    background-color: #000;
    color: #fff;
    height: 40px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-bottom: 1px solid #1f2937;
}

@media (min-width: 1024px) {
    #top-bar-section {
        display: flex !important;
    }

    #main-header {
        top: 40px !important;
    }
}

/* Ensure Dropdown Content is Visible */
#main-header .dropdown-menu .w-\[500px\],
#main-header .dropdown-menu .w-\[550px\] {
    width: 500px !important;
    background-color: white !important;
    padding: 2rem !important;
    border-radius: 1rem !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

#main-header .dropdown-menu .w-\[550px\] {
    width: 550px !important;
}


/* Default Header Background (Fallback for Tailwind) */
#main-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}