/* Temel Ayarlar ve Değişkenler */
:root {
    --bg-color: #0b1120;
    --text-color: #e2e8f0;
    --panel-bg: rgba(15, 23, 42, 0.85);
    --panel-border: rgba(56, 189, 248, 0.3);
    --primary-color: #0ea5e9;
    --primary-hover: #0284c7;
    --accent-color: #38bdf8;
    --danger-color: #f43f5e;
    --success-color: #10b981;
    --font-family: 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); background-color: var(--bg-color); color: var(--text-color); overflow: hidden; }

/* Düzen - Split Screen Vari */
.app-container { display: flex; height: 100vh; width: 100vw; }

/* Harita Alanı */
.map-section { flex: 1; position: relative; }
.map { width: 100%; height: 100%; }

/* Glassmorphism Panelleri */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Toolbar */
.toolbar {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
    width: 300px; /* Biraz genişlettik formu sığdırmak için */
    max-height: 90vh;
    overflow-y: auto;
}

.title { font-size: 1.1rem; font-weight: 600; color: var(--accent-color); text-transform: uppercase; letter-spacing: 1px; text-align: center; border-bottom: 1px solid var(--panel-border); padding-bottom: 10px; }

/* Form Elements */
.route-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 0.8rem; color: #cbd5e1; }
.form-group input, .form-select { 
    background: rgba(0,0,0,0.3); border: 1px solid #334155; color: #fff; padding: 8px; border-radius: 6px; font-size: 0.9rem;
    outline: none; transition: border 0.2s; width: 100%; font-family: var(--font-family);
}
.form-group input:focus, .form-select:focus { border-color: var(--primary-color); }
.form-select option { background-color: var(--bg-color); color: var(--text-color); }
.coord-inputs { display: flex; gap: 10px; }
.coord-inputs input { width: 50%; }

