/* ====================================
   MODERN FILTER BAR - Tek Çerçeve Tasarım
   ==================================== */

/* Ana Wrapper - Tek Çerçeve */
.map-filters-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 0;
}

/* Filtre Satırı */
.map-filters-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* Filtre Grubu - her bir filtre elemanı */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

/* Grup başlıkları */
.filter-group-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    padding-left: 1px;
    white-space: nowrap;
}

/* Dikey ayraç çizgisi */
.filter-divider {
    width: 1px;
    background: #e2e8f0;
    align-self: stretch;
    margin: 2px 2px;
    flex-shrink: 0;
}

/* Özel genişlikler */
.filter-group-geofence {
    min-width: 150px;
}

.filter-group-station {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 200px;
}

.filter-group-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Sıfırla butonu grubu - en sağa itilir */
.filter-group-reset {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* ====================================
   FILTER ELEMENTS - Select, Button, Checkbox
   ==================================== */

/* Filter Select */
.filter-select {
    padding: 6px 26px 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
    color: #334155;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 5px center;
    background-repeat: no-repeat;
    background-size: 14px;
    width: 100%;
    line-height: 1.3;
    min-width: 110px;
}

.filter-select:hover {
    border-color: #94a3b8;
    background-color: #fafbfc;
}

.filter-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.08);
}

.filter-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
}

.filter-select-sm {
    padding: 5px 22px 5px 7px;
    font-size: 11px;
    min-width: 100px;
}

.filter-select-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
}

/* Filter Checkbox */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    background: white;
    border: 1px solid #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
    line-height: 1.3;
}

.filter-checkbox:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
}

.filter-checkbox input {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* ====================================
   GEOFENCE DROPDOWN
   ==================================== */
.geofence-select-container {
    position: relative;
    width: 100%;
}

.geofence-select-wrapper {
    position: relative;
}

.geofence-dropdown-btn {
    width: 100%;
    padding: 6px 26px 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
    color: #334155;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.geofence-dropdown-btn:hover {
    border-color: #94a3b8;
    background-color: #fafbfc;
}

.geofence-dropdown-btn i {
    font-size: 8px;
    transition: transform 0.2s ease;
}

.geofence-dropdown-btn.active i {
    transform: rotate(180deg);
}

.geofence-dropdown-list {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    min-width: 180px;
}

.geofence-dropdown-list.active {
    display: block;
}

.geofence-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 11px;
    font-weight: 500;
    color: #334155;
}

.geofence-item:hover {
    background: #f1f5f9;
}

.geofence-item input[type="checkbox"] {
    width: 13px;
    height: 13px;
    cursor: pointer;
    accent-color: #10b981;
}

.geofence-item span {
    flex: 1;
    user-select: none;
}

.geofence-item .geofence-count {
    background: #e2e8f0;
    color: #475569;
    font-size: 10px;
    font-weight: 600;
    padding: 0px 3px;
    border-radius: 3px;
    text-align: center;
    line-height: 1.4;
}

/* ====================================
   BATTERY DROPDOWN
   ==================================== */
.battery-select-container {
    position: relative;
    width: 100%;
}

.battery-select-wrapper {
    position: relative;
}

.battery-dropdown-btn {
    width: 100%;
    min-width: 120px;
    padding: 6px 26px 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
    color: #334155;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.battery-dropdown-btn:hover {
    border-color: #94a3b8;
    background-color: #fafbfc;
}

.battery-dropdown-btn i {
    font-size: 8px;
    transition: transform 0.2s ease;
}

.battery-dropdown-btn.active i {
    transform: rotate(180deg);
}

.battery-dropdown-list {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
}

.battery-dropdown-list.active {
    display: block;
}

.battery-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 11px;
    font-weight: 500;
    color: #334155;
}

.battery-item:hover {
    background: #f1f5f9;
}

.battery-item.selected {
    background: #f0fdf4;
}

.battery-item span:first-child {
    flex: 1;
    user-select: none;
}

.battery-range {
    background: #e2e8f0;
    color: #475569;
    font-size: 10px;
    font-weight: 600;
    padding: 0px 3px;
    border-radius: 3px;
    text-align: center;
    line-height: 1.4;
}

/* ====================================
   ACTION BUTTONS
   ==================================== */
.filter-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    white-space: nowrap;
    line-height: 1.3;
}

.filter-action-btn i {
    font-size: 10px;
}

.filter-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.filter-action-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);
    color: white;
}

