/* assets/css/header.css - NİHAİ SÜRÜM */

header {
    background-color: rgba(255, 255, 255, 0.98);
    height: var(--header-height);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease;
}

body.dark-mode header {
    background-color: rgba(30, 41, 59, 0.98);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%; /* Kapsayıcı genişlik */
}

/* --- LOGO --- */
.logo {
    flex-shrink: 0; /* Logo sıkışmasın */
    margin-right: 30px;
}

.logo a {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: -1px;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* --- ANA MENÜ (Desktop) --- */
.main-menu {
    display: flex;
    align-items: center;
    gap: 5px; /* Menüler arası boşluk */
    flex: 1; /* Ortadaki boşluğu doldur */
    height: 100%;
    
    /* Taşma Yönetimi: Sığmayanları kaydır */
    overflow-x: auto; 
    overflow-y: hidden;
    white-space: nowrap; 
    -webkit-overflow-scrolling: touch; /* Mobilde akıcı kaydırma */
    scrollbar-width: none; /* Firefox scroll gizle */
}

/* Chrome/Safari scroll gizle */
.main-menu::-webkit-scrollbar {
    display: none;
}

/* Menü Kapsayıcı */
.nav-item-wrapper { 
    position: relative; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    flex-shrink: 0; /* Elemanlar büzülmesin */
}

.main-menu a {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 15px;
    padding: 0 15px;
    height: 100%; /* Tıklama alanı yüksekliği */
    display: flex;
    align-items: center;
    position: relative;
    transition: color 0.2s;
}

/* Alt çizgi animasyonu */
.nav-item-wrapper > a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-item-wrapper:hover > a {
    color: var(--primary-color);
    background-color: rgba(0,0,0,0.02); /* Hafif hover arka planı */
}

.nav-item-wrapper:hover > a::after {
    width: 100%;
}

/* Parent Ok İşareti (Desktop) */
.has-children > a::after { 
    /* Alt çizgi ile çakışmaması için pseudo elementi değiştirmek yerine ikon ekliyoruz */
    /* Bu kısım HTML'de ikon yoksa CSS ile eklenebilir, ancak biz HTML'e JS veya PHP ile eklemeyi tercih ettik. 
       Yine de CSS ile ok ekleyelim: */
}

.has-children > a {
    padding-right: 25px; /* Ok için yer aç */
}

.has-children > a::before {
    content: '\f107'; /* FontAwesome Down Arrow */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 8px;
    font-size: 11px;
    opacity: 0.5;
}

/* Dropdown Menü (Desktop) */
.nav-dropdown {
    position: absolute;
    top: 100%; 
    left: 0;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color); /* Üst çizgi */
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    min-width: 220px;
    opacity: 0; 
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    display: flex; 
    flex-direction: column;
    padding: 8px 0;
}

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

.nav-dropdown a {
    height: auto; /* Dropdown link yüksekliği serbest */
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-body);
    border-bottom: 1px solid var(--bg-surface);
    display: flex; 
    align-items: center; 
    gap: 10px;
    transition: all 0.2s;
}

.nav-dropdown a:last-child { border-bottom: none; }

.nav-dropdown a:hover {
    background-color: var(--bg-surface);
    color: var(--primary-color);
    padding-left: 25px; /* Sağa kayma efekti */
}

.nav-dropdown a::after, .nav-dropdown a::before { 
    display: none; /* Dropdown içindeki linklerde alt çizgi ve ok olmasın */
}

/* --- SAĞ AKSİYONLAR --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* Sağ taraf sıkışmasın */
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
}

.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-body);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background-color: var(--bg-surface);
    color: var(--primary-color);
}

/* Mobil Menü Butonu */
.mobile-menu-btn {
    display: none;
}

/* Kullanıcı Dropdown */
.user-dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: 140%; right: 0;
    background: var(--bg-card);
    width: 240px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: none;
    flex-direction: column;
    padding: 8px 0;
    z-index: 1001;
    animation: slideUpFade 0.2s ease-out;
}
@keyframes slideUpFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-menu.active { display: flex; }
.dropdown-header { padding: 10px 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 5px; font-size: 14px; color: var(--text-heading); background-color: var(--bg-surface); }
.dropdown-divider { height: 1px; background-color: var(--border-color); margin: 5px 0; }
.dropdown-menu a { padding: 10px 20px; font-size: 14px; color: var(--text-body); display: flex; align-items: center; gap: 12px; transition: background-color 0.2s; height: auto; }
.dropdown-menu a:hover { background-color: var(--bg-surface); color: var(--primary-color); }
.dropdown-menu a::after { display: none; }

/* Arama Modalı */
.search-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(5px); display: none; justify-content: center; align-items: center; z-index: 2000; opacity: 0; transition: opacity 0.3s ease; }
.search-modal.active { display: flex; opacity: 1; }
.search-box { width: 90%; max-width: 800px; position: relative; transform: scale(0.95); transition: transform 0.3s ease; }
.search-modal.active .search-box { transform: scale(1); }
.search-input { width: 100%; padding: 25px; font-size: 24px; font-weight: 600; border: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background-color: var(--bg-card); color: var(--text-heading); box-shadow: var(--shadow-lg); }
.search-input:focus { outline: none; }
.close-search { position: absolute; top: -50px; right: 0; background: none; border: none; color: #fff; font-size: 32px; cursor: pointer; transition: transform 0.3s; }
.close-search:hover { transform: rotate(90deg) scale(1.1); }

/* --- RESPONSIVE (MOBİL) AYARLAR --- */
@media (max-width: 992px) {
    .header-actions { margin-left: 10px; padding-left: 10px; border: none; gap: 5px; }
    .mobile-menu-btn { display: flex; }
    .user-dropdown, .icon-btn.search-btn { /* İsteğe bağlı: Mobilde bazı butonları gizle veya menü içine al */ }

    /* Ana Menü - Mobil Panel */
    .main-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--bg-card);
        flex-direction: column;
        align-items: flex-start; /* Sola yasla */
        padding: 0;
        gap: 0;
        border-top: 1px solid var(--border-color);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto; /* Dikey scroll */
        overflow-x: hidden;
        white-space: normal; /* Alt satıra geçebilsin */
    }

    .main-menu.active {
        transform: translateX(0);
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }

    /* Mobil Menü Öğeleri */
    .nav-item-wrapper {
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-item-wrapper > a {
        width: 100%;
        padding: 15px 20px;
        font-size: 16px;
        height: auto;
        justify-content: flex-start;
    }

    .nav-item-wrapper > a::after { display: none; }
    
    .nav-item-wrapper:hover > a { background-color: var(--bg-surface); }

    /* Mobil Dropdown */
    .nav-dropdown {
        position: static; /* Akışın içinde */
        width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
        opacity: 1; visibility: visible; transform: none;
        background-color: rgba(0,0,0,0.03); /* Hafif koyu zemin */
        padding: 0;
        display: flex; /* Mobilde her zaman açık veya JS ile toggle */
    }
    
    /* Eğer alt menü varsa linkin sağına ok koy */
    .has-children > a::before {
        right: 20px;
        font-size: 14px;
        transform: rotate(0deg); /* JS ile açılırsa döndürülebilir */
    }

    .nav-dropdown a {
        padding: 12px 20px 12px 40px; /* İçeriden başlat */
        font-size: 14px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .nav-dropdown a:hover {
        background-color: rgba(0,0,0,0.05);
        padding-left: 45px;
    }
}