/* Reset some basic elements for consistency */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Background and typography settings */
body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

/* Main container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Headings */
h1 {
    color: #34495e;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h2,
h3,
h4 {
    color: #34495e;
    margin-bottom: 20px;
    font-weight: 600;
}

h2 {
    font-size: 2em;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
    margin-bottom: 25px;
}

h3 {
    font-size: 1.5em;
    color: #34495e;
}

/* Form styles */
form {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    gap: 15px;
    flex-wrap: wrap;
    position: relative;
    z-index: 9999;
}

.search-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    align-items: flex-start;
}

.input-wrapper {
    position: relative;
    flex: 1;
    min-width: 300px;
}

input[type="text"] {
    padding: 15px 20px;
    font-size: 1.1em;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    width: 100%;
    min-width: 300px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    height: 52px; /* Fixed height to match button */
    box-sizing: border-box;
}

input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    background-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

input[type="text"].searching {
    border-color: #f39c12;
    background-color: #fffbf0;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.15);
}

input[type="text"].searching::after {
    content: "🔍";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    animation: pulse 1.5s infinite;
}

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

button {
    padding: 15px 20px;
    font-size: 1.1em;
    color: #fff;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    height: 52px; /* Match input height exactly */
    white-space: nowrap;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0; /* Ensure no top margin */
    vertical-align: top; /* Align to top */
}

/* Specific styling for the search button to ensure perfect alignment */
.search-container button {
    line-height: 1;
    margin: 0;
    padding: 15px 20px;
    height: 52px;
    border: none;
    outline: none;
}

button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

button:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    margin: 30px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #808080;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-indicator p {
    color: #7f8c8d;
    font-size: 1.2em;
    margin: 0;
    font-weight: 500;
}

/* Error Messages */
.error-message {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    margin: 30px 0;
    text-align: center;
    font-weight: 600;
}

/* Typing Indicator */
.typing-indicator {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #ffffff;
    padding: 15px 25px;
    border-radius: 12px;
    margin: 30px 0;
    text-align: center;
    font-weight: 500;
    font-size: 1.1em;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* City Suggestions */
.city-suggestions {
    margin: 30px 0;
}

.city-suggestions h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 700;
    text-align: center;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.city-suggestion {
    background: #ffffff;
    border: 1px solid #ecf0f1;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.city-suggestion:hover {
    transform: translateY(-3px);
    border-color: #3498db;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
    background: #f8f9fa;
}

.suggestion-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.suggestion-country {
    font-size: 0.9em;
    color: #7f8c8d;
    font-weight: 500;
}

.no-results {
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    color: #2c3e50;
    padding: 20px;
    border-radius: 12px;
    margin: 30px 0;
    text-align: center;
    font-weight: 500;
    font-size: 1.1em;
}

/* City Suggestions Dropdown */
.city-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

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

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

.suggestion-item .suggestion-name {
    font-size: 1em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.suggestion-item .suggestion-country {
    font-size: 0.8em;
    color: #7f8c8d;
    font-weight: 500;
}

/* Astronomy Section */
.astronomy-section {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #ecf0f1;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.astronomy-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 700;
    text-align: center;
}

.astronomy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.astronomy-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #ecf0f1;
}

.astronomy-item:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.astronomy-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.astronomy-label {
    color: #7f8c8d;
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 5px;
}

.astronomy-value {
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 700;
}

/* Hourly Forecast Section */
.hourly-forecast-section {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #ecf0f1;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.hourly-forecast-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 700;
    text-align: center;
}

.hourly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.hourly-grid .hour-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #ecf0f1;
}

.hourly-grid .hour-item:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.hourly-grid .hour-time {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1em;
    margin-bottom: 8px;
}

.hourly-grid .hour-icon img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.hourly-grid .hour-temp {
    font-size: 1.2em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.hourly-grid .hour-condition {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 500;
}

.hourly-grid .hour-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.7em;
    color: #34495e;
}

.hourly-grid .hour-details div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Weather results */
.weather-results {
    margin-top: 30px;
    text-align: left;
}

.weather-results h2 {
    font-size: 2em;
}

/* Location Info */
.location-info {
    margin-bottom: 30px;
    padding: 20px;
    padding-right: 320px; /* Make room for the map */
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 120px;
}

.location-details {
    flex: 1;
    text-align: left;
}

.city-map {
    width: 300px;
    height: 100%;
    min-height: 120px;
    border-radius: 0 12px 12px 0;
    overflow: hidden;
    flex-shrink: 0;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
}

/* Responsive design for location info */
@media (max-width: 768px) {
    .location-info {
        flex-direction: column;
        text-align: center;
        padding-right: 20px;
        padding-bottom: 220px;
    }
    
    .location-details {
        text-align: center;
    }
    
    .city-map {
        width: 100%;
        height: 200px;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 0 0 12px 12px;
    }
}

.location-info h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.2em;
    font-weight: 700;
}

