:root {
    color-scheme: dark;
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    background-image: url('./Imgs/opening.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: #f8fafc;
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    background: rgba(8, 15, 25, 0.34);
    content: '';
    pointer-events: none;
}

.appShell {
    position: relative;
    z-index: 1;
    width: min(100% - 32px, 720px);
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(36px, 8vh, 76px) 0 40px;
}

.headerTitle {
    margin: 0 0 30px;
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.48);
}

#weatherSearchForm,
#weatherContainer {
    width: min(100%, 620px);
    margin-inline: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(10, 20, 32, 0.8);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

#weatherSearchForm {
    padding: 22px;
    border-radius: 18px;
}

#weatherSearchForm label {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.4;
}

#searchHelp {
    margin: 0 0 14px;
    color: #d7e0ea;
    font-size: 14px;
    line-height: 1.45;
}

#searchControls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    gap: 12px;
}

#searchControls input,
#searchControls button {
    min-height: 56px;
    border-radius: 12px;
    font: inherit;
    font-size: 17px;
}

#searchControls input {
    min-width: 0;
    width: 100%;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: #f8fafc;
    color: #142033;
}

#searchControls input::placeholder {
    color: #66758a;
}

#searchControls button {
    min-width: 124px;
    padding: 0 24px;
    border: 1px solid #42b8d5;
    background: #0788aa;
    color: white;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 120ms ease, border-color 120ms ease;
}

#searchControls button:hover:not(:disabled) {
    border-color: #73d2e8;
    background: #087794;
}

#searchControls button:active:not(:disabled) {
    background: #09657d;
}

#searchControls button:disabled {
    border-color: #607181;
    background: #4b5e6d;
    color: #eef3f7;
    cursor: wait;
    opacity: 0.88;
}

.searchControl:focus-visible {
    outline: 3px solid #b8ecff;
    outline-offset: 3px;
}

#searchControls input:focus-visible {
    outline-offset: -4px;
}

#statusMessage,
#errorMessage {
    width: min(100%, 620px);
    margin: 14px auto 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(10, 20, 32, 0.82);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.45;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

#statusMessage:empty,
#errorMessage:empty {
    margin-top: 0;
    padding: 0;
}

#errorMessage {
    border: 1px solid rgba(255, 205, 205, 0.55);
    background: rgba(83, 22, 31, 0.9);
}

#weatherContainer {
    margin-top: 22px;
    padding: clamp(28px, 6vw, 48px);
    border-radius: 20px;
}

#weatherContainer h2 {
    margin: 0 0 18px;
    overflow-wrap: anywhere;
    font-size: clamp(27px, 5vw, 36px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
}

#weatherMain {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    column-gap: 8px;
    row-gap: 2px;
    text-align: center;
}

#temperature {
    grid-column: 1 / -1;
    font-size: clamp(64px, 15vw, 88px);
    font-weight: 650;
    line-height: 1;
    letter-spacing: -0.055em;
}

#weatherDescriptionHeader {
    font-size: clamp(18px, 4vw, 22px);
    font-weight: 550;
    line-height: 1.3;
}

#documentIconImg {
    width: 50px;
    height: 50px;
}

#weatherDetails {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.bottomDetails {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    margin: 0;
    text-align: center;
}

.bottomDetails span {
    color: #d7e0ea;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bottomDetails strong {
    overflow-wrap: anywhere;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

@media (max-width: 480px) {
    .appShell {
        width: min(100% - 24px, 720px);
        padding-top: 30px;
        padding-bottom: 24px;
    }

    .headerTitle {
        margin-bottom: 22px;
    }

    #weatherSearchForm {
        padding: 18px;
    }

    #searchControls {
        grid-template-columns: 1fr;
    }

    #searchControls input,
    #searchControls button {
        width: 100%;
        min-width: 0;
    }

    #weatherContainer {
        margin-top: 16px;
        padding: 26px 20px;
    }

    #weatherDetails {
        gap: 8px;
        margin-top: 22px;
        padding-top: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #searchControls button {
        transition: none;
    }
}
