/**
 * Süvari Motosiklet Ekosistemi - Universal Responsive & Touch Ergonomics Stylesheet
 * 320px Mobile • 768px Tablet • 1024px+ Desktop • 2K (1440p) • 4K (2160p) • 21:9 & 32:9 Ultra-Wide
 * (c) 2026 Süvari Moto Topluluğu - Süvari Standartlarında 3 Katmanlı Mimari
 */

/* 1. Zero Horizontal Overflow & Base Normalization */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* 2. iOS Safe Area Inset Support (Notch & Home Indicator) */
:root {
    --sat: env(safe-area-inset-top, 0px);
    --sar: env(safe-area-inset-right, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
}

/* 3. Mobile Bottom Nav & Safe-Area Padding */
@media (max-width: 1023px) {
    body {
        padding-bottom: var(--sab);
    }

    /* Fixed bottom navigation styling with safe-area support */
    nav.fixed.bottom-0 {
        padding-bottom: calc(0.5rem + var(--sab)) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
    }

    /* Floating WhatsApp Button on Mobile/Tablet */
    a[href*="wa.me"].fixed {
        bottom: calc(1.25rem + var(--sab)) !important;
        right: 1rem !important;
        width: 3.25rem !important;
        height: 3.25rem !important;
        z-index: 45 !important;
    }
}

@media (min-width: 1024px) {
    /* Desktop floating WhatsApp button */
    a[href*="wa.me"].fixed {
        bottom: 1.5rem !important;
        right: 1.5rem !important;
        width: 3.5rem !important;
        height: 3.5rem !important;
        z-index: 45 !important;
    }
}

/* 4. Responsive Header Protection (320px - 420px screens) */
@media (max-width: 420px) {
    header .max-w-7xl,
    .suvari-frosted-header .max-w-7xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    header .space-x-8 {
        gap: 0.5rem !important;
    }
    #headerBrandSub, .header-brand-sub {
        display: none !important;
    }
    #langToggleBtn, .lang-toggle-btn {
        padding-left: 0.4rem !important;
        padding-right: 0.4rem !important;
        font-size: 10px !important;
    }
    #authNavContainer button {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        font-size: 11px !important;
    }
}

/* 5. Tablet Top Nav Cleanliness (768px - 1023px screens) */
@media (min-width: 768px) and (max-width: 1023px) {
    #desktopNavLinks a {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        font-size: 11px !important;
    }
}