.location-details {
    color: #7f8c8d;
    font-size: 1.1em;
    font-weight: 500;
}

.location-details span {
    margin: 0 10px;
}

/* Current Conditions */
.current-conditions {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #ecf0f1;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.main-weather {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
}

.weather-icon img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
}

.temperature-info {
    text-align: center;
}

.current-temp {
    font-size: 3.5em;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
}

.feels-like {
    font-size: 1.2em;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 500;
}

.condition-text {
    font-size: 1.3em;
    color: #2c3e50;
    font-weight: 600;
}

/* Weather Metrics Grid */
.weather-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.weather-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #ecf0f1;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    cursor: help;
}

.weather-item:hover {
    transform: translateY(-3px);
    background: #ffffff;
    border-color: #3498db;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
}

.metric-label {
    color: #7f8c8d;
    font-size: 0.9em;
    font-weight: 500;
}

.metric-value {
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

/* Forecast Details */
.forecast-details {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #ecf0f1;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.forecast-details h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 700;
    text-align: center;
}

.forecast-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.forecast-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #ecf0f1;
    text-align: center;
    transition: all 0.3s ease;
}

.forecast-item:hover {
    transform: translateY(-3px);
    background: #ffffff;
    border-color: #3498db;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
}

.forecast-label {
    color: #7f8c8d;
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 8px;
}

.forecast-value {
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 700;
}

/* Weather Metrics Grid - Updated styles above */

/* Custom Tooltip Styles */
.weather-item {
    position: relative;
}

.weather-item[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.weather-item[data-tooltip]:hover::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
    margin-bottom: -5px;
}

.weather-item[data-tooltip]::after {
    content: "ℹ️";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    opacity: 0.7;
}

.weather-item strong {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1em;
}

.weather-item img {
    vertical-align: middle;
    margin-left: 15px;
    border-radius: 8px;
}

/* Enhanced Chart container */
.chart-container {
    width: 100%;
    height: 500px;
    margin: 40px 0;
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    border: 1px solid #ecf0f1;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 16px 16px 0 0;
}

/* Alerts Section */
.alerts-section {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
    border-radius: 15px;
}

.alerts-section h3 {
    color: #856404;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 700;
}

.alert-item {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid;
    transition: all 0.3s ease;
}

.alert-item:hover {
    transform: translateX(5px);
}

