/**
 * Safe Area CSS - Samsung/Android/iOS Gesture Navigation Fix
 * Samsung A31 ve benzeri cihazlar için optimize edildi
 */

:root {
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --android-nav-height: 45px;
    --bottom-nav-padding: max(var(--safe-area-bottom), var(--android-nav-height));
}

/* iOS 11.0-11.2 support */
@supports (padding-bottom: constant(safe-area-inset-bottom)) {
    :root {
        --safe-area-bottom: constant(safe-area-inset-bottom);
    }
}

/* Bottom Navigation Container - Tüm fixed bottom elementler için */
.fixed.bottom-0,
[style*="bottom: 0"],
[style*="bottom:0"] {
    /* Safe area padding - Samsung A31 için artırıldı */
    padding-bottom: max(var(--bottom-nav-padding, 45px), 45px) !important;
}

/* Android cihazlar için minimum padding */
@supports not (padding-bottom: env(safe-area-inset-bottom)) {
    .fixed.bottom-0,
    [style*="bottom: 0"],
    [style*="bottom:0"] {
        padding-bottom: 45px !important;
    }
}

/* Samsung One UI - Gesture Navigation Bar */
@media screen and (max-aspect-ratio: 9/16) {
    .fixed.bottom-0,
    [style*="bottom: 0"],
    [style*="bottom:0"] {
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 50px) !important;
    }
}

/* Uzun ekranlı telefonlar (Samsung A31, A51, A71 vb.) - 20:9 ratio */
@media screen and (min-aspect-ratio: 18/39) {
    .fixed.bottom-0,
    [style*="bottom: 0"],
    [style*="bottom:0"] {
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 55px) !important;
    }
}

/* Tam ekran modu için (PWA, standalone) */
@media screen and (display-mode: standalone),
       screen and (display-mode: fullscreen) {
    .fixed.bottom-0,
    [style*="bottom: 0"],
    [style*="bottom:0"] {
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 60px) !important;
    }
}

/* High DPI ekranlar (Samsung Galaxy serisi) */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    .fixed.bottom-0,
    [style*="bottom: 0"],
    [style*="bottom:0"] {
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 48px) !important;
    }
}

/* Body padding - içeriğin bottom nav altında kalmaması için */
body {
    padding-bottom: calc(85px + var(--bottom-nav-padding, 45px)) !important;
}

/* Z-index düzeltmesi - bottom nav her zaman üstte */
.fixed.bottom-0.z-50,
[class*="bottom-nav"],
#bottom-nav {
    z-index: 9999 !important;
}

/* Touch hedef alanı genişletme */
.fixed.bottom-0 a,
.fixed.bottom-0 button,
[class*="bottom-nav"] a,
[class*="bottom-nav"] button {
    min-height: 52px;
    min-width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dokunma geri bildirimi iyileştirme */
.fixed.bottom-0 a:active,
.fixed.bottom-0 button:active {
    transform: scale(0.95);
    opacity: 0.8;
}
