:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 10px;
}

/* Dark mode colors - will be applied with a class on the body */
.dark-mode {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --text-color: #ecf0f1;
    --text-light: #bdc3c7;
    --bg-color: #2c3e50;
    --card-bg: #34495e;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Base styles */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    margin-bottom: 5px;
    color: var(--text-color);
}

.timestamp {
    color: var(--text-light);
    font-size: 0.9em;
    margin-top: 0;
}

.location-form {
    margin-top: 15px;
}

.location-form form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.location-form input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.location-form button {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.location-form button:hover {
    background-color: var(--secondary-color);
}

/* Weather message styles */
.weather-message {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    font-size: 1.1em;
    transition: all 0.3s ease;
}

/* Weather details styles */
.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.weather-item {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.weather-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.weather-item h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--text-light);
    text-transform: uppercase;
}

.weather-item p {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-color);
}

.weather-item i {
    font-size: 2em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* Special styling for AQI icon */
.weather-item.aqi-good i,
.weather-item.aqi-fair i,
.weather-item.aqi-moderate i,
.weather-item.aqi-poor i,
.weather-item.aqi-very-poor i {
    position: relative;
    font-size: 2.2em;
    transition: all 0.3s ease;
}

.weather-item.aqi-good i {
    color: #00e400;
}

.weather-item.aqi-fair i {
    color: #92d050;
}

.weather-item.aqi-moderate i {
    color: #ffff00;
}

.weather-item.aqi-poor i {
    color: #ff7e00;
}

.weather-item.aqi-very-poor i {
    color: #ff0000;
}

/* Loading indicator */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

/* Refresh button */
.refresh-container {
    text-align: center;
    margin-bottom: 30px;
}

.refresh-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.refresh-button:hover {
    background-color: var(--secondary-color);
}

.refresh-button i {
    margin-right: 5px;
}

.refresh-note {
    margin-top: 5px;
    font-size: 0.8em;
    color: var(--text-light);
}

/* Footer styles */
footer {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9em;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .weather-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .location-form input,
    .location-form button {
        width: 100%;
    }
}

/* Weather condition specific styles */
.condition-clear {
    background-color: rgba(241, 196, 15, 0.1);
}

.condition-clouds {
    background-color: rgba(189, 195, 199, 0.1);
}

.condition-rain {
    background-color: rgba(52, 152, 219, 0.1);
}

.condition-snow {
    background-color: rgba(236, 240, 241, 0.3);
}

.condition-thunderstorm {
    background-color: rgba(142, 68, 173, 0.1);
}

.condition-fog {
    background-color: rgba(189, 195, 199, 0.2);
}

.condition-haze {
    background-color: rgba(229, 152, 102, 0.1);
}

.condition-dust {
    background-color: rgba(210, 180, 140, 0.2);
}

/* Air quality specific styles */
.weather-item.aqi-good h3,
.weather-item.aqi-fair h3,
.weather-item.aqi-moderate h3,
.weather-item.aqi-poor h3,
.weather-item.aqi-very-poor h3 {
    margin-bottom: 5px;
}

.weather-item.aqi-good small,
.weather-item.aqi-fair small,
.weather-item.aqi-moderate small,
.weather-item.aqi-poor small,
.weather-item.aqi-very-poor small {
    display: block;
    font-size: 0.7em;
    color: var(--text-light);
    margin-top: 4px;
}

/* AQI specific styles */
.aqi-good {
    /* No special border or background */
}

.aqi-moderate {
    /* No special border or background */
}

.aqi-poor {
    /* No special border or background */
}

.aqi-very-poor {
    /* No special border or background */
}

.aqi-hazardous {
    /* No special border or background */
}

/* AQI color indicators for main display */
.aqi-good-indicator, 
.aqi-fair-indicator, 
.aqi-moderate-indicator, 
.aqi-poor-indicator, 
.aqi-very-poor-indicator,
.aqi-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.aqi-good-indicator, .aqi-good .aqi-indicator {
    background-color: #00e400;
}

.aqi-moderate-indicator, .aqi-moderate .aqi-indicator {
    background-color: #ffff00;
}

.aqi-poor-indicator, .aqi-poor .aqi-indicator {
    background-color: #ff7e00;
}

.aqi-very-poor-indicator, .aqi-very-poor .aqi-indicator {
    background-color: #ff0000;
}

.aqi-hazardous-indicator, .aqi-hazardous .aqi-indicator {
    background-color: #7e0023;
}

.weather-item details {
    margin-top: 10px;
    font-size: 0.85em;
    text-align: left;
}

/* AQI value styling */
.weather-item[class*="aqi-"] p {
    font-weight: 400;
    font-size: 1em;
}

.weather-item[class*="aqi-"] p strong {
    font-weight: 700;
    font-size: 1.25em;
}

.weather-item[class*="aqi-"] i {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.weather-item[class*="aqi-"] {
    /* Use regular styling like other cards */
}

.weather-item details summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 8px;
}

.weather-item details p {
    padding: 8px 0;
    font-size: 0.95em;
    font-weight: normal;
    line-height: 1.4;
}

/* Animation for refresh icon */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.refreshing {
    animation: spin 1s linear infinite;
}

/* Loading states */
.loading-message {
    color: var(--primary-color);
    font-style: italic;
    text-align: center;
    padding: 20px;
    font-size: 1.1em;
}

.loading-message i {
    margin-right: 8px;
    color: var(--accent-color);
}

.error-message {
    color: var(--accent-color);
    font-style: italic;
    text-align: center;
    padding: 20px;
    font-size: 1.1em;
}

.error-message i {
    margin-right: 8px;
    color: var(--accent-color);
}

.loading i {
    margin-right: 8px;
    color: var(--primary-color);
}

/* FontAwesome animations */
.fa-spin {
    animation: fa-spin 2s infinite linear;
}

.fa-pulse {
    animation: fa-pulse 1s infinite;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(359deg);
    }
}

@keyframes fa-pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}
