@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); */
    --bg-gradient: linear-gradient(15deg, #c9f8f8c5 20%, #c9f8f8c5 90%);
    --glass-bg: #c9f8f8c5;
    --glass-border: #ffffff1a;
    --text-main: #292929;
    --text-muted: #313131;
    --text-white: #caf1f1;
    --accent: #38bdf8;
    --safe-color: #4ade80;
    --unsafe-color: #f87171;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
:root.dark {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --text-main: #e0e0e0;
    --text-muted: #c0c0c0;
    --accent: #38bdf8;
    --safe-color: #4ade80;
    --unsafe-color: #f87171;
    --shadow: 0 8px 32px 0 rgba(255, 255, 255, 0.25);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    outline: none;
}

body {
    min-height: 100vh;
    background: var(--bg-gradient);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow-x: hidden;
}

section {
    width: 100%;
    max-width: 1050px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

header .weather {
    color: var(--accent);
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-label {
    display: none;
}

#search {
    width: 260px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid var(--accent);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#search::placeholder {
    color: var(--text-muted);
}

#search:focus {
    width: 300px;
    border-color: var(--unsafe-color);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

/* Page Loader */
.loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader::after {
    content: "";
    width: 45px;
    height: 45px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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


/* Messages & Notifications Starts */
.errorMessage, .saveMessage {
    margin-top: 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.4s ease;
}

.error, .last-save {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.errorMessage {
    background: var(--unsafe-color);
    border: 1px solid var(--unsafe-color);
    color: var(--text-white);
}

.saveMessage {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--text-muted);
}

/* Messages & Notifications Ends */

.container {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list .special {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    align-items: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.list .special:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateX(4px);
}

.list .sub {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
h2.sub-season {
    font-size: 1.05rem;
    font-weight: 200;
    text-transform: capitalize;
}

.list .style.weekday {
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    letter-spacing: 0;
    padding: 0;
    margin: 0;
    margin-left: 0.5rem;
}

.list .side-temp {
    text-align: right;
    font-size: 1.1rem;
    font-weight: 600;
}

.list .low-side-temp {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 0.4rem;
}

.list .degree {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
}

.right-item {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 2rem;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.in-left {
    display: flex;
    flex-direction: column;
}

.in-center {
    margin-top: 0;
}

.special.main-right {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}

.special .main-date.temperature {
    font-size: 5.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
}

.special .main-degree {
    font-size: 2rem;
    font-weight: 500;
    color: var(--accent);
}

.special .main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    order: 2;
    margin-left: 1.5rem;
}

.main-season.season {
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: capitalize;
    color: var(--text-muted);
}

.safe {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    display: inline-block;
}

.safe:empty {
    display: none;
}

.safe[text="Safe"], .safe {
    background: rgba(74, 222, 128, 0.2);
    color: var(--safe-color);
}

.date.weekday {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 1rem 0 0.25rem 0;
    font-weight: 400;
}

.location {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.clock {
    font-size: 0.85rem;
    color: var(--accent);
    font-family: monospace;
    margin-top: 0.25rem;
    letter-spacing: 0.05em;
}

.season-icon {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(6, 6, 6, 0.3));
    animation: float 4s ease-in-out infinite;
}

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

    50% {
        transform: translateY(-8px);
    }
}

.icon {
    width: 32px;
    height: 32px;
}

.sub-icon {
    width: 36px;
    height: 36px;
}


/* Responsive Media Queries */
@media(max-width: 960px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .right-item {
        order: -1;
    }
}

@media(max-width: 550px) {
    section {
        padding: 1.5rem;
    }

    header {
        justify-content: center;
        text-align: center;
    }

    .search-wrapper, #search {
        width: 100%;
    }

    #search:focus {
        width: 100%;
    }

    .right-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .special.main-right {
        justify-content: center;
    }

    .special .main {
        align-items: center;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .list .special {
        gap: 0.5rem;
    }

    .list .special .sub {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
    }

    .list .style.weekday {
        text-align: left;
    }
}