/* ============================================
   CONTROLS PANEL & FILTERS
   ============================================ */

.controls-panel {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Scrollable content wrapper (for mobile sticky handle) */
.panel-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
}

.filters {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-label {
    font-size: 14px;
    color: white;
    font-weight: 500;
}

.filter-btn {
    padding: 6px 14px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.filter-btn.active {
    background: white !important;
    color: #667eea !important;
    border-color: white !important;
}

.filter-btn:hover:not(.active) {
    background: rgba(255,255,255,0.2);
}

/* Race mode toggle buttons */
.filter-btn.mode-toggle {
    font-weight: 600;
    padding: 8px 16px;
}

.filter-btn.mode-toggle.active {
    background: white !important;
    color: #667eea !important;
    border-color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Carbon budget slider */
.carbon-slider {
    width: 150px;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    outline: none;
}

.carbon-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.carbon-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.carbon-value {
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    min-width: 80px;
    text-align: center;
    transition: all 0.3s ease;
}

/* Color-coded carbon values based on impact */
.carbon-value.carbon-low {
    background: #4caf50;
    color: white;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.carbon-value.carbon-medium {
    background: #ff9800;
    color: white;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.carbon-value.carbon-high {
    background: #f44336;
    color: white;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
}

.carbon-value.carbon-unlimited {
    background: #212121;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border: 2px solid #666;
    font-weight: 700;
}

/* Disabled state - keep color but reduce opacity slightly */
.carbon-value.disabled {
    opacity: 0.7;
}

.carbon-value.disabled:not(.carbon-low):not(.carbon-medium):not(.carbon-high) {
    background: rgba(255,255,255,0.05);
    box-shadow: none;
}

/* Carbon filter checkbox */
.carbon-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4caf50;
}

.carbon-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.carbon-filter-label {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
}

.carbon-filter-label .filter-label {
    font-size: 13px;
    font-weight: 500;
}

.carbon-checkbox:disabled + .carbon-filter-label {
    cursor: not-allowed;
    opacity: 0.7;
}

.carbon-status {
    margin-top: 3px;
    text-align: left;
}

.carbon-slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.carbon-slider:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
    background: #ccc;
    border-color: #999;
}

.location-status {
    font-size: 11px;
    opacity: 0.8;
    margin-left: 10px;
}

/* Location badge and dropdown */
.location-badge-container {
    position: relative;
    display: inline-block;
}

.location-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-weight: 500;
}

.location-badge:hover {
    background: rgba(255,255,255,0.2);
}

.location-badge.home {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
}

.location-badge.search {
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.5);
}

.location-badge-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.location-badge.open .location-badge-arrow {
    transform: rotate(180deg);
}

.location-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.location-dropdown.hidden {
    display: none;
}

.location-dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    color: #333;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.location-dropdown-item:hover {
    background: #f5f5f5;
}

.location-dropdown-item:active {
    background: #e0e0e0;
}

.location-dropdown-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.location-dropdown-item:disabled:hover {
    background: white;
}

/* Time window controls (deprecated, keeping for compatibility) */
.time-window-slider {
    width: 150px;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    outline: none;
}

.time-window-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.time-window-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.time-window-value {
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    min-width: 70px;
    text-align: center;
}

.week-window {
    background: rgba(255,255,255,0.1);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: white;
}