/* 6. Modal Scroll Safety for Small Mobile Viewports */
.modal-box, #loginModal > div, #registerModal > div, #createTripModal > div, #listingModal > div, #editProfileModal > div, #suvariSearchModal {
    max-height: calc(90vh - var(--sat)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* 7. Image & Media Fluidity */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* 8. Table & Code block horizontal scrolling without breaking layout */
.table-container, table {
    max-width: 100%;
}
pre, code {
    word-break: break-word;
    white-space: pre-wrap;
}

/* 9. Card Grid Responsive Balance */
@media (min-width: 640px) and (max-width: 1023px) {
    .tablet-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* 10. Tap Target Sizes for Touchscreens (iOS HIG & Material) */
button, a, input, select, textarea {
    touch-action: manipulation;
}

/* ==========================================================================
   11. SARKAÇ ADAM STANDARTLARINDA 3 KATMANLI RESPONSIVE & ULTRA-WIDE KONTEYNERLER
   (2K QHD 1440p • 4K UHD 2160p • 21:9 & 32:9 ULTRAWIDE MONİTÖRLER)
   ========================================================================== */

/* Tier 1: Standart Geniş Masaüstü (1280px - 1535px) */
@media (min-width: 1280px) and (max-width: 1535px) {
    .suvari-wide-container {
        max-width: 1280px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Tier 2: 2K QHD Monitörler & Geniş Ekranlar (1536px - 1919px / 2xl) */
@media (min-width: 1536px) {
    .max-w-7xl,
    .suvari-wide-container {
        max-width: 1520px !important;
    }
    
    header .max-w-7xl,
    .suvari-frosted-header .max-w-7xl,
    .suvari-subnav-bar .max-w-7xl {
        max-width: 1600px !important;
    }

    /* Kart ve gridlerin ferah nefes alması */
    .grid.gap-6 {
        gap: 1.75rem !important;
    }
    .grid.gap-8 {
        gap: 2.25rem !important;
    }
}

/* Tier 3: 4K UHD & 21:9 Ultrawide Monitörler (1920px - 2559px / 3xl) */
@media (min-width: 1920px) {
    .max-w-7xl,
    .suvari-wide-container {
        max-width: 1840px !important;
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }

    header .max-w-7xl,
    .suvari-frosted-header .max-w-7xl,
    .suvari-subnav-bar .max-w-7xl {
        max-width: 1840px !important;
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }

    /* 4K ekranlarda metin okuma ergonomisi */
    .hero-title-responsive {
        font-size: 4.5rem !important;
        line-height: 1.1 !important;
    }
}

/* Tier 4: Süper Ultrawide / 32:9 Simülatör Monitörleri (>= 2560px) */
@media (min-width: 2560px) {
    .max-w-7xl,
    .suvari-wide-container {
        max-width: 2160px !important;
        padding-left: 4.5rem !important;
        padding-right: 4.5rem !important;
    }

    header .max-w-7xl,
    .suvari-frosted-header .max-w-7xl,
    .suvari-subnav-bar .max-w-7xl {
        max-width: 2160px !important;
        padding-left: 4.5rem !important;
        padding-right: 4.5rem !important;
    }
}

/* ==========================================================================
   12. SÜVARİ KOKPİT TELEMETRİ AMBİANCE HUD KANATLARI (YARIŞ SİMÜLATÖRÜ HİSSİ)
   Sadece geniş ekranlarda (>= 1680px) yan boşlukları süsleyen, 
   tıklanmayan, donanım ivmeli, hassas kokpit telemetri kılavuz çizgileri
   ========================================================================== */
.suvari-hud-wing {
    position: fixed;
    top: 72px; /* Header yüksekliğinin hemen altı */
    bottom: 0;
    width: 140px;
    z-index: 20;
    pointer-events: none !important;
    user-select: none !important;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
    color: rgba(161, 161, 170, 0.55);
    transition: opacity 0.3s ease;
}

@media (min-width: 1680px) {
    .suvari-hud-wing {
        display: flex;
    }
}

@media (min-width: 1920px) {
    .suvari-hud-wing {
        width: 180px;
        padding: 2rem 1.25rem;
    }
}

@media (min-width: 2560px) {
    .suvari-hud-wing {
        width: 240px;
        padding: 2.5rem 1.75rem;
        font-size: 10px;
    }
}

.suvari-hud-left {
    left: 0;
    border-right: 1px dashed rgba(245, 158, 11, 0.12);
    background: linear-gradient(90deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.03) 80%, transparent 100%);
}

.suvari-hud-right {
    right: 0;
    border-left: 1px dashed rgba(245, 158, 11, 0.12);
    background: linear-gradient(270deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.03) 80%, transparent 100%);
    text-align: right;
}

/* Kılavuz Çizgi Tarama Efekti */
.suvari-hud-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, transparent 0%, rgba(245, 158, 11, 0.08) 50%, transparent 100%);
    animation: suvariHudScan 8s linear infinite;
    pointer-events: none;
}

@keyframes suvariHudScan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* Dikey Hız & Telemetri Çizgileri */
.suvari-hud-ticks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0;
}

.suvari-hud-tick-line {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.suvari-hud-tick-line.lit {
    background: rgba(245, 158, 11, 0.65);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

/* Canlı Ses Spektrumu (Equalizer Bars) */
.suvari-hud-eq {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
    justify-content: flex-end;
}

.suvari-hud-eq-bar {
    width: 2px;
    background: rgba(56, 189, 248, 0.5);
    border-radius: 1px;
    animation: suvariEqBounce 1.2s ease-in-out infinite alternate;
}

.suvari-hud-eq-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.suvari-hud-eq-bar:nth-child(2) { height: 75%; animation-delay: 0.3s; }
.suvari-hud-eq-bar:nth-child(3) { height: 100%; animation-delay: 0.05s; }
.suvari-hud-eq-bar:nth-child(4) { height: 50%; animation-delay: 0.45s; }
.suvari-hud-eq-bar:nth-child(5) { height: 85%; animation-delay: 0.2s; }
.suvari-hud-eq-bar:nth-child(6) { height: 30%; animation-delay: 0.4s; }

@keyframes suvariEqBounce {
    0% { height: 20%; opacity: 0.3; }
    50% { height: 95%; opacity: 0.85; }
    100% { height: 40%; opacity: 0.5; }
}
