/* Filtreler: açılır çoklu seçim, Filtrele / Temizle düğmeleri ve tarih kaydırıcısı. Tek kaynak: risk haritası, ısı haritası, grafikler, hava durumu,
   İstasyonlar ve istasyon detay sayfaları kullanır (Views/Shared/_MultiSelectFilter, _DateFilterAndActions; filter-dropdowns.js, station-common.js).
   Filtre panelinin boyu / kaydırması ve sayfaya özgü farklar (or. grafiklerdeki üst çubuk) sayfalarda. */

/* Açılır çoklu seçim */
.filter-dropdown { position: relative; }
.filter-select-box {
    width: 100%; padding: 0 16px; border-radius: 12px; color: #1e293b; font-size: 0.95rem; font-weight: 600; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); user-select: none;
    height: 46px; box-sizing: border-box; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-top: 4px; border: 2px solid transparent; background-clip: padding-box; background-color: #fff;
}
.filter-select-box:hover { border-color: #cbd5e1; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.filter-select-box.active { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,0.1); }
.filter-select-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: left; color: #334155; text-transform: capitalize; }
.filter-select-box .badge { background: #3b82f6; color: #ffffff; border-radius: 20px; padding: 2px 10px; font-size: 0.75rem; font-weight: 800; margin: 0 8px; box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25); }
.filter-select-box svg { color: #94a3b8; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.filter-select-box.active svg { transform: rotate(180deg); color: #3b82f6; }

.filter-options-popup {
    position: absolute; top: calc(100% + 10px); left: 0; width: 100%; min-width: 240px;
    background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(226, 232, 240, 0.8); border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -6px rgba(0,0,0,0.04);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 1050; max-height: 320px; overflow-y: auto; display: none; flex-direction: column; padding: 10px 0;
    text-align: left; border-top: 1px solid rgba(255,255,255,0.5);
}
.filter-options-popup::-webkit-scrollbar { width: 5px; }
.filter-options-popup::-webkit-scrollbar-thumb { background-color: #e2e8f0; border-radius: 10px; }
.filter-options-popup.show { display: flex; animation: premiumFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.filter-options-popup.show.open-up { top: auto; bottom: calc(100% + 10px); animation: premiumFadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes premiumFadeIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes premiumFadeInUp {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.filter-option-item {
    padding: 10px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer;
    font-size: 0.92rem; color: #475569; transition: all 0.2s; margin: 2px 8px; border-radius: 8px;
    animation: staggerItem 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--delay, 0s);
}
@keyframes staggerItem {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}
.filter-option-item:hover { background: #f1f5f9; color: #0f172a; }
.filter-option-item span { text-transform: capitalize; }

/* Onay kutusu */
/* Onay kutusu görünmez ama erişilebilir (display:none klavyeyle seçilemiyordu): Tab ile gelinir, Boşluk ile işaretlenir; görünen kutu .custom-cb */
.filter-option-item { position: relative; }
.filter-option-item input[type="checkbox"] { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.filter-option-item input[type="checkbox"]:focus-visible + .custom-cb { outline: 2px solid #3b82f6; outline-offset: 2px; }
.filter-select-box:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.custom-cb { width: 20px; height: 20px; border: 2px solid #cbd5e1; border-radius: 6px; position: relative; transition: all 0.2s; flex-shrink: 0; background: #fff; }
.filter-option-item input[type="checkbox"]:checked + .custom-cb { background-color: #3b82f6; border-color: #3b82f6; transform: scale(1.05); box-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }
.custom-cb::after {
    content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
    border: solid white; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.filter-option-item input[type="checkbox"]:checked + .custom-cb::after { transform: rotate(45deg) scale(1); }

/* Seçeneklerdeki simgeler: böcek / bitki resmi (24 x 24), ülke bayrağı */
.opt-icon { width: 24px; height: 24px; flex-shrink: 0; border-radius: 6px; object-fit: contain; background: #f8fafc; padding: 2px; border: 1px solid #e2e8f0; }
.opt-flag { font-size: 1.2rem; line-height: 1; width: 24px; text-align: center; }

/* Filtrele / Temizle */
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; width: 100%; }
.modern-btn {
    height: 40px; padding: 0 12px; border-radius: 10px; font-weight: 600; font-size: 0.85rem; display: flex; align-items: center; justify-content: center;
    gap: 6px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; border: none; flex: 1; white-space: nowrap;
}
.btn-apply { background: #3b82f6; color: white; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.btn-apply:hover { background: #2563eb; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4); }
.btn-clear { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-clear:hover { background: #e2e8f0; color: #1e293b; transform: translateY(-2px); }
.modern-btn svg { transition: transform 0.3s ease; flex-shrink: 0; }

/* Tarih kaydırıcısı: risk haritası görünümündeki kuralların aynısı (tarih balonu yalnızca tutamaçta / sürüklerken) */
.noUi-target .noUi-tooltip {
    background: #3b82f6 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    padding: 3px 8px !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 6px rgba(59,130,246,0.35) !important;
    bottom: 150% !important;
    /* Hover'da gözüksün */
    opacity: 0 !important;
    transition: opacity 0.2s ease-in-out !important;
    pointer-events: none !important;
    display: block !important;
}
.noUi-target .noUi-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #3b82f6;
}
/* Hover veya sürükleme sırasında */
.noUi-handle:hover .noUi-tooltip,
.noUi-handle:active .noUi-tooltip,
.noUi-active .noUi-tooltip {
    opacity: 1 !important;
}
/* Tutamaç (Handle) Tasarımı: Daha Küçük (16px) */
.noUi-horizontal .noUi-handle {
    width: 16px !important;
    height: 16px !important;
    right: -8px !important;
    top: -6px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 1px solid #3b82f6 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    cursor: pointer !important;
}
.noUi-handle::before,
.noUi-horizontal .noUi-handle::after {
    display: none !important;
}
.noUi-horizontal {
    height: 6px !important;
    border: none !important;
    background: #e2e8f0 !important;
    border-radius: 3px !important;
    margin: 10px 0;
}
.noUi-connect {
    background: #10b981 !important;
}
