@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-bg-hover: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-border-hover: rgba(255, 255, 255, 0.25);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 212, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: bgPulse 20s ease-in-out infinite;
}

@keyframes bgPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Container */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Header */
header {
    text-align: center;
    padding: 50px 20px 40px;
    position: relative;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.logo-icon svg {
    width: 36px;
    height: 36px;
    fill: white;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 400;
    margin-top: 8px;
}

/* City Selector */
.city-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 50px;
    padding: 0 20px;
}

.city-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 14px 28px;
    border-radius: 100px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.city-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    transition: left 0.4s ease;
    z-index: -1;
}

.city-btn:hover::before,
.city-btn.active::before {
    left: 0;
}

.city-btn:hover,
.city-btn.active {
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 40px;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow: var(--shadow-lg);
    margin-bottom: 35px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.glass-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Current Weather */
.current-weather {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    align-items: center;
}

.current-main {
    text-align: center;
    padding: 20px;
}

.weather-icon-large {
    width: 180px;
    height: 180px;
    margin: 0 auto 25px;
    position: relative;
}

.weather-icon-large svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 30px rgba(0, 212, 255, 0.4));
    animation: iconPulse 4s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.current-temp {
    font-size: 7rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -4px;
}

.current-temp .unit {
    font-size: 3rem;
    font-weight: 500;
    letter-spacing: 0;
    opacity: 0.7;
}

.current-desc {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-top: 15px;
    font-weight: 400;
}

.current-city {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 10px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.current-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.06);
    padding: 28px 24px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.detail-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 12px;
    opacity: 0.8;
}

.detail-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--accent-primary);
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.detail-value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Forecast */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
}

.forecast-day {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px 15px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.forecast-day:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.forecast-day:first-child {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    border-color: rgba(0, 212, 255, 0.3);
}

.forecast-day-name {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.forecast-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
}

.forecast-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 10px rgba(0, 212, 255, 0.3));
}

.forecast-temps {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.forecast-high {
    font-size: 1.3rem;
    font-weight: 700;
}

.forecast-low {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Info Section */
.info-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.info-section p {
    color: var(--text-secondary);
    margin-bottom: 18px;
    font-size: 1.05rem;
    line-height: 1.8;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 30px;
}

.info-card {
    background: rgba(255, 255, 255, 0.04);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.info-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card p {
    margin: 0;
    font-size: 0.95rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 60px 20px 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer .footer-links {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

footer a:hover {
    color: var(--accent-primary);
}

footer .credits {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .forecast-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .current-weather {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .current-temp {
        font-size: 5rem;
    }

    .weather-icon-large {
        width: 140px;
        height: 140px;
    }

    .forecast-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .glass-card {
        padding: 30px 25px;
        border-radius: 24px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .current-temp {
        font-size: 4rem;
    }

    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .city-btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }

    .glass-card {
        padding: 25px 20px;
    }

    .detail-item {
        padding: 20px 15px;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.loading::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}