.form-separator { text-align: center; color: var(--primary-color); font-size: 1.2rem; margin: 5px 0; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: none; border-radius: 6px; font-family: var(--font-family); font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; color: #fff; }
.sm-btn { font-size: 0.8rem; padding: 6px 10px; margin-top: 5px; }
.accent-btn { background-color: transparent; border: 1px solid var(--primary-color); color: var(--primary-color); }
.accent-btn:hover { background-color: var(--primary-color); color: #fff; }

.primary-btn { background-color: var(--primary-color); box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4); }
.primary-btn:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6); }
.primary-btn:active { transform: translateY(0); }
.secondary-btn { background-color: #334155; }
.secondary-btn:hover { background-color: #475569; }

.mt-10 { margin-top: 15px; }
.mt-5 { margin-top: 5px; }

.active-mode { background-color: var(--danger-color) !important; box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4) !important; color: white !important; border-color: transparent !important;}
.active-mode:hover { background-color: #be123c !important; }

/* Status */
.status-indicator { font-size: 0.85rem; color: #94a3b8; text-align: center; margin-top: 5px; }
.status-indicator span { display: inline-block; padding: 4px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }

/* WFS Output Alanı */
.output-section { width: 450px; display: flex; flex-direction: column; padding: 25px; border-left: 1px solid var(--panel-border); z-index: 10; }
.output-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.output-header h3 { font-size: 1.1rem; font-weight: 500; color: var(--accent-color); }
.badge { background-color: var(--primary-color); color: #fff; font-size: 0.75rem; padding: 4px 8px; border-radius: 6px; font-weight: 600; letter-spacing: 0.5px; }
.description { font-size: 0.9rem; color: #94a3b8; line-height: 1.5; margin-bottom: 20px; }
.code-container { flex: 1; display: flex; flex-direction: column; }
textarea { flex: 1; width: 100%; background-color: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 15px; color: #a5b4fc; font-family: 'Courier New', Courier, monospace; font-size: 0.85rem; resize: none; line-height: 1.5; outline: none; transition: border-color 0.2s; }
textarea:focus { border-color: var(--primary-color); }

/* Harita Scrollbarları için UI Gizleme, Custom */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

/* Animasyonlar */
.spin {
    animation: spin 1.5s linear infinite;
    transform-origin: center;
}
@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* OpenLayers Zoom & Basemap Customize */
.map .ol-zoom {
    top: 20px !important;
    bottom: auto !important;
    left: 20px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 2px;
}
.map .ol-zoom button {
    background-color: rgba(0,0,0,0.4);
    color: #fff;
    cursor: pointer;
}
.map .ol-zoom button:hover {
    background-color: var(--primary-color);
}

.basemap-selector {
    position: absolute;
    bottom: 20px;
    left: 20px; /* Zoom yukarı gittiği için en sola yanaştı */
    z-index: 1000;
    padding: 4px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
}
.basemap-selector select {
    padding: 6px;
    font-size: 0.8rem;
    border-radius: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 12px;
    z-index: 1000;
    pointer-events: none; /* Let clicks pass through */
    min-width: 160px;
    border: 1px solid rgba(255,255,255,0.1);
}
.map-legend h4 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 5px;
    font-weight: 500;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #cbd5e1;
}
.legend-item:last-child { margin-bottom: 0; }
.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.3);
}
.legend-line {
    width: 16px;
    height: 0;
    display: inline-block;
}

/* Feature Popup */
.ol-popup {
    position: absolute;
    background-color: var(--panel-bg);
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    bottom: 12px; /* Çapa okun ebadı kadar (11px + 1px) yukarı kaldırıldı, boşluk yok edildi */
    left: -100px; /* Merkezleme için ayarlandı (bottom-center ile birleşecek) */
    min-width: 200px;
    transform: translate(-50%, 0); /* Elementi kendi genişliğinin yarısı kadar geriye çekerek tam ortala */
    margin-left: 100px; 
}
.ol-popup:after, .ol-popup:before {
    top: 100%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}
.ol-popup:after {
    border-top-color: var(--panel-bg); /* Cam içi rengi */
    border-width: 10px;
    left: 50%;
    margin-left: -10px;
}
.ol-popup:before {
    border-top-color: var(--panel-border); /* Çerçeve rengi */
    border-width: 11px;
    left: 50%;
    margin-left: -11px;
}
.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 5px;
    right: 8px;
    color: #cbd5e1;
    font-size: 1rem;
}
.ol-popup-closer:after { content: "✖"; }
.ol-popup-closer:hover { color: #fff; }
.popup-title {
    font-size: 1rem; font-weight: 600; color: var(--accent-color);
    margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 5px;
}
.popup-field { font-size: 0.85rem; color: #cbd5e1; margin-bottom: 5px; }
.popup-field strong { color: #fff; }

/* Sağ Panel (Denetim Listesi) */
.right-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    bottom: 220px; /* Lejantın (altta ~160px) üstüne binmesini kesin engeller */
    width: 300px;
    z-index: 500;
    padding: 0;
    font-size: 0.85rem;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
}
.right-panel-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 16px 18px 10px 18px;
    background: var(--panel-bg);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 14px 14px 0 0;
    flex-shrink: 0;
}
.panel-toggle-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    flex-shrink: 0;
    line-height: 1;
}
.panel-toggle-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}
.right-panel-body {
    padding: 0px 18px 18px 18px;
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* Flexbox'ta scroll çalışması için kritik */
    border-radius: 0 0 14px 14px;
}
.right-panel-group-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: block;
    font-weight: 600;
    padding: 8px 0;
    margin-bottom: 6px;
    background: var(--panel-bg); /* Scroll ederken arkasını kapatması için */
}
.right-panel ul li {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    color: #cbd5e1;
}
.right-panel ul li:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateX(-3px);
}

/* ========== GPS Konum Takip Butonu ========== */
.gps-track-btn {
    position: absolute;
    bottom: 20px;
    left: 170px;
    z-index: 1000;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    color: #10b981;
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}
.gps-track-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
}
.gps-track-btn.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}
.gps-track-btn .gps-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}
.gps-track-btn.active .gps-dot {
    animation: gpsPulse 1.5s ease-in-out infinite;
}

@keyframes gpsPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* Pulsating GPS Location Marker */
.gps-marker-outer {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gpsMarkerPulse 2s ease-in-out infinite;
}
.gps-marker-inner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #fff;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}
@keyframes gpsMarkerPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.5; }
}

/* ========== Hız Koridoru Ortalama Hız Göstergesi (Gauge) ========== */
.speed-gauge-container {
    position: absolute;
    right: 20px;
    bottom: 220px;
    z-index: 600;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    animation: gaugeSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes gaugeSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.speed-gauge-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    border-radius: 14px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 90px;
}

