/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #162343;
    color: #333;
    overflow-x: hidden;
}

/* Header Styles */
.header {
    background: #162343;
    color: #ffffff;
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header h1 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 5px;
}

.header p {
    text-align: center;
    font-size: 0.9em;
}

/* Layout Styles */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    margin-bottom: 20px;
}

.weather-panel {
    background-color: #162343;
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    max-height: 600px;
    overflow-y: auto;
    color:#fff;
}

.map-container {
    background: rgba(255, 255, 255, 0.271);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

/* Map Styles */
#weather-map {
    height: 500px;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: crosshair;
}

.click-hint {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    z-index: 1000;
    pointer-events: none;
}

/* Weather Info Styles */
.weather-info h3 {
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.location-item {
    background: rgba(52, 152, 219, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.location-item:hover {
    background: rgba(52, 152, 219, 0.2);
    transform: translateX(5px);
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.location-name {
    font-weight: bold;
    font-size: 1.1em;
}

.safety-badge {
    padding: 4px 10px;
    border-radius: 15px;
    color: white;
    font-size: 0.8em;
    font-weight: bold;
}

.safe { 
    background: #27ae60; 
}

.caution { 
    background: #f39c12; 
}

.danger { 
    background: #e74c3c; 
}

.condition-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

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

.label {
    font-weight: 600;
    font-size: 0.9em;
}

.value {
    color: #2980b9;
    font-weight: 700;
    font-size: 0.9em;
}

/* Button Styles */
.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
}

.remove-btn:hover {
    background: #c0392b;
}

.controls-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.control-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.emergency-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    animation: pulse 2s infinite;
}

.clear-button {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.compare-button {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

/* Instructions Styles */
.instructions {
    background: rgba(52, 152, 219, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.instructions h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.instructions ul {
    color: #34495e;
    padding-left: 20px;
}

.instructions li {
    margin: 5px 0;
}

/* Marker Styles */
.weather-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: white;
    cursor: pointer;
}

.marker-safe { 
    background: #27ae60; 
}

.marker-caution { 
    background: #f39c12; 
}

.marker-danger { 
    background: #e74c3c; 
}

/* Loading Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.spinner {
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading {
    text-align: center;
    padding: 20px;
}

/* Popup Styles */
.weather-popup {
    min-width: 250px;
    max-width: 300px;
}

.popup-header {
    background: #3498db;
    color: white;
    padding: 10px;
    margin: -10px -10px 10px -10px;
    border-radius: 5px 5px 0 0;
    text-align: center;
    font-weight: bold;
}

/* Comparison Styles */
.comparison-panel {
    background: rgba(155, 89, 182, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    border-left: 4px solid #9b59b6;
}

.comparison-panel h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.comparison-panel table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.comparison-panel th,
.comparison-panel td {
    padding: 8px;
    border: 1px solid #ddd;
    font-size: 0.8em;
    text-align: left;
}

.comparison-panel th {
    background: rgba(155, 89, 182, 0.1);
    font-weight: bold;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        grid-template-columns: 1fr 1fr;
    }
    
    #weather-map {
        height: 400px;
    }

    .weather-panel {
        max-height: none;
    }

    .instructions ul {
        padding-left: 15px;
    }

    .location-item {
        margin: 8px 0;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .header p {
        font-size: 0.8em;
    }

    .weather-panel,
    .map-container {
        padding: 15px;
    }

    .controls-panel {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .control-button {
        padding: 10px 12px;
        font-size: 0.8em;
    }
}