.filter-action-primary:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 50%, #4c1d95 100%);
}

.filter-action-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.filter-action-secondary:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

/* Sıfırla butonu - gri stil */
.filter-action-reset {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    padding: 6px 16px;
    font-size: 11px;
    border-radius: 6px;
}

.filter-action-reset:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

/* ====================================
   STATION FINDER
   ==================================== */

.station-layer-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    background: white;
    border: 1px solid #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
    line-height: 1.3;
    flex-shrink: 0;
}

.station-layer-toggle:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
}

.station-layer-toggle input {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #6366f1;
}

.station-row {
    display: flex;
    gap: 4px;
    align-items: stretch;
}

.station-finder-container {
    display: flex;
    gap: 4px;
    align-items: stretch;
    flex: 1;
}

.station-finder-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.station-search-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
    color: #334155;
    font-size: 11px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.3;
}

.station-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.station-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.station-search-input.station-locked {
    background: #eef2ff;
    border-color: #a5b4fc;
    color: #4338ca;
    font-weight: 600;
    padding-right: 28px;
    cursor: default;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.station-input-clear {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #a5b4fc;
    border: none;
    cursor: pointer;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
    z-index: 5;
}

.station-input-clear:hover {
    background: #6366f1;
}

.station-search-input.station-locked ~ .station-input-clear {
    display: flex;
}

.station-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 99999;
    max-height: 220px;
    overflow-y: auto;
    min-width: 200px;
}

.station-search-dropdown.active {
    display: block;
}

.station-search-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 11px;
    color: #334155;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

.station-search-item:last-child {
    border-bottom: none;
}

.station-search-item:hover,
.station-search-item.selected {
    background: #eef2ff;
    color: #4338ca;
}

.station-search-more {
    padding: 6px 10px;
    font-size: 10px;
    color: #6366f1;
    background: #f8fafc;
    text-align: center;
    font-style: italic;
    cursor: default;
    border-top: 1px solid #e2e8f0;
}

.station-search-noresult {
    padding: 8px 10px;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    font-style: italic;
}

.filter-action-station {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    min-width: auto !important;
    padding: 6px 10px;
}

.filter-action-station:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.filter-action-station:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ====================================
   RESPONSIVE
   ==================================== */

/* Tablet - 1200px and below: wrap başlasın */
@media (max-width: 1200px) {
    .map-filters-row {
        gap: 8px;
    }
    
    .filter-group-station {
        min-width: 180px;
    }
    
    .filter-divider.hidden-mobile {
        display: none;
    }
}

/* Tablet - 992px and below */
@media (max-width: 992px) {
    .map-filters-wrapper {
        padding: 8px 10px;
    }
    
    .map-filters-row {
        gap: 8px;
    }
    
    .filter-divider {
        display: none;
    }
    
    .filter-group {
        flex: 0 0 auto;
        min-width: calc(33% - 8px);
    }
    
    .filter-group-station {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .filter-group-reset {
        margin-left: 0;
    }
}

/* Mobile - 640px and below */
@media (max-width: 640px) {
    .map-filters-wrapper {
        padding: 8px;
        border-radius: 8px;
    }
    
    .map-filters-row {
        gap: 6px;
    }
    
    .filter-divider {
        display: none;
    }
    
    .filter-group {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
    }
    
    .filter-group-label {
        font-size: 9px;
    }
    
    .filter-group-station {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .filter-group-actions {
        flex: 0 0 auto;
        min-width: auto;
    }
    
    .filter-group-reset {
        margin-left: auto;
        flex: 0 0 auto;
        min-width: auto;
    }
    
    .filter-select {
        font-size: 11px;
        padding: 5px 24px 5px 8px;
        min-width: 0;
    }
    
    .filter-checkbox {
        font-size: 10px;
        padding: 5px 8px;
    }
    
    .filter-action-btn {
        font-size: 10px;
        padding: 5px 10px;
        gap: 4px;
    }
    
    .filter-action-btn i {
        font-size: 10px;
    }
    
    .station-row {
        flex-wrap: wrap;
    }
    
    .station-layer-toggle {
        font-size: 10px;
    }
}

/* Very small mobile - 420px and below */
@media (max-width: 420px) {
    .filter-group {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .filter-group-actions,
    .filter-group-reset {
        flex: 0 0 auto;
        min-width: auto;
    }
    
    .map-filters-row {
        gap: 5px;
    }
}