.alert-item.extreme {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-item.severe {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-left-color: #ffc107;
    color: #856404;
}

.alert-item.moderate {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border-left-color: #17a2b8;
    color: #0c5460;
}

.alert-item.minor {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-left-color: #28a745;
    color: #155724;
}

.alert-item h4 {
    margin-bottom: 15px;
    font-size: 1.3em;
    color: inherit;
    font-weight: 700;
}

.alert-item p {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 1em;
}

.alert-item strong {
    font-weight: 700;
    color: inherit;
}

.forecast-day {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    margin-top: 30px;
    border-radius: 15px;
    border: 1px solid #e1e8ed;
}

.hourly-forecast {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.hourly-forecast .hour {
    padding: 15px;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.hourly-forecast .hour:hover {
    transform: translateY(-3px);
    border-color: #808080;
}

/* Random Cities Landing Page */
.random-cities-section {
    margin: 30px 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Load Random Cities Button */
.load-random-cities-btn {
    text-align: center;
    margin: 20px 0;
}

.show-random-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.show-random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.random-cities-section h2 {
    color: #2c3e50;
    font-size: 2.2em;
    margin-bottom: 10px;
    border-bottom: none;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 30px;
    font-weight: 400;
}

.random-cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.city-card {
    background: #ffffff;
    border: 1px solid #ecf0f1;
    border-radius: 16px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.city-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 16px 16px 0 0;
}

.city-card:hover {
    transform: translateY(-5px);
    border-color: #3498db;
    box-shadow: 0 12px 40px rgba(52, 152, 219, 0.2);
}

.city-card-header {
    text-align: center;
    margin-bottom: 20px;
}

.city-card-header h3 {
    color: #2c3e50;
    font-size: 1.4em;
    margin-bottom: 5px;
    font-weight: 700;
}

.city-country {
    color: #7f8c8d;
    font-size: 0.9em;
    font-weight: 500;
}

.city-weather {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.weather-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
}

.temp-info {
    text-align: left;
}

.temperature {
    display: block;
    font-size: 2.2em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.condition {
    display: block;
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 5px;
    font-weight: 500;
}

.city-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0;
}

.detail-item .label {
    color: #7f8c8d;
    font-size: 0.8em;
    font-weight: 500;
    margin-bottom: 2px;
}

.detail-item .value {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1em;
}

/* Temperature Color Coding */
.temp-cold {
    color: #3498db !important;
    font-weight: 700;
}

.temp-normal {
    color: #27ae60 !important;
    font-weight: 700;
}

.temp-hot {
    color: #e74c3c !important;
    font-weight: 700;
}

/* Humidity Color Coding */
.humidity-low {
    color: #e67e22 !important;
    font-weight: 700;
}

.humidity-normal {
    color: #27ae60 !important;
    font-weight: 700;
}

.humidity-high {
    color: #3498db !important;
    font-weight: 700;
}

/* UV Index Color Coding */
.uv-low {
    color: #27ae60 !important;
    font-weight: 700;
}

.uv-moderate {
    color: #f39c12 !important;
    font-weight: 700;
}

.uv-high {
    color: #e67e22 !important;
    font-weight: 700;
}

.uv-very-high {
    color: #e74c3c !important;
    font-weight: 700;
}

.uv-extreme {
    color: #8e44ad !important;
    font-weight: 700;
}

/* Cloud Cover Color Coding */
.cloud-clear {
    color: #27ae60 !important;
    font-weight: 700;
}

.cloud-partly {
    color: #f39c12 !important;
    font-weight: 700;
}

.cloud-mostly {
    color: #e67e22 !important;
    font-weight: 700;
}

.cloud-overcast {
    color: #7f8c8d !important;
    font-weight: 700;
}

/* Air Quality Color Coding */
.aq-good {
    color: #27ae60 !important;
    font-weight: 700;
}

.aq-moderate {
    color: #f39c12 !important;
    font-weight: 700;
}

.aq-unhealthy-sensitive {
    color: #e67e22 !important;
    font-weight: 700;
}

.aq-unhealthy {
    color: #e74c3c !important;
    font-weight: 700;
}

.aq-very-unhealthy {
    color: #8e44ad !important;
    font-weight: 700;
}

.aq-hazardous {
    color: #c0392b !important;
    font-weight: 700;
}

.refresh-btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
}

.refresh-btn:hover {
    background: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.loading-cities {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 1.2em;
    font-weight: 500;
}

/* Air Quality Section */
.air-quality-section {
    background: #fff;
    padding: 25px;
    margin: 30px 0;
    border-radius: 8px;
    border: 1px solid #28a745;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.air-quality-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #28a745;
    border-radius: 8px 8px 0 0;
}

.air-quality-section h3 {
    color: #155724;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 700;
    text-align: center;
}

.air-quality-section .weather-metrics {
    margin: 20px 0;
}

.air-quality-section .weather-item {
    background: #fff;
    border: 1px solid #ddd;
}

.air-quality-section .weather-item:hover {
    border-color: #28a745;
    background: #f8fff8;
}

/* Weather Sections */
.weather-section {
    background: #ffffff;
    padding: 30px;
    margin: 30px 0;
    border-radius: 16px;
    border: 1px solid #ecf0f1;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.weather-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 16px 16px 0 0;
}

.weather-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 700;
    text-align: center;
}

.weather-section .weather-metrics {
    margin: 20px 0;
}

.weather-section .weather-item {
    background: #fff;
    border: 1px solid #ddd;
}

.weather-section .weather-item:hover {
    border-color: #2c3e50;
    background: #f8f9fa;
}

/* Hourly Summary */
.hourly-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.hour-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hour-item:hover {
    transform: translateY(-2px);
    border-color: #2c3e50;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.hour-time {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.hour-icon img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.hour-temp {
    font-size: 1.3em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.hour-condition {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 500;
}

.hour-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.8em;
    color: #34495e;
}

.hour-details div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    h1 {
        font-size: 2em;
    }

    input[type="text"] {
        width: 100%;
        min-width: auto;
    }

    form {
        flex-direction: column;
        align-items: center;
    }

    .weather-metrics {
        grid-template-columns: 1fr;
    }

    .hourly-forecast {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .chart-container {
        height: 350px;
        padding: 20px;
    }

    .random-cities-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }

    .city-card {
        padding: 20px;
    }

    .city-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .temperature {
        font-size: 1.8em;
    }

    .weather-icon {
        width: 50px;
        height: 50px;
    }
}

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

    .container {
        padding: 15px;
    }

    .weather-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .main-weather {
        flex-direction: column;
        gap: 20px;
    }

    .current-temp {
        font-size: 2.5em;
    }

    .weather-icon img {
        width: 60px;
        height: 60px;
    }

    .forecast-metrics {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .astronomy-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .hourly-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }

    .astronomy-icon {
        font-size: 2em;
    }

    .astronomy-value {
        font-size: 1em;
    }

    .chart-container {
        height: 300px;
        padding: 15px;
    }

    .random-cities-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .city-card {
        padding: 15px;
    }

    .city-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .city-weather {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .temp-info {
        text-align: center;
    }

    .temperature {
        font-size: 1.6em;
    }

    .weather-icon {
        width: 45px;
        height: 45px;
    }

    .hourly-summary {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }

    .hour-item {
        padding: 12px;
    }

    .hour-icon img {
        width: 35px;
        height: 35px;
    }

    .hour-temp {
        font-size: 1.1em;
    }
}
