:root {
    --primary: #10b981;
    --primary-dark: #047857;
    --secondary: #059669;
    --accent: #34d399;
    --text: #2d3748;
    --text-light: #718096;
    --text-muted: #a0aec0;
    --bg: #f7fafc;
    --bg-secondary: #edf2f7;
    --card-bg: rgba(255, 255, 255, 0.95);
    --border: rgba(226, 232, 240, 0.8);
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --info: #10b981;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --backdrop-blur: blur(20px);
}

.dark-mode {
    --primary: #6ee7b7;
    --primary-dark: #10b981;
    --secondary: #34d399;
    --accent: #a7f3d0;
    --text: #f7fafc;
    --text-light: #e2e8f0;
    --text-muted: #a0aec0;
    --bg: #1a202c;
    --bg-secondary: #2d3748;
    --card-bg: rgba(45, 55, 72, 0.95);
    --border: rgba(74, 85, 104, 0.8);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    
    /* Dark Glassmorphism */
    --glass-bg: rgba(45, 55, 72, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    opacity: 0.03;
    z-index: -1;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { transform: rotate(0deg) scale(1); }
    33% { transform: rotate(120deg) scale(1.1); }
    66% { transform: rotate(240deg) scale(0.9); }
}

/* Header */
header {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    box-shadow: 0 4px 32px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 45px;
    width: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05) rotate(5deg);
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mode-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--backdrop-blur);
    color: var(--text);
    font-size: 1.25rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Glass Card Effect */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--shadow);
    margin-bottom: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px var(--shadow-hover);
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-container {
    display: flex;
    justify-content: center;
}

.search-form {
    width: 100%;
    max-width: 600px;
}

.input-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 280px;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 500;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    transform: scale(1.02);
}

.search-btn, .location-btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.search-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.location-btn {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    color: var(--text);
    border: 2px solid var(--border);
}

.location-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.location-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

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

/* Current Weather */
.current-weather {
    padding: 2.5rem;
    text-align: center;
}

.weather-header {
    margin-bottom: 2rem;
}

.location-info h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.last-updated {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.weather-main {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.temp-display {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.temp {
    font-size: 4.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.temp-unit {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.weather-icon-container {
    position: relative;
}

.weather-icon {
    font-size: 4rem;
    animation: bounce 3s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.description {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: capitalize;
    margin-bottom: 1rem;
}

.feels-like {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.weather-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--glass-bg);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--shadow);
}

.stat-icon {
    font-size: 1.75rem;
    min-width: 40px;
    text-align: center;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

/* Clothing Recommendation */
.clothing-reco {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    padding: 2rem;
    border-radius: 20px;
    margin-top: 2rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    text-align: left;
}

.clothing-reco h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clothing-reco h4::before {
    content: '👕';
    font-size: 1.5rem;
}

.clothing-reco p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
}

.clothing-icon {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.title-icon {
    font-size: 1.75rem;
}

/* Hourly Forecast */
.hourly-forecast {
    padding: 2rem;
}

.hourly-container {
    position: relative;
}

.hourly-scroll {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding: 1rem 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hourly-scroll::-webkit-scrollbar {
    display: none;
}

.hour-card {
    min-width: 80px;
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1.5rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.hour-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hour-card:hover::before {
    opacity: 0.1;
}

.hour-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px var(--shadow-hover);
}

.hour-card > * {
    position: relative;
    z-index: 1;
}

.hour-time {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.hour-icon {
    font-size: 2rem;
    margin: 0.75rem 0;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.hour-temp {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.hour-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-transform: capitalize;
}

/* Scroll Buttons */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    color: var(--text);
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    z-index: 10;
    display: none;
}

.scroll-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.scroll-left {
    left: -20px;
}

.scroll-right {
    right: -20px;
}

/* Daily Forecast */
.daily-forecast {
    padding: 2rem;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
}

.day-card {
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.day-card:hover::before {
    opacity: 0.08;
}

.day-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px var(--shadow-hover);
}

.day-card > * {
    position: relative;
    z-index: 1;
}

.day-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
}

.day-icon {
    font-size: 2.5rem;
    margin: 1rem 0;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.day-temp {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.5rem;
}

.day-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-transform: capitalize;
}

.temp-range {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.temp-high {
    font-weight: 700;
    color: var(--text);
}

.temp-low {
    color: var(--text-muted);
}

/* Weather Map */
.weather-map {
    padding: 2rem;
}

.weather-map-container {
    height: 450px;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid var(--glass-border);
}

.custom-marker .marker-pin {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    animation: markerPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Messages */
.welcome-message, .error-message {
    padding: 3rem 2rem;
    text-align: center;
}

.welcome-icon, .error-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.welcome-message h3, .error-message h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.welcome-message p, .error-message p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 500px;
    margin: 0 auto;
}

.error-message {
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.1), rgba(245, 101, 101, 0.05));
    border-color: rgba(245, 101, 101, 0.2);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
}

/* Animations */
.fade-in {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .weather-main {
        flex-direction: column;
        gap: 1rem;
    }
    
    .temp {
        font-size: 3.5rem;
    }
    
    .weather-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .weather-map-container {
        height: 300px;
    }
    
    .glass-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .current-weather {
        padding: 2rem 1.5rem;
    }
    
    .hourly-forecast, .daily-forecast, .weather-map {
        padding: 1.5rem;
    }
    
    .scroll-left, .scroll-right {
        display: block;
    }
}

@media (max-width: 480px) {
    .forecast-grid {
        grid-template-columns: 1fr;
    }
    
    .hour-card {
        min-width: 70px;
        padding: 1rem 0.75rem;
    }
    
    .temp {
        font-size: 3rem;
    }
    
    .weather-icon {
        font-size: 3rem;
    }
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass-card {
        background: var(--card-bg);
        border-width: 2px;
    }
    
    .search-input, .stat-item, .hour-card, .day-card {
        border-width: 2px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .background-animation {
        animation: none;
    }
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .background-animation,
    .mode-toggle,
    .search-section,
    .weather-map,
    .scroll-btn {
        display: none;
    }
    
    .glass-card {
        background: white;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}