/* ============================================================
   MOBILE RESPONSIVE LAYER — Android & iOS uyumluluk
   Tüm sayfalar ve paneller için global güvenlik ağı.
   ============================================================ */

/* ---------- Tüm cihazlar ---------- */

/* Görseller/medya asla kapsayıcısını taşmasın */
img, video, canvas, svg:not(.material-symbols-outlined) {
    max-width: 100%;
}

img, video {
    height: auto;
}

/* Uzun link/kod/metin satır taşması koruması */
pre, code, kbd, samp {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

p, td, th, li, a, span, label, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* iOS/Android 300ms dokunma gecikmesini kaldır */
a, button, [role="button"], input, select, textarea, label {
    touch-action: manipulation;
}

/* iOS dokunma vurgusu */
* {
    -webkit-tap-highlight-color: transparent;
}

/* iOS metin boyut otomatik ayarını dengele */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ---------- Mobil (<= 768px) ---------- */
@media (max-width: 768px) {

    /* iOS: input focus'ta otomatik zoom'u engelle (16px kuralı) */
    input, select, textarea,
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="tel"], input[type="search"],
    input[type="date"], input[type="datetime-local"], input[type="time"] {
        font-size: 16px !important;
    }

    /* Tablolar yatay kaydırılabilir olsun — sayfayı kırmasın */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* Dokunma hedefleri: butonlar en az 44px (Apple HIG / Android) */
    button,
    [role="button"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"] {
        min-height: 44px;
    }

    /* Flex satırlar taşarsa sarmaya izin ver */
    .flex:not(.flex-nowrap):not(.flex-col) {
        flex-wrap: wrap;
    }

    /* Satır içi yükseklik sabitlenmiş geniş blokları koru */
    [class*="w-["] {
        max-width: 100vw;
    }
}

/* ---------- Küçük telefonlar (<= 380px) ---------- */
@media (max-width: 380px) {
    h1, .text-display-lg, [class*="text-5xl"], [class*="text-6xl"], [class*="text-7xl"] {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }

    h2, [class*="text-4xl"] {
        font-size: 1.5rem !important;
        line-height: 1.25 !important;
    }
}

/* ---------- iOS safe-area (çentik/home bar) ---------- */
@supports (padding: env(safe-area-inset-bottom)) {
    footer {
        padding-bottom: calc(3rem + env(safe-area-inset-bottom));
    }

    /* Alt-sabit elementler home bar üstüne binmesin */
    [class*="fixed"][class*="bottom-"],
    .fixed.bottom-0, .fixed.bottom-4, .fixed.bottom-6 {
        margin-bottom: env(safe-area-inset-bottom);
    }
}

/* ---------- Erişilebilirlik: hareket azaltma ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
