/* Base Styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --text-color: #333;
    --light-color: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    color: var(--secondary-color);
    margin-bottom: 5px;
    font-size: 2rem;
}

.location {
    color: #555;
    font-size: 1.1rem;
}

/* Weather Container */
.weather-container {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    position: relative;
    min-height: 300px;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Error Message */
.error-message {
    text-align: center;
    padding: 30px;
    color: #e74c3c;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.error-message i {
    font-size: 50px;
    margin-bottom: 15px;
}

#retry-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin-top: 20px;
    cursor: pointer;
    transition: var(--transition);
}

#retry-button:hover {
    background-color: #c0392b;
}

/* Weather Data */
.weather-data {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.main-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.temperature h2 {
    font-size: 4rem;
    font-weight: 300;
    color: var(--secondary-color);
}

.weather-icon i {
    font-size: 5rem;
    color: var(--primary-color);
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.detail-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 15px;
}

.detail-label {
    font-size: 0.9rem;
    color: #777;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.last-updated {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #777;
    font-size: 0.9rem;
}

.refresh-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.refresh-button:hover {
    background-color: #2980b9;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 20px;
    color: #777;
    line-height: 1.6;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* Utilities */
.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .temperature h2 {
        font-size: 3rem;
    }
    
    .weather-icon i {
        font-size: 4rem;
    }
    
    .weather-details {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .weather-container {
        padding: 15px;
    }
    
    .temperature h2 {
        font-size: 2.5rem;
    }
    
    .weather-icon i {
        font-size: 3rem;
    }
    
    .detail-item {
        padding: 10px;
    }
    
    .last-updated {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

