/* Map Filter Panel Styles */
.filter-control {
    position: relative;
    z-index: 1000;
    /* Ensure proper event handling */
    pointer-events: auto;
}

/* Prevent map events from filter panel */
#map-filter-panel {
    pointer-events: auto;
    /* Touch-specific behavior */
    touch-action: pan-y;
}

#map-filter-panel * {
    pointer-events: auto;
    touch-action: manipulation;
}

/* Filter content should handle its own touch events */
#filter-content {
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.filter-control h4 {
    user-select: none;
    cursor: default;
}

.filter-group {
    position: relative;
}

.filter-group label {
    user-select: none;
    cursor: default;
}

.filter-control select,
.filter-control input {
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-control select:focus,
.filter-control input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.filter-control button {
    transition: all 0.2s ease;
    font-weight: 500;
}

.filter-control button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.filter-control button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Filter stats animations */
.filter-stats {
    transition: all 0.3s ease;
}

/* Custom scrollbar for filter panel if content overflows */
.filter-content {
    max-height: 60vh; /* Use viewport height for better mobile experience */
    min-height: 200px;
    overflow-y: auto;
    /* Prevent map interaction */
    pointer-events: auto;
    /* Touch scrolling for mobile */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    /* Smooth scrolling */
    scroll-behavior: smooth;
}

/* Ensure all elements within filter panel stop event propagation */
.filter-content *, 
.filter-content select, 
.filter-content input, 
.filter-content button {
    pointer-events: auto;
    /* Allow touch interaction */
    touch-action: manipulation;
}

.filter-content::-webkit-scrollbar {
    width: 6px;
}

.filter-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Quick filter buttons (for potential addition) */
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 8px 0;
}

.quick-filter-btn {
    padding: 4px 8px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 12px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
}

.quick-filter-btn:hover {
    background: #dee2e6;
    border-color: #adb5bd;
}

.quick-filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Enhanced mobile touch support */
.form-control, 
.btn,
.leaflet-control-custom select,
.leaflet-control-custom input {
    /* Ensure proper touch targets (minimum 44px) */
    min-height: 44px;
    /* Prevent zoom on focus for mobile */
    font-size: 16px;
    /* Better touch response */
    touch-action: manipulation;
}

/* Touch-optimized checkboxes and radio buttons */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.125em;
    touch-action: manipulation;
}

/* Better spacing for touch interfaces */
.form-group {
    margin-bottom: 1rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-actions button {
        margin-bottom: 4px;
    }
    
    /* Mobile-specific adjustments */
    .filter-content {
        max-height: 65hv; /* Reduce height on smaller screens */
        padding: 0.75rem;
    }
    
    /* Larger touch targets for mobile */
    .btn {
        min-height: 48px;
        padding: 0.75rem 1rem;
    }
    
    /* Better form spacing */
    .form-group {
        margin-bottom: 1.25rem;
    }
}

/* Animation for filter panel show/hide */
.filter-content {
    transition: all 0.3s ease;
    overflow: auto;
}

.filter-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Status indicators in filter stats */
.filter-stats .status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.filter-stats .status-online {
    background: #28a745;
}

.filter-stats .status-offline {
    background: #dc3545;
}

.filter-stats .status-unknown {
    background: #ffc107;
}