.speed-gauge-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.speed-gauge-corridor-name {
    font-size: 0.7rem;
    color: #f59e0b;
    font-weight: 500;
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dikey Cetvel (Gauge Bar) */
.speed-gauge-bar-wrapper {
    position: relative;
    width: 36px;
    height: 200px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.speed-gauge-bar-fill {
    width: 100%;
    border-radius: 18px;
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.5s ease;
    min-height: 4px;
}

.speed-gauge-bar-fill.safe {
    background: linear-gradient(to top, #10b981, #34d399);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.speed-gauge-bar-fill.warning {
    background: linear-gradient(to top, #f59e0b, #fbbf24);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.speed-gauge-bar-fill.danger {
    background: linear-gradient(to top, #ef4444, #f87171);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    animation: dangerPulse 1s ease-in-out infinite;
}

@keyframes dangerPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 25px rgba(239, 68, 68, 0.8); }
}

/* Limit Çizgisi (orta hat) */
.speed-gauge-limit-line {
    position: absolute;
    left: -4px;
    right: -4px;
    height: 2px;
    background: #fff;
    z-index: 2;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}
.speed-gauge-limit-label {
    position: absolute;
    right: calc(100% + 6px);
    font-size: 0.6rem;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 5px;
    border-radius: 4px;
}

/* Tick İşaretleri */
.speed-gauge-ticks {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}
.speed-gauge-tick {
    position: absolute;
    left: 0;
    width: 8px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}
.speed-gauge-tick-label {
    position: absolute;
    left: calc(100% + 6px);
    font-size: 0.55rem;
    color: #64748b;
    transform: translateY(-50%);
    white-space: nowrap;
}

/* Ortalama Hız Değeri */
.speed-gauge-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.speed-gauge-value.danger-text {
    color: #ef4444;
    animation: dangerTextBlink 0.8s ease-in-out infinite;
}

@keyframes dangerTextBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.speed-gauge-unit {
    font-size: 0.6rem;
    color: #64748b;
    font-weight: 500;
}

/* Durum Mesajı */
.speed-gauge-status {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s;
}

.speed-gauge-status.ok {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.speed-gauge-status.slow-down {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: slowDownShake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}

@keyframes slowDownShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

/* Süre Göstergesi */
.speed-gauge-timer {
    font-size: 0.7rem;
    color: #94a3b8;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* Gauge Gizlenme Animasyonu */
.speed-gauge-container.hiding {
    animation: gaugeSlideOut 0.4s ease-in forwards;
}
@keyframes gaugeSlideOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(30px) scale(0.9); }
}

/* ========== MOBİL UYUMLULUK ========== */

/* Safe Area (Notch/hole-punch ekranlar) */
html {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Banner reklam alanı için alt boşluk ve Çatışma Giderimi */
body.has-banner-ad .map {
    height: calc(100% - 60px); /* Banner yüksekliği ~50-60px */
}

/* Varsayılan / Masaüstü için Banner Kaydırması */
body.has-banner-ad .basemap-selector,
body.has-banner-ad .gps-track-btn,
body.has-banner-ad .map-legend {
    bottom: 80px !important;
}

/* Mobilde Banner Açıksa Panelleri / Sheet'i Kaydır */
@media (max-width: 768px) {
    /* Rota formu (toolbar) artık TOP(üstte), o yüzden kaydırmıyoruz */
    body.has-banner-ad .basemap-selector,
    body.has-banner-ad .gps-track-btn,
    body.has-banner-ad .map-legend {
        bottom: 125px !important; /* Normal (65px) + Banner (60px) */
    }
    body.has-banner-ad .speed-gauge-container {
        bottom: 180px !important; 
    }
}

/* Küçük ekranlar (mobil) */
@media (max-width: 768px) {
    /* === PERFORMANS OPTİMİZASYONU === 
       WebView ve eski cihazlarda donmaları önlemek için
       Glassmorphism/Blur filtresini kapatıp mat zemin veriyoruz */
    .glass-panel, .ol-popup {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(15, 23, 42, 0.98) !important;
    }

    /* === ROTA ÇEKME PANELİ -> MİNİMAL TOP BAR === */
    .toolbar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: auto !important;
        width: 100vw !important;
        height: auto !important;
        max-height: 32vh !important; /* Dikeyde select/inputları sıkıştırmaması için esnedi */
        border-radius: 0 0 20px 20px !important;
        border: none !important;
        /* Çentik (Notch) ve Status Bar koruması (üst kısımdan min 45px) */
        padding: max(env(safe-area-inset-top, 45px), 45px) 15px 15px 15px !important;
        z-index: 1000 !important;
        display: flex !important;
        flex-direction: column !important;
        background: rgba(15, 23, 42, 0.98) !important;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.6);
        transform: translateY(0) !important;
        overflow-y: auto !important;
    }

    /* Gereksiz Bottom Sheet ve Başlık kalıntılarını gizle */
    .sheet-header, .sheet-handle, .status-indicator, .form-separator, .title {
        display: none !important;
    }
    
    .sheet-content {
        padding: 0 !important;
        background: transparent !important;
    }

    /* Rota Formu Grid Yapısı (Yatay minimal form düzeni) */
    .route-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-top: 0 !important;
    }
    
    .form-group {
        gap: 2px !important;
        margin-bottom: 0 !important;
    }

    .form-group label {
        display: none !important; /* Gereksiz label'lar gizlensin */
    }

    .form-group input, .form-select {
        padding: 6px 4px !important;
        font-size: 0.8rem !important;
        height: 32px !important;
    }

    .sm-btn {
        padding: 4px !important;
        font-size: 0.75rem !important;
        height: 32px !important;
        margin-top: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Rota Çek ve Temizle Buton grubunu yan yana grid yapıp uzat */
    .route-form > div:last-child {
        grid-column: span 2; 
    }

    #fetch-route-btn {
        height: 36px;
        margin-top: 4px !important;
        font-size: 0.85rem !important;
        width: 100%;
        background-color: #10b981 !important;
    }
    
    #clear-all-btn {
        width: 100%;
        margin-top: 2px !important;
    }

    /* Haritadaki OpenLayers Zoom kontrolünü form panelinin altına itelim */
    .map .ol-zoom {
        top: max(26vh, 140px) !important;
    }

    /* Denetim Paneli -> Sağdan Giren Kesintisiz Slider Menu */
    .right-panel {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
        width: 85vw !important;
        max-height: none !important;
        border-radius: 24px 0 0 24px !important;
        border: none !important;
        border-left: 1px solid rgba(56, 189, 248, 0.3) !important;
        transform: translateX(110%);
        transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 1500 !important; /* Bottom sheet üstünde olsun */
        display: flex !important; /* Flex olarak zorla, js display=none ile ezmesin */
        will-change: transform;
        background: rgba(15, 23, 42, 0.98) !important; /* Sidebar da mat zemin */
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .right-panel.expanded {
        transform: translateX(0);
    }
    
    /* Mobil görünümdeyken display: none özelliğini JavaScript uygulamasın diye !important eziyoruz */
    .right-panel[style*="display: none"] {
        display: flex !important;
    }

    /* Bottom Sheet 50px yer yediği için diğer butonları yukarı alıyoruz */
    .map-legend {
        right: 10px;
        bottom: 65px;
        min-width: 140px;
        padding: 10px;
        z-index: 900;
    }

    .map-legend h4 {
        font-size: 0.8rem;
    }

    .legend-item {
        font-size: 0.75rem;
        gap: 6px;
        margin-bottom: 5px;
    }

    .basemap-selector {
        left: 10px;
        bottom: 65px;
        z-index: 900;
    }

    .gps-track-btn {
        left: auto;
        right: 10px;
        bottom: 65px;
        z-index: 900;
    }

    /* Mini Butonlar */
    #right-panel-reopen {
        top: 20px !important;
        right: 15px !important;
        z-index: 950 !important;
    }

    .speed-gauge-container {
        right: 10px;
        bottom: 120px;
    }

    .speed-gauge-bar-wrapper {
        height: 150px;
        width: 30px;
    }

    .speed-gauge-value {
        font-size: 1.1rem;
    }

    .ol-popup {
        min-width: 160px;
        font-size: 0.85rem;
    }

    .output-section {
        display: none; /* Mobilde WFS panelini gizle */
    }
}

/* Çok küçük ekranlar */
@media (max-width: 400px) {
    .toolbar {
        width: calc(100vw - 20px);
        left: 5px;
        top: 5px;
        padding: 10px;
    }

    .btn {
        padding: 8px;
        font-size: 0.85rem;
    }
}

