
/* CSS Variables */
:root {
    --primary-color: #48bef9;
    --secondary-color: #5e8eff;
    --dark-color: #1d1d1f;
    --light-color: #f5f5f7;
    --gray-color: #86868b;
    --card-bg: rgba(255, 255, 255, 0.15);
    --card-border: rgba(255, 255, 255, 0.2);
    --backdrop-blur: blur(20px);
    --transition: all 0.3s ease;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 1rem;
    --radius-lg: 1.5rem;
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    color: white;
    line-height: 1.5;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
}

/* Header Styles */
header {
    text-align: center;
    padding: 1rem 0;
    position: relative;
    z-index: 10;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 10;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 300px;
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--card-border);
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

#map {
    width: 100%;
    height: 100%;
    background-image: url('https://maps.googleapis.com/maps/api/staticmap?center=40.7128,-74.0060&zoom=4&size=600x300&scale=2&maptype=roadmap&style=element:geometry%7Ccolor:0x242f3e&style=element:labels.text.fill%7Ccolor:0x746855&style=element:labels.text.stroke%7Ccolor:0x242f3e&style=feature:administrative.locality%7Celement:labels.text.fill%7Ccolor:0xd59563&style=feature:poi%7Celement:labels.text.fill%7Ccolor:0xd59563&style=feature:poi.park%7Celement:geometry%7Ccolor:0x263c3f&style=feature:poi.park%7Celement:labels.text.fill%7Ccolor:0x6b9a76&style=feature:road%7Celement:geometry%7Ccolor:0x38414e&style=feature:road%7Celement:geometry.stroke%7Ccolor:0x212a37&style=feature:road%7Celement:labels.text.fill%7Ccolor:0x9ca5b3&style=feature:road.highway%7Celement:geometry%7Ccolor:0x746855&style=feature:road.highway%7Celement:geometry.stroke%7Ccolor:0x1f2835&style=feature:road.highway%7Celement:labels.text.fill%7Ccolor:0xf3d19c&style=feature:transit%7Celement:geometry%7Ccolor:0x2f3948&style=feature:transit.station%7Celement:labels.text.fill%7Ccolor:0xd59563&style=feature:water%7Celement:geometry%7Ccolor:0x17263c&style=feature:water%7Celement:labels.text.fill%7Ccolor:0x515c6d&style=feature:water%7Celement:labels.text.stroke%7Ccolor:0x17263c&key=YOUR_API_KEY');
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.map-instruction {
    background: rgba(0, 0, 0, 0.6);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

.map-pin {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.map-pin::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Loading Spinner */
.loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background-color: rgba(255, 59, 48, 0.9);
    color: white;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    display: none;
    backdrop-filter: var(--backdrop-blur);
}

/* Weather Display */
.weather-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 0;
}

.location {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.date {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.temperature-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.weather-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.temperature {
    font-size: 7rem;
    font-weight: 300;
    line-height: 1;
    position: relative;
    margin-bottom: 0.5rem;
}

.temperature-unit {
    position: absolute;
    top: 15px;
    font-size: 3rem;
    font-weight: 300;
}

.weather-description {
    font-size: 1.5rem;
    font-weight: 500;
    text-transform: capitalize;
    margin-bottom: 0.5rem;
}

.feels-like {
    font-size: 1.1rem;
    opacity: 0.9;
}

.unit-toggle {
    display: flex;
    gap: 0.25rem;
    margin-top: 1rem;
}

.unit-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.unit-btn.active {
    background-color: white;
    color: var(--primary-color);
}

/* Weather Details */
.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.detail-item {
    background-color: var(--card-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.detail-value {
    font-size: 1.5rem;
    font-weight: 500;
}

/* Forecast Section */
.forecast-container {
    margin-top: 3rem;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.forecast-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.forecast-items {
    display: flex;
    overflow-x: auto;
    justify-content: space-between;
    padding: 0.5rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.forecast-items::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.forecast-item {
    background-color: var(--card-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    min-width: 180px;
    text-align: center;
    flex-shrink: 0;
}

.forecast-day {
    font-weight: 600;
    margin-bottom: 1rem;
}

.forecast-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
}

.forecast-temp {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.forecast-description {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Background Gradient Animation */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    z-index: -1;
    transition: background 1s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .location {
        font-size: 1.75rem;
    }
    
    .temperature {
        font-size: 6rem;
    }
    
    .temperature-unit {
        font-size: 2.5rem;
    }
    
    .weather-description {
        font-size: 1.25rem;
    }
    
    .map-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .temperature {
        font-size: 5rem;
    }
    
    .temperature-unit {
        font-size: 2rem;
        top: 10px;
    }
    
    .weather-icon {
        width: 100px;
        height: 100px;
    }
    
    .weather-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .map-container {
        height: 200px;
    }
}
