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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    overflow: hidden;
}

/* Full screen map */
#map {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Title bar at top center - Neumorphic Style */
.title-bar {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: #e8e8e8;
    padding: 10px 25px;
    border-radius: 10px;
    box-shadow: 6px 6px 12px #c5c5c5, -6px -6px 12px #ffffff;
    z-index: 1000;
    border: 1px solid #e8e8e8;
    max-width: fit-content;
    transition: all 0.3s;
}

.title-bar:hover {
    box-shadow: 8px 8px 16px #c5c5c5, -8px -8px 16px #ffffff;
}

.title-bar h1 {
    font-size: 1.1rem;
    color: #090909;
    font-weight: 600;
    text-align: center;
    margin: 0 0 6px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.title-bar .subtitle {
    font-size: 0.65rem;
    color: #555;
    font-weight: 400;
    text-align: center;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.2px;
    opacity: 0.85;
    display: block;
    width: 100%;
}

/* Floating panels base style - Glassmorphism */
.floating-panel {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    z-index: 1000;
}

/* Layer Controls Panel (left side) */
.layer-panel {
    top: 100px;
    left: 15px;
    padding: 18px 22px;
    max-width: 250px;
}

/* Risk Assessment Button Panel (right side) */
.risk-button-panel {
    top: 100px;
    right: 15px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.risk-toggle-btn {
    background: #e8e8e8;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #090909;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 6px 6px 12px #c5c5c5, -6px -6px 12px #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.risk-toggle-btn:hover {
    box-shadow: 8px 8px 16px #c5c5c5, -8px -8px 16px #ffffff;
    transform: translateY(-2px);
}

.risk-toggle-btn:active {
    box-shadow: inset 4px 4px 12px #c5c5c5, inset -4px -4px 12px #ffffff;
    transform: translateY(0);
}

.risk-toggle-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Statistics Panel (top right) */
.stats-panel {
    top: 15px;
    right: 15px;
    padding: 15px 20px;
    min-width: 240px;
}

.stats-panel h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #1a1a1a;
    font-weight: 700;
    border-bottom: 2px solid rgba(102, 126, 234, 0.6);
    padding-bottom: 8px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.stat-label {
    font-size: 0.85rem;
    color: #444;
    font-weight: 500;
}

.stat-value {
    font-size: 0.9rem;
    color: #1a1a1a;
    font-weight: 700;
    text-align: right;
}

.layer-panel h3 {
    font-size: 1.05rem;
    margin-bottom: 14px;
    color: #1a1a1a;
    font-weight: 700;
    border-bottom: 2px solid rgba(102, 126, 234, 0.6);
    padding-bottom: 10px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.layer-control label {
    display: flex;
    align-items: center;
    padding: 9px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.layer-control label:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(3px);
}

.layer-control input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 17px;
    height: 17px;
}

.layer-label {
    font-size: 0.92rem;
    color: #1a1a1a;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* Legend Panel (bottom center) */
.legend-panel {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
}

.legend-row {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin: 4px 0;
}

.legend-row:first-child {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-items {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-separator {
    width: 2px;
    height: 30px;
    background: rgba(0, 0, 0, 0.2);
    margin: 0 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #1a1a1a;
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

.legend-symbol {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Specific legend symbols */
.landfall-symbol {
    background: #dc2626;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

.track-symbol {
    background: #1e40af;
    width: 30px;
    height: 3px;
    border-radius: 2px;
    border: none;
}

.wind-64-symbol {
    background: #850E35;
    opacity: 0.85;
}

.wind-50-symbol {
    background: #EE6983;
    opacity: 0.85;
}

.wind-34-symbol {
    background: #FFC4C4;
    opacity: 0.85;
}

/* Loading indicator */
#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 25px 45px;
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    font-size: 1.05rem;
    color: #1a1a1a;
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
    z-index: 2000;
}

/* Popup styling */
.leaflet-popup-content {
    margin: 12px;
    font-size: 0.9rem;
}

.popup-content h4 {
    margin-bottom: 8px;
    color: #667eea;
    font-size: 1rem;
}

.popup-content p {
    margin: 5px 0;
    color: #555;
    line-height: 1.5;
}

.popup-content strong {
    color: #333;
}

/* Responsive design */
@media (max-width: 768px) {
    .title-bar h1 {
        font-size: 1rem;
    }
    
    .layer-panel {
        max-width: 200px;
        padding: 12px 15px;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .legend-panel {
        bottom: 10px;
        left: 10px;
        transform: none;
    }
}
