/* 🚀 ANA HEADER - 2025 ULTRA */
:root {
    --header-height: 60px;
    --header-bg: rgba(255, 255, 255, 0.98);
    --header-bg-dark: rgba(26, 26, 26, 0.98);
    --header-shadow: 0 2px 20px rgba(0,0,0,0.08);
    --menu-width: 100vw;
    --menu-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dark-mode {
    --header-bg: var(--header-bg-dark);
}

/* Header Container */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 10000;
    box-shadow: var(--header-shadow);
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 15px;
}

/* Logo - Ultra Modern 3D */
.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    z-index: 10001;
    position: relative;
    padding: 5px;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.header-logo::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2, #667eea);
    background-size: 200% 200%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Fix for uncomposited animation - use transform instead of background-position-x */
@supports (transform: translateX(0)) {
    .header-logo::before {
        animation: gradientShiftTransform 3s ease infinite;
    }
}

@keyframes gradientShiftTransform {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.header-logo:hover::before {
    opacity: 0.1;
}

.header-logo img {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 2px 8px rgba(102, 126, 234, 0.2));
}

.header-logo:hover img {
    transform: scale(1.08) translateY(-2px);
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.4));
}

.header-logo:active img {
    transform: scale(0.98);
}

/* Hamburger Menu - Ultra Modern 3D Interactive - 2025 Vision */
.hamburger-main {
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 10001;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 6px 25px rgba(102, 126, 234, 0.4),
        0 0 0 0 rgba(102, 126, 234, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* iOS double-tap zoom'u engelle */
    user-select: none;
    -webkit-user-select: none;
}

.hamburger-main::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 19px;
    background: linear-gradient(135deg, #667eea, #764ba2, #667eea);
    background-size: 200% 200%;
    opacity: 0;
    transition: all 0.5s ease;
    z-index: -1;
    animation: gradientPulse 3s ease infinite;
    filter: blur(8px);
}

@keyframes gradientPulse {
    0%, 100% { 
        background-position: 0% 50%;
        opacity: 0;
    }
    50% { 
        background-position: 100% 50%;
        opacity: 0.3;
    }
}

.hamburger-main:hover::before {
    opacity: 0.5;
    animation-duration: 1s;
}

.hamburger-main::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hamburger-main:hover::after {
    opacity: 1;
}

.hamburger-main:hover {
    transform: scale(1.15) translateY(-3px) rotate(5deg);
    box-shadow: 
        0 12px 40px rgba(102, 126, 234, 0.6),
        0 0 0 6px rgba(102, 126, 234, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.hamburger-main:active {
    transform: scale(0.92) translateY(0);
    transition: all 0.1s ease;
}

.hamburger-main.active {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: 
        0 6px 25px rgba(0,0,0,0.2),
        inset 0 2px 6px rgba(0,0,0,0.1),
        0 0 0 3px rgba(102, 126, 234, 0.2);
    transform: rotate(180deg);
}

.hamburger-main span {
    display: block;
    width: 26px;
    height: 3.5px;
    background: white;
    border-radius: 4px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
    position: relative;
    box-shadow: 
        0 2px 6px rgba(0,0,0,0.3),
        0 0 0 0 rgba(255,255,255,0.5);
}

.hamburger-main:hover span {
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.4),
        0 0 0 2px rgba(255,255,255,0.3);
}

.hamburger-main.active span {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 
        0 3px 10px rgba(102, 126, 234, 0.4),
        0 0 0 2px rgba(102, 126, 234, 0.2);
}

.hamburger-main.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px) scaleX(1.1);
    width: 26px;
}

.hamburger-main.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0) translateX(15px) rotate(90deg);
    width: 0;
}

.hamburger-main.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px) scaleX(1.1);
    width: 26px;
}

/* Mobile Menu Drawer - UYGULAMA BENZERİ - 2025 VİZYON */
.mobile-menu-main {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height - mobil tarayıcılar için */
    background: var(--menu-bg);
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
    box-shadow: -10px 0 50px rgba(0,0,0,0.5),
                inset -5px 0 20px rgba(0,0,0,0.2);
    padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    position: relative;
    transform: translateX(0);
    will-change: transform, right; /* Performans optimizasyonu */
    /* Uygulama benzeri görünüm */
    border-left: none;
    border-radius: 0;
}

.mobile-menu-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.mobile-menu-main.active {
    right: 0;
    transform: translateX(0);
    /* Uygulama benzeri - tam ekran */
    width: 100vw !important;
    max-width: 100vw !important;
}

