:root {
    --dump-santos-red: #ff3333;
    --dump-santos-orange: #ff6600;
    --sustainable-green: #2ecc71;
    --unknown-gray: #95a5a6;
    --bg-color: #f8f9fa;
    --text-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

header {
    background: linear-gradient(135deg, var(--dump-santos-red), var(--dump-santos-orange));
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.controls {
    background: white;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.stage-selector h3,
.filter-controls h3 {
    margin-bottom: 10px;
    font-size: 1rem;
}

/* Desktop/Mobile responsive classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Desktop: horizontal stage buttons */
.stage-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stage-btn {
    background: #e0e0e0;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.stage-btn:hover {
    background: #d0d0d0;
}

.stage-btn.active {
    background: var(--dump-santos-orange);
    color: white;
}

/* Mobile: dropdown */
.stage-dropdown {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.3s ease;
}

.stage-dropdown:hover {
    border-color: var(--dump-santos-orange);
}

.stage-dropdown:focus {
    outline: none;
    border-color: var(--dump-santos-orange);
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.2);
}

.filter-controls label {
    display: block;
    margin: 5px 0;
    cursor: pointer;
}

.filter-controls input[type="checkbox"] {
    margin-right: 8px;
}

#map {
    height: 500px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.info-panel {
    background: white;
    padding: 20px;
    margin: 20px auto;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.info-panel h3 {
    margin-bottom: 10px;
    color: var(--dump-santos-orange);
}

.business-list {
    height: 50vh;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
}

.business-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.business-item:hover {
    background-color: #f8f9fa;
}

.business-item.expanded {
    background-color: #fff5f0;
    border-left: 4px solid var(--dump-santos-orange);
}

.business-name {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.business-address {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.business-stage {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.business-details {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.business-item.expanded .business-details {
    display: block;
}

.sustainability-info {
    margin-bottom: 10px;
}

.verification-link {
    display: inline-block;
    margin-top: 8px;
}

.verification-link a {
    color: var(--sustainable-green);
    text-decoration: none;
    font-size: 0.9rem;
}

.verification-link a:hover {
    text-decoration: underline;
}

.business-info {
    margin-top: 15px;
}

.business-info h4 {
    color: var(--text-color);
    margin-bottom: 5px;
}

.business-info p {
    margin: 5px 0;
}

.sustainability-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-top: 10px;
}

.sustainability-badge.known {
    background: var(--sustainable-green);
    color: white;
}

.sustainability-badge.unknown {
    background: var(--unknown-gray);
    color: white;
}

footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

footer a {
    color: var(--dump-santos-orange);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Map filter toggle */
.map-filter-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.1);
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.toggle-switch input {
    display: none;
}

.slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--unknown-gray);
    border-radius: 12px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.slider:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* When checked (showing verified sustainable) */
.toggle-switch input:checked + .slider {
    background: var(--sustainable-green);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
}

.toggle-label {
    color: var(--text-color);
    user-select: none;
}

/* Compact toggle switch in header */
.compact-toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
}

.compact-toggle-switch input {
    display: none;
}

.compact-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.compact-slider:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* When checked (showing only verified sustainable) */
.compact-toggle-switch input:checked + .compact-slider {
    background: rgba(46, 204, 113, 0.8);
}

.compact-toggle-switch input:checked + .compact-slider:before {
    transform: translateX(16px);
}

.compact-toggle-label {
    color: white;
    user-select: none;
    white-space: nowrap;
}

/* Custom marker styles */
.leaflet-marker-icon.sustainable-marker {
    background: var(--sustainable-green);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.leaflet-marker-icon.unknown-marker {
    background: var(--unknown-gray);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    /* Switch to mobile layout */
    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    #map {
        height: 400px;
    }
}