/* ==================== RESET & BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4A90E2;
    --secondary-color: #5DADE2;
    --accent-color: #F39C12;
    --success-color: #27AE60;
    --warning-color: #F39C12;
    --danger-color: #E74C3C;
    --dark-bg: #2C3E50;
    --light-bg: #ECF0F1;
    --card-bg: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --sidebar-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --main-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--main-bg);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-overlay .spinner-border {
    width: 4rem;
    height: 4rem;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    background: var(--sidebar-bg);
    min-height: 100vh;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.sidebar-content {
    position: sticky;
    top: 2rem;
}

.weather-icon-header {
    font-size: 4rem;
    color: #FDB813;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

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

.app-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.app-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 300;
    margin-bottom: 0;
}

/* ==================== SEARCH SECTION ==================== */
.search-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.search-input {
    border: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.search-input:focus {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.btn-search {
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
}

.btn-search:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* ==================== RECENT CITIES ==================== */
.recent-cities {
    margin-top: 1.5rem;
}

.recent-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-group-item {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.list-group-item:hover {
    background: white;
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
    color: var(--primary-color);
}

.list-group-item:active {
    transform: translateX(3px);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    padding: 2rem;
    background: transparent;
    min-height: 100vh;
}

/* ==================== CURRENT WEATHER CARD ==================== */
.current-weather-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    animation: slideInUp 0.5s ease-out;
}

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

.current-weather-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

.current-weather-header {
    margin-bottom: 1.5rem;
}

.city-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.city-name i {
    color: var(--primary-color);
    font-size: 2rem;
}

.current-date {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0;
}

.temperature-display {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.weather-icon-large {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.temperature {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.temp-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.temp-range {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.temp-high,
.temp-low {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.temp-high {
    color: #E74C3C;
}

.temp-high i {
    color: #E74C3C;
}

.temp-low {
    color: #3498DB;
}

.temp-low i {
    color: #3498DB;
}

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

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.stat-item:hover {
    background: #E8EFF3;
    transform: translateY(-2px);
}

.stat-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-item .fa-sunrise {
    color: #F39C12;
    text-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

.stat-item .fa-sunset {
    color: #E67E22;
    text-shadow: 0 0 10px rgba(230, 126, 34, 0.3);
}

.stat-item div {
    display: flex;
    flex-direction: column;
}

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

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.weather-description {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* ==================== UV INDEX BADGES ==================== */
.uv-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
}

.uv-low {
    background: var(--success-color);
    color: white;
}

.uv-moderate {
    background: var(--warning-color);
    color: white;
}

.uv-high {
    background: var(--danger-color);
    color: white;
}

/* ==================== FORECAST SECTION ==================== */
.forecast-section {
    margin-top: 2rem;
    animation: slideInUp 0.7s ease-out;
}

.forecast-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.forecast-title i {
    color: var(--primary-color);
}

.forecast-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: none;
    height: 100%;
}

.forecast-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.forecast-date {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.forecast-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.forecast-temp {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.forecast-temp-range {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.forecast-high,
.forecast-low {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.forecast-high {
    color: #E74C3C;
}

.forecast-high i {
    color: #E74C3C;
    font-size: 0.75rem;
}

.forecast-low {
    color: #3498DB;
}

.forecast-low i {
    color: #3498DB;
    font-size: 0.75rem;
}

.forecast-humidity {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.forecast-humidity i {
    color: var(--primary-color);
}

/* ==================== WELCOME MESSAGE ==================== */
.welcome-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

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

.welcome-icon {
    font-size: 8rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
}

.welcome-message h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.welcome-message .lead {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.quick-search {
    margin-top: 2rem;
}

.quick-search .btn {
    margin: 0.25rem;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.quick-search .btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
        padding: 1.5rem 1rem;
    }

    .sidebar-content {
        position: relative;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .weather-icon-header {
        font-size: 3rem;
    }

    .main-content {
        padding: 1rem;
    }

    .current-weather-card {
        padding: 1.5rem;
    }

    .city-name {
        font-size: 1.8rem;
    }

    .temperature {
        font-size: 3rem;
    }

    .temp-high,
    .temp-low {
        font-size: 1rem;
    }

    .weather-icon-large {
        width: 80px;
        height: 80px;
    }

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

    .forecast-title {
        font-size: 1.4rem;
    }

    .welcome-icon {
        font-size: 5rem;
    }

    .welcome-message h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .temperature-display {
        flex-direction: column;
        text-align: center;
    }

    .forecast-card {
        margin-bottom: 1rem;
    }
}

/* ==================== SCROLLBAR STYLING ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ==================== UTILITIES ==================== */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideInUp 0.5s ease-out;
}
