/* ==================================================
   GLOBAL DESIGN SYSTEM
   ================================================== */

:root {
    --hue: 220;

    --primary: hsl(var(--hue), 90%, 55%);
    --accent: hsl(calc(var(--hue) + 40), 90%, 60%);

    --bg-main: hsl(var(--hue), 50%, 97%);
    --bg-card: rgba(255, 255, 255, 0.85);

    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border: rgba(255,255,255,0.4);

    --radius-lg: 18px;
    --radius-md: 12px;

    --shadow-md: 0 18px 40px rgba(0,0,0,0.12);
}

/* ==================================================
   RESET
   ================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================================================
   ANIMATED BACKGROUND
   ================================================== */

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(
        120deg,
        hsl(var(--hue), 85%, 85%),
        hsl(calc(var(--hue) + 40), 85%, 90%),
        hsl(calc(var(--hue) - 40), 85%, 92%)
    );

    background-size: 300% 300%;
    animation: gradientFlow 14s ease infinite;

    color: var(--text-main);
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==================================================
   MAIN CONTAINER (GLASSMORPHISM)
   ================================================== */

.container {
    width: 400px;
    padding: 34px;

    background: var(--bg-card);
    backdrop-filter: blur(16px);

    border-radius: var(--radius-lg);
    border: 1px solid var(--border);

    box-shadow: var(--shadow-md);

    animation: cardEnter 0.8s cubic-bezier(.2,.8,.2,1);
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================================================
   HEADER
   ================================================== */

h1 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 26px;
}

/* ==================================================
   SEARCH BAR
   ================================================== */

.search-box {
    display: flex;
    gap: 10px;
}

input {
    flex: 1;
    padding: 14px 16px;
    font-size: 15px;

    border-radius: var(--radius-md);
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.9);

    transition: all 0.25s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px hsla(var(--hue), 90%, 55%, 0.25);
}

/* ==================================================
   BUTTON (PREMIUM INTERACTION)
   ================================================== */

button {
    padding: 14px 20px;
    font-weight: 600;
    font-size: 14px;

    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;

    background: linear-gradient(
        135deg,
        var(--primary),
        var(--accent)
    );

    color: white;
    box-shadow: 0 10px 24px rgba(0,0,0,0.2);

    transition: all 0.25s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

button:active {
    transform: scale(0.96);
}

/* ==================================================
   WEATHER CARD
   ================================================== */

#weather-card {
    margin-top: 30px;
    text-align: center;
    animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#cityName {
    font-size: 22px;
    font-weight: 700;
}

#temperature {
    font-size: 54px;
    font-weight: 800;
    margin: 12px 0;

    background: linear-gradient(
        135deg,
        var(--primary),
        var(--accent)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#condition {
    font-size: 13px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ==================================================
   DETAILS GRID
   ================================================== */

.details {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.details p {
    padding: 14px;
    font-size: 13px;
    font-weight: 500;

    background: rgba(255,255,255,0.85);
    border-radius: var(--radius-md);

    box-shadow: 0 10px 22px rgba(0,0,0,0.1);

    transition: transform 0.25s ease;
}

.details p:hover {
    transform: translateY(-4px);
}

/* ==================================================
   THEME COLOR SLIDER (HUE CONTROL)
   ================================================== */

.theme-slider {
    margin-top: 26px;
}

.theme-slider label {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
    text-align: center;
}

.theme-slider input[type="range"] {
    width: 100%;
    appearance: none;
    height: 6px;
    border-radius: 999px;

    background: linear-gradient(
        to right,
        hsl(0, 90%, 55%),
        hsl(60, 90%, 55%),
        hsl(120, 90%, 55%),
        hsl(180, 90%, 55%),
        hsl(240, 90%, 55%),
        hsl(300, 90%, 55%)
    );

    outline: none;
}

.theme-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary);
    cursor: pointer;
}

/* ==================================================
   ERROR & UTILITIES
   ================================================== */

.error {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #dc2626;
}

.hidden {
    display: none;
}

/* ==================================================
   RESPONSIVE
   ================================================== */

@media (max-width: 420px) {
    .container {
        width: 92%;
        padding: 28px;
    }

    #temperature {
        font-size: 46px;
    }
}
