/* ========================================
   PROFESYONEL MOBİL MENÜ SİSTEMİ
   - Hardware-accelerated animations
   - iPad + Mobile breakpoints
   - Touch-optimized UX
   ======================================== */

/* ========================================
   1. TABLET (iPad) Optimizasyonu
   768px - 1024px arası
   ======================================== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Top bar tablet */
    .top-bar .container {
        padding: 0 20px;
    }
    
    .contact-info span {
        font-size: 13px;
        margin: 0 8px;
    }
    
    .social-icons a {
        margin: 0 8px;
        font-size: 16px;
    }
    
    /* Navigation tablet - Kompakt yatay menü */
    .nav-container {
        padding: 15px 20px;
    }
    
    .logo {
        font-size: 22px;
    }
    
    .nav-menu {
        gap: 15px;
    }
    
    .nav-menu > li > a {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Dropdown tablet */
    .dropdown-menu {
        min-width: 200px;
    }
    
    .dropdown-menu a {
        padding: 12px 20px;
        font-size: 13px;
    }
}

/* ========================================
   2. MOBİL MENÜ - Hardware Accelerated
   <= 768px
   ======================================== */
@media screen and (max-width: 768px) {
    
    /* Top bar mobil */
    .top-bar {
        padding: 12px 0;
    }
    
    .top-bar .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 6px;
    }
    
    .contact-info span {
        font-size: 13px;
    }
    
    .social-icons a {
        margin: 0 10px;
        font-size: 16px;
    }
    
    /* Navigation container */
    .nav-container {
        padding: 12px 15px;
    }
    
    .logo {
        font-size: 20px;
        z-index: 1002;
    }
    
    /* ========================================
       HAMBURGER BUTTON - Touch Optimized
       ======================================== */
    .mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;  /* Touch target minimum */
        height: 44px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1002;
        position: relative;
        
        /* Touch optimization */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .mobile-toggle i {
        font-size: 24px;
        color: #333;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-toggle:active i {
        transform: scale(0.9);
    }
    
    /* ========================================
       SLIDE MENU - Transform Based
       ======================================== */
    .nav-menu {
        /* Position */
        position: fixed;
        top: 0;
        right: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        
        /* Layout */
        display: flex !important; /* Hep flex, visibility ile kontrol */
        flex-direction: column;
        padding: 80px 0 20px;
        gap: 0;
        
        /* Style */
        background: #ffffff;
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
        
        /* Scroll */
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
        
        /* Animation - Hardware accelerated */
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
        
        /* Z-index */
        z-index: 1001;
    }
    
    /* Active state - Slide in */
    .nav-menu.active {
        transform: translateX(0);
    }
    
    /* ========================================
       MENU ITEMS
       ======================================== */
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-menu > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 20px;
        font-size: 16px;
        color: #333;
        font-weight: 500;
        
        /* Touch optimization */
        min-height: 54px;
        -webkit-tap-highlight-color: transparent;
    }
    
    .nav-menu > li > a:hover {
        background: #f8f9fa;
        color: #007bff;
    }
    
    /* Remove desktop underline */
    .nav-menu a::after {
        display: none;
    }
    
    /* ========================================
       DROPDOWN - Accordion Style
       ======================================== */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f9fa;
        margin: 0;
        border-radius: 0;
        
        /* Accordion animation */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .dropdown-menu.active {
        max-height: 400px; /* Yeterli yükseklik */
    }
    
    .dropdown-menu a {
        display: flex;
        align-items: center;
        padding: 14px 20px 14px 40px;
        font-size: 14px;
        color: #555;
        min-height: 48px;
        
        /* Smooth transition */
        transition: all 0.2s ease;
    }
    
    .dropdown-menu a i {
        margin-right: 10px;
        width: 18px;
        color: #007bff;
    }
    
    .dropdown-menu a:hover {
        background: #e9ecef;
        color: #007bff;
        padding-left: 44px;
    }
    
    /* Dropdown indicator */
    .dropdown-toggle::after {
        content: '\f078'; /* Font Awesome down arrow */
        font-family: 'FontAwesome';
        margin-left: 8px;
        font-size: 12px;
        transition: transform 0.3s ease;
    }
    
    .dropdown-toggle.active::after {
        transform: rotate(180deg);
    }
}

/* ========================================
   3. OVERLAY - Fade Animation
   ======================================== */
.mobile-overlay {
    /* Position */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Style */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    
    /* Animation */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    
    /* Z-index */
    z-index: 1000;
    
    /* Touch */
    -webkit-tap-highlight-color: transparent;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   4. BODY SCROLL LOCK
   Menü açıkken scroll engelle
   ======================================== */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ========================================
   5. PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* GPU acceleration hint */
.nav-menu,
.mobile-overlay {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Smooth touch scrolling */
.nav-menu {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Prevent text selection during menu interaction */
.mobile-toggle,
.nav-menu a,
.mobile-overlay {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
