* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0f;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

/* Main Layout */
.app-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: 60px 1fr;
    height: 100vh;
    grid-template-areas: 
        "header header"
        "sidebar map";
}

/* Header */
.app-header {
    grid-area: header;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #64b5f6;
    text-shadow: 0 0 10px rgba(100, 181, 246, 0.5);
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-input {
    flex: 1;
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #64b5f6;
    box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(23, 63, 100, 0.233);
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: rgba(100, 181, 246, 0.2);
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: linear-gradient(180deg, #1a1a2e, #16213e);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.layer-controls {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.layer-group {
    margin-bottom: 25px;
}

.layer-group h3 {
    font-size: 14px;
    font-weight: 600;
    color: #64b5f6;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 2px 0;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.layer-item.active {
    background: rgba(100, 181, 246, 0.2);
    border-left: 3px solid #64b5f6;
}

.layer-switch {
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    position: relative;
    transition: background 0.3s;
}

.layer-switch.active {
    background: #64b5f6;
}

.layer-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.layer-switch.active::after {
    transform: translateX(20px);
}

/* Weather Info Panel */
.weather-info {
    padding: 20px;
    flex: 1;
}

.current-weather {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

.temperature {
    font-size: 2.5rem;
    font-weight: 700;
    color: #64b5f6;
    margin-bottom: 5px;
}

.weather-desc {
    font-size: 16px;
    opacity: 0.8;
    margin-bottom: 15px;
}

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 13px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Map Container */
.map-container {
    grid-area: map;
    position: relative;
    background: #0a0a0f;
}

#weatherMap {
    width: 100%;
    height: 100%;
    background: #0a0a0f;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 40px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-panel {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;

    margin-top: 40px; 
}


.time-slider {
    width: 100%;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.time-slider input[type="range"] {
    width: 100%;
    height: 8px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
}

.time-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #64b5f6;
    border-radius: 50%;
    cursor: pointer;
}

.play-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.play-btn {
    background: #64b5f6;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.play-btn:hover {
    background: #42a5f5;
    transform: scale(1.1);
}

/* Legend */
.legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.legend-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #64b5f6;
}

.legend-scale {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.legend-color {
    width: 20px;
    height: 12px;
    border-radius: 2px;
}

/* Loading States */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(100, 181, 246, 0.3);
    border-top: 3px solid #64b5f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: 60px 200px 1fr;
        grid-template-areas: 
            "header"
            "sidebar"
            "map";
    }

    .sidebar {
        max-height: 200px;
        overflow-y: auto;
    }

    .search-container {
        max-width: 250px;
    }

    .control-panel {
        min-width: 150px;
        padding: 10px;
    }
}

/* Custom Leaflet Styling */
.leaflet-control-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaflet-popup-content {
    color: white;
    margin: 15px;
}

.leaflet-popup-tip {
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Weather Popup */
.weather-popup {
    text-align: center;
    min-width: 200px;
}

.popup-temperature {
    font-size: 1.5rem;
    font-weight: bold;
    color: #64b5f6;
    margin-bottom: 5px;
}

.popup-description {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.popup-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12px;
    text-align: left;
}

.popup-detail {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}