/**
 * Mobile Scroll Fix
 * Mobil cihazlarda sidebar scroll sorunlarını çözen CSS
 */

/* Mobile scroll optimizasyonları */
@media (max-width: 768px) {
    /* Body scroll kontrolü */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    /* Mobile menu panel scroll fix */
    .mobile-menu-panel {
        /* Scroll container optimizasyonları */
        overflow-y: scroll !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        
        /* iOS Safari için özel düzeltmeler */
        -webkit-transform: translate3d(0, 0, 0) !important;
        transform: translate3d(0, 0, 0) !important;
        
        /* Viewport height düzeltmeleri */
        height: 100vh !important;
        height: -webkit-fill-available !important;
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
        
        /* Touch action */
        touch-action: pan-y !important;
    }
    
    /* Menu content için scroll container */
    .mobile-menu-content {
        /* Scroll optimizasyonları */
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        
        /* Height düzeltmeleri */
        max-height: calc(100vh - 80px) !important;
        min-height: calc(100vh - 80px) !important;
        
        /* Touch scroll için */
        touch-action: pan-y !important;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        
        /* Momentum scrolling */
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        will-change: scroll-position;
    }
    
    /* Menu section'lar için */
    .mobile-menu-section {
        /* Touch optimizasyonu */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Menu item'lar için */
    .mobile-menu-item {
        /* Touch feedback */
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1) !important;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        
        /* Scroll sırasında tıklamayı engelle */
        pointer-events: auto;
    }
    
    /* Scroll bar styling */
    .mobile-menu-content::-webkit-scrollbar {
        width: 4px;
    }
    
    .mobile-menu-content::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .mobile-menu-content::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.3);
        border-radius: 2px;
    }
    
    .mobile-menu-content::-webkit-scrollbar-thumb:hover {
        background: rgba(59, 130, 246, 0.5);
    }
    
    /* Android Chrome için özel düzeltmeler */
    @supports (-webkit-appearance: none) {
        .mobile-menu-panel {
            height: 100vh !important;
        }
        
        .mobile-menu-content {
            height: calc(100vh - 80px) !important;
        }
    }
    
    /* iOS Safari için özel düzeltmeler */
    @supports (-webkit-touch-callout: none) {
        .mobile-menu-panel {
            height: -webkit-fill-available !important;
        }
        
        .mobile-menu-content {
            height: calc(-webkit-fill-available - 80px) !important;
            -webkit-overflow-scrolling: touch !important;
        }
    }
    
    /* Samsung Internet için */
    @media screen and (-webkit-min-device-pixel-ratio: 0) {
        .mobile-menu-content {
            overflow-y: scroll !important;
        }
    }
}

/* Genel touch optimizasyonları */
@media (pointer: coarse) {
    .mobile-menu-item {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* High DPI ekranlar için */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .mobile-menu-content::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.4);
    }
}


/* Scroll alanını genişletmek için ek kurallar */
@media (max-width: 768px) {
  /* Menu container'a extra space */
  .mobile-menu-panel .mobile-menu-content {
    /* Alt kısma extra padding */
    padding-bottom: 80px !important;
  }

 

  /* Scroll indicator */
  .mobile-menu-panel::after {
    content: "";
    display: block;
    height: 100px;
    width: 100%;
    background: transparent;
  }
}
