/* core_app/static/css/maps_dashboard.css */

/* --- Harita Kapsayıcısı --- */
.map-wrapper {
    position: relative;
    height: 85vh;
    min-height: 600px;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    background-color: #e9ecef;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* --- Sidebar (Sol Panel - Filtre Alanı) --- */
.map-sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 300px; /* Genişlik 280px'den 300px'e çıkarıldı (Dropdownlar için) */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 24px;
    border-radius: 24px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-height: 90%;
    overflow-y: auto;

    /* Modern Scrollbar - 2026 Trend: Minimal & Hidden until hover */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: transparent transparent; /* Firefox - varsayılan gizli */
}

/* Webkit (Chrome, Safari, Edge) Scrollbar Stilleri */
.map-sidebar::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

.map-sidebar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
    margin: 8px 0;
}

.map-sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: background 0.3s ease;
}

/* Hover'da scrollbar görünür */
.map-sidebar:hover {
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent; /* Firefox */
}

.map-sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

/* Aktif kaydırma sırasında daha belirgin */
.map-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.map-sidebar::-webkit-scrollbar-thumb:active {
    background: rgba(0, 0, 0, 0.35);
}

.map-sidebar.collapsed {
    transform: translateX(-360px); /* Kapanma mesafesi genişliğe göre ayarlandı */
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 800;
    color: #212529;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

/* Form Elemanları (Dropdown & Input) */
.form-select-sm, .form-control-sm {
    border-radius: 12px;
    border: 1px solid #dee2e6;
    background-color: #fff;
    padding: 10px 12px;
    font-size: 0.85rem;
    color: #495057;
    transition: all 0.2s;
}

.form-select-sm:focus, .form-control-sm:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    border-color: #0d6efd;
    background-color: #fff;
}

/* Pasif Dropdown Görünümü (İlçe/Mahalle yüklenirken) */
.form-select-sm:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    color: #adb5bd;
    border-color: #e9ecef;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #868e96;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* --- SAĞ ÜST KONTROLLER (Zoom, Stil, Konum) --- */
.custom-map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.control-divider {
    height: 1px;
    width: 20px;
    background-color: rgba(0,0,0,0.1);
    margin: 4px auto;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid white;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #495057;
    font-size: 1.2rem;
    padding: 0;
}

.control-btn:hover {
    transform: scale(1.1);
    background-color: #f8f9fa;
    color: #0d6efd;
}

.control-btn.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.zoom-text {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 1.4rem;
    line-height: 1;
    margin-top: -2px;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    top: 20px;
    left: 330px; /* Sidebar (300px) + Margin (30px) */
    z-index: 1000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #212529;
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.sidebar-toggle:hover {
    background-color: #f8f9fa;
}

.map-sidebar.collapsed + .sidebar-toggle {
    left: 20px; /* Sidebar kapandığında sola yasla */
}

/* Legend (Lejant) */
.map-legend {
    position: absolute;
    bottom: 30px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 900;
    font-size: 0.85rem;
}

.legend-item { display: flex; align-items: center; margin-bottom: 8px; font-weight: 600; color: #343a40; }
.legend-item:last-child { margin-bottom: 0; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; margin-right: 12px; box-shadow: 0 0 0 2px rgba(255,255,255,0.8); }

/* Loader (Yükleniyor Ekranı) */
#map-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: rgba(255,255,255,0.98);
    padding: 20px 40px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    font-weight: 700;
    color: #212529;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
}

/* MapLibre Popup Özelleştirmesi (Minimal) */
.maplibregl-popup {
    z-index: 1005;
}

.maplibregl-popup-content {
    border-radius: 12px;
    padding: 0; /* İçerik padding'i HTML'den gelecek */
    box-shadow: 0 12px 36px rgba(0,0,0,0.15);
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
}

.maplibregl-popup-close-button {
    font-size: 1.2rem;
    padding: 5px 10px;
    color: #6c757d;
    z-index: 10;
    outline: none;
}
.maplibregl-popup-close-button:hover {
    color: #000;
    background: none;
}

/* MapLibre Default Kontrolleri Gizle (Custom kullanıyoruz) */
.maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-top-right,
.maplibregl-ctrl-top-left {
    display: none !important;
}

/* Mobil İyileştirme */
@media (max-width: 768px) {
    .map-wrapper { height: 80vh; min-height: 520px; border-radius: 16px; }
    .map-sidebar { width: 260px; top: 10px; left: 10px; bottom: 10px; max-height: none; }
    .sidebar-toggle { left: 280px; top: 10px; }
    .custom-map-controls { top: 10px; right: 10px; }
    .map-legend { bottom: 20px; right: 10px; }
}

/* core_app/static/css/maps_dashboard.css dosyasına ekleyin */

/* Harita Popup İyileştirmeleri */
.maplibregl-popup-content {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0;
    overflow: hidden;
}

.maplibregl-popup-close-button {
    font-size: 1.2rem;
    color: #666;
    padding: 4px 8px;
    z-index: 10;
}

/* Seçim Modu Butonu (Aktif Hal) */
#btnSelectMode.active {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
}

/* Action Bar Animasyonu */
#selectionActionBar {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* Delta Badge (Bildirim Rozeti) */
#globalDeltaBadge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Bulanıklaştırma Efekti (Teaser) */
.blur-text {
    color: transparent;
    text-shadow: 0 0 8px rgba(0,0,0,0.5);
    user-select: none;
}

/* Harita Marker'larını Zorla Boyutlandır */
.maplibregl-marker, 
.mapboxgl-marker {
    max-width: 40px !important;
    max-height: 40px !important;
    width: 40px !important;
    height: 40px !important;
    overflow: visible !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
}

/* Marker içindeki resimleri kapsayıcıya sığdır */
.maplibregl-marker img, 
.mapboxgl-marker img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    max-width: 40px !important; /* Garanti olsun */
    max-height: 40px !important;
}