/* Weather Widget Styles */
.weather-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    border: 1px solid #e9ecef;
}

/* Loading State */
.weather-loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.weather-loading p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Error State */
.weather-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-message {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

/* Current Weather */
.current-weather {
    display: flex;
    align-items: center;
    padding: 30px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.current-weather::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="clouds" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23clouds)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.weather-icon {
    flex-shrink: 0;
    margin-right: 20px;
    position: relative;
    z-index: 1;
}

.weather-emoji {
    font-size: 64px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    line-height: 1;
}

.weather-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.current-temp {
    font-size: 48px;
    font-weight: 300;
    line-height: 1;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.weather-description {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: capitalize;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.location {
    font-size: 14px;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

.location::before {
    content: '📍';
    margin-right: 5px;
}

/* Weather Details */
.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e9ecef;
    margin: 0;
}

.detail-item {
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.detail-item:hover {
    background: #f8f9fa;
}

.detail-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Forecast Section */
.weather-forecast {
    padding: 20px 25px;
    background: #f8f9fa;
}

.forecast-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.forecast-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.forecast-item {
    flex-shrink: 0;
    background: white;
    border-radius: 12px;
    padding: 15px 12px;
    text-align: center;
    min-width: 70px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.forecast-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.forecast-day {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.forecast-emoji {
    font-size: 24px;
    margin: 0 auto 8px;
    display: block;
    line-height: 1;
}

.forecast-temp {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.forecast-temp-low {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Last Updated */
.last-updated {
    padding: 12px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.last-updated small {
    color: #666;
    font-size: 11px;
}

.update-time {
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 480px) {
    .weather-widget {
        max-width: 100%;
        margin: 0;
        border-radius: 12px;
    }
    
    .current-weather {
        padding: 25px 20px;
    }
    
    .weather-icon-img {
        width: 60px;
        height: 60px;
    }
    
    .current-temp {
        font-size: 36px;
    }
    
    .weather-description {
        font-size: 16px;
    }
    
    .weather-details {
        grid-template-columns: 1fr;
    }
    
    .detail-item {
        padding: 12px 20px;
    }
    
    .forecast-list {
        gap: 8px;
    }
    
    .forecast-item {
        min-width: 60px;
        padding: 12px 8px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .weather-widget {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .detail-item {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .detail-item:hover {
        background: #4a5568;
    }
    
    .detail-label {
        color: #a0aec0;
    }
    
    .detail-value {
        color: #e2e8f0;
    }
    
    .weather-forecast {
        background: #4a5568;
    }
    
    .forecast-title {
        color: #e2e8f0;
    }
    
    .forecast-item {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .forecast-day {
        color: #a0aec0;
    }
    
    .forecast-temp {
        color: #e2e8f0;
    }
    
    .forecast-temp-low {
        color: #a0aec0;
    }
    
    .last-updated {
        background: #4a5568;
        border-color: #718096;
    }
    
    .last-updated small {
        color: #a0aec0;
    }
}

/* Weather Condition Backgrounds */
.weather-widget[data-condition="clear"] .current-weather {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.weather-widget[data-condition="clouds"] .current-weather {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.weather-widget[data-condition="rain"] .current-weather {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.weather-widget[data-condition="snow"] .current-weather {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.weather-widget[data-condition="thunderstorm"] .current-weather {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.weather-widget[data-condition="mist"] .current-weather,
.weather-widget[data-condition="fog"] .current-weather {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
}

/* Animation for weather updates */
.weather-content {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