/* Mobilde menü açıldığında smooth scroll */
.mobile-menu-main.active .menu-content-main {
    animation: slideInRight 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Menü item'ları için staggered animation */
.mobile-menu-main.active .menu-nav-item-main {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.mobile-menu-main.active .menu-nav-item-main:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-main.active .menu-nav-item-main:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-main.active .menu-nav-item-main:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-main.active .menu-nav-item-main:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-main.active .menu-nav-item-main:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu-main.active .menu-nav-item-main:nth-child(6) { animation-delay: 0.35s; }
.mobile-menu-main.active .menu-nav-item-main:nth-child(7) { animation-delay: 0.4s; }
.mobile-menu-main.active .menu-nav-item-main:nth-child(8) { animation-delay: 0.45s; }
.mobile-menu-main.active .menu-nav-item-main:nth-child(9) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-overlay-main {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    -webkit-tap-highlight-color: transparent; /* iOS tap highlight kaldır */
    touch-action: none; /* Scroll engelle */
}

.menu-overlay-main.active {
    opacity: 1;
    visibility: visible;
}

/* Menu Content - Animasyonlu */
.menu-content-main {
    padding: 30px 0;
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    color: white;
    animation: slideInRight 0.5s ease;
    position: relative;
    z-index: 1;
    min-height: calc(100vh - var(--header-height) - 40px);
    min-height: calc(100dvh - var(--header-height) - 40px);
    display: flex;
    flex-direction: column;
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.menu-user-section-main {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.menu-user-avatar-main {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    border: 3px solid rgba(255,255,255,0.5);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.menu-user-name-main {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 5px;
}

.menu-user-email-main {
    font-size: 14px;
    opacity: 0.9;
}

.menu-nav-main {
    padding: 0 20px;
}

.menu-nav-item-main {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    color: white;
    text-decoration: none;
    border-radius: 16px;
    margin-bottom: 10px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 600;
    font-size: 17px;
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transform-style: preserve-3d;
}

.menu-nav-item-main::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: white;
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 5px 5px 0;
}

.menu-nav-item-main:hover,
.menu-nav-item-main.active {
    background: rgba(255,255,255,0.25);
    transform: translateX(12px) translateZ(10px) scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3),
                0 0 0 1px rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

.menu-nav-item-main.active::before {
    transform: scaleY(1);
}

.menu-nav-item-main i {
    font-size: 22px;
    width: 28px;
    text-align: center;
    transition: transform 0.3s ease;
}

.menu-nav-item-main:hover i {
    transform: scale(1.2) rotate(5deg);
}

.menu-divider-main {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    margin: 25px 0;
}

.menu-footer-main {
    padding: 25px 20px;
    padding-bottom: calc(25px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: auto;
    background: rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.menu-footer-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    border-radius: 10px;
    padding-left: 15px;
}

.menu-footer-item-main:hover {
    color: white;
    transform: translateX(5px);
    background: rgba(255,255,255,0.1);
}

/* Header Actions */
.header-actions-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn-main {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    position: relative;
}

.header-btn-main:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 0 15px;
        gap: 10px;
    }
    
    .header-logo span {
        display: none;
    }
    
    .header-logo img {
        height: 36px;
        max-width: 100px;
    }
    
    .hamburger-main {
        width: 48px;
        height: 48px;
        gap: 6px;
    }
    
    .hamburger-main span {
        width: 24px;
        height: 3px;
    }
    
    .header-btn-main {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .mobile-menu-main {
        width: 100vw !important;
        max-width: 100vw !important;
        right: -100vw;
        border-radius: 0 !important;
    }
    
    .mobile-menu-main.active {
        right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    /* Mobil boşluk düzeltmesi */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 9998;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
}

@media (min-width: 769px) {
    .hamburger-main {
        display: none;
    }
    
    .mobile-menu-main {
        display: none;
    }
    
    .menu-overlay-main {
        display: none;
    }
}

/* Safe Area Support - iOS ve Android için */
@supports (padding: max(0px)) {
    .main-header {
        padding-top: env(safe-area-inset-top, 0px);
        height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    }
    
    .mobile-menu-main {
        padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 20px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    
    .header-container {
        padding-left: max(20px, env(safe-area-inset-left, 0px));
        padding-right: max(20px, env(safe-area-inset-right, 0px));
    }
}

/* Body padding for fixed header - Mobil boşluk düzeltmesi - SIFIRDAN YENİDEN KURULDU */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    padding-top: var(--header-height);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobilde body scroll sorununu çöz - GELİŞMİŞ */
@media (max-width: 768px) {
    html {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        height: 100%;
        position: relative;
    }
    
    body {
        position: relative;
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height */
        padding-top: var(--header-height);
        width: 100%;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Menü açıkken body scroll'u engelle - GELİŞMİŞ */
    body.menu-open,
    body.menu-open html {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
        height: 100dvh;
    }
    
    /* Tüm sayfalarda padding-top düzeltmesi */
    .container,
    .page-container,
    .content-wrapper,
    main,
    article {
        padding-top: calc(var(--header-height) + 20px) !important;
    }
    
    /* Header altında boşluk bırak */
    .main-header + * {
        margin-top: var(--header-height);
    }
}
