@font-face {
    font-family: "Poppins";
    src: url("../fonts/Poppins-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Poppins";
    src: url("../fonts/Poppins-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Poppins";
    src: url("../fonts/Poppins-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Poppins";
    src: url("../fonts/Poppins-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-light: #FFFFFF;
    --color-black: #000000;
    --color-light-gray: #808080;
    --color-block-light-theme: #D9D9D9;
    --color-location: #4CBB17;
    --background: linear-gradient(90deg, #222120,#312e26,#45423a);
    --box-shadow-top: 0 4px 40px 0 rgba(0, 0, 0, 0.25);
    --box-shadow-block: 10px 10px 4px 0 rgba(0, 0, 0, 0.5);
    --border-radius-top: 40px;
    --border-radius-block: 30px;

    
    --font-family-base: "Poppins", sans-serif;
    --container-width: 1300px;
    --container-padding-x: 15px;
    --transition: transform 0.2s ease;
    --focus-visible: 1px dashed var(--color-light); 
}

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

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: inherit;
}

h1,h2,h3,h4,h5,h6 {
    margin: 0;
}

body {
    font-family: var(--font-family-base);
    background: var(--background);
}

a {
    color: var(--color-black);
}

button {
    transition: var(--transition);
}

button:hover {
    color: var(--color-light-gray);
    opacity: 0.7;
    transform: scale(1.04);

}

button:active {
    transform: scale(0.90);
    opacity: 0.8;
}

.hidden {
    display: none !important;
}

.container {
    max-width: calc(var(--container-width) + var(--container-padding-x) * 2);
    margin-inline: auto;
    padding-inline: var(--container-padding-x);
}

.header .screen__mode {
    display: flex;
    justify-content: space-between;
    padding-top: 50px;
}

.welcome__screen {
    display: flex;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    align-items: center;
    margin-top: 230px;
    min-height: 30vh;
}

.history__wrapper {
    position: relative;
}

.history__toggle {
    font-size: 16px;
    font-weight: 500;
    width: 200px;
    height: 40px;
    text-align: center;
    border-radius: var(--border-radius-block);
    border: none;
    background: var(--color-block-light-theme);
    color: var(--color-black);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: var(--transition);
}

.history__toggle:hover {
    background: #c0c0c0;
    transform: translateY(-1px);
}

.history__toggle:focus-visible {
    outline: 1px solid var(--focus-visible);
}

.history__list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #444444;
    padding: 8px 0;
    list-style: none;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 2;
    min-width: 200px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition);
}

.history__list:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.history__list.hidden {
    display: none;
}

.history__item {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-light);
    cursor: pointer;
    transition: var(--transition);
}

.history__item:hover {
    color: var(--color-location);
}

.history__item:active {
    transform: scale(0.90);
    opacity: 0.8;
}

.logo {
    border-radius: 20px;
    margin-bottom: auto;
    box-shadow: var(--box-shadow-top);
}

.logo:focus-visible {
    outline: var(--focus-visible);
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-location); /* Использует ваш цвет --color-location (#4CBB17) */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.loader.hidden {
    display: none !important;
}

.welcome__title {
    font-size: clamp(22px, 2.76vw, 36px);
    color: var(--color-light);
    margin-top: 150px;
    display: inline-block;
    font-weight: 500;
    overflow: hidden;
    letter-spacing: 1px;
}

.welcome__title span {
    transform: translateY(50px);
    display: inline-block;
    opacity: 0;
    animation: loadingAnimation 1.2s ease-out forwards;
    margin-right: -1px;
}

.welcome__title span:nth-child(1)  { animation-delay: 0.03s; }
.welcome__title span:nth-child(2)  { animation-delay: 0.06s; }
.welcome__title span:nth-child(3)  { animation-delay: 0.09s; }
.welcome__title span:nth-child(4)  { animation-delay: 0.12s; }
.welcome__title span:nth-child(5)  { animation-delay: 0.15s; }
.welcome__title span:nth-child(6)  { animation-delay: 0.18s; }
.welcome__title span:nth-child(7)  { animation-delay: 0.21s; }
.welcome__title span:nth-child(8)  { animation-delay: 0.24s; }
.welcome__title span:nth-child(9)  { animation-delay: 0.27s; }
.welcome__title span:nth-child(10) { animation-delay: 0.30s; }
.welcome__title span:nth-child(11) { animation-delay: 0.33s; }
.welcome__title span:nth-child(12) { animation-delay: 0.36s; }
.welcome__title span:nth-child(13) { animation-delay: 0.39s; }
.welcome__title span:nth-child(14) { animation-delay: 0.42s; }
.welcome__title span:nth-child(15) { animation-delay: 0.45s; }
.welcome__title span:nth-child(16) { animation-delay: 0.48s; }
.welcome__title span:nth-child(17) { animation-delay: 0.51s; }
.welcome__title span:nth-child(18) { animation-delay: 0.54s; }
.welcome__title span:nth-child(19) { animation-delay: 0.57s; }
.welcome__title span:nth-child(20) { animation-delay: 0.60s; }
.welcome__title span:nth-child(21) { animation-delay: 0.63s; }
.welcome__title span:nth-child(22) { animation-delay: 0.66s; }
.welcome__title span:nth-child(23) { animation-delay: 0.69s; }
.welcome__title span:nth-child(24) { animation-delay: 0.72s; }
.welcome__title span:nth-child(25) { animation-delay: 0.75s; }
.welcome__title span:nth-child(26) { animation-delay: 0.78s; }
.welcome__title span:nth-child(27) { animation-delay: 0.81s; }
.welcome__title span:nth-child(28) { animation-delay: 0.84s; }

.input__search-wrapper {
    display: flex;
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 50px auto;
    margin-right: 150px;
}

.input__search {
    font-size: 1rem;
    width: 100%;
    max-width: 700px;
    height: 50px;
    padding-left: 50px ;
    border-radius: var(--border-radius-top);
    background-color: #444;
    box-shadow: var(--box-shadow-top);
    color: var(--color-light);
    border: 1px solid rgba(255, 255, 255, 0.4);
    outline: none;
}

.input__search-image {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none; 
}

.input__list {
    position: absolute;
    top: 100%;
    left: 0%;
    width: 100%;
    max-width: 700px;
    max-height: 350px;
    overflow-y: auto;
    background-color: #2e2e2e;
    border: 1px solid var(--color-light-gray);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1;
    margin-top: 5px;
    padding: 0;
    list-style: none;
}

.input__list li {
    padding: 12px 16px;
    font-size: 16px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.input__list li:last-child {
    border-bottom: none;
}

.input__list li:hover {
    background-color: #444;
    color: #4CBB17;
}

.input__list li:active {
    background-color: #555;
}

.input__list.hidden {
    display: none;
}



.button__search {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    width: 80px;
    min-width: 80px;
    height: 50px;
    background-color: var(--color-block-light-theme);
    color: var(--color-black);
    border-radius: var(--border-radius-top);
    cursor: pointer;
}

.button__search:focus-visible {
    outline: var(--focus-visible);
}

.button__location {
    display: flex;
    align-items: center;
    margin-left: 40px;
    padding: 0 18px;
    width: 80px;
    height: 50px;
    border-radius: var(--border-radius-top);
    background: var(--color-location);
    box-shadow: 0 4px 40px 0 rgba(0, 0, 0, 0.25);
    font-weight: 700;
    font-size: 22px;
    color: #fff;
}

.button__location:focus-visible {
    outline: var(--focus-visible);
}

.location__icon {
    width: 40px;
    height: 40px;
}

.header__search {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    align-items: center;
    text-align: center;
}

.information {
    display: flex;
    justify-content: space-around;
    column-gap: 30px;
}

.map {
    display: block;
    width: 100%;
    max-width: 800px;
    height: 400px;
    border: 1px solid #fff;
    border-radius: var(--border-radius-block);
    box-shadow: var(--box-shadow-block);
    text-align: center;
    color: var(--color-light);
    overflow: hidden;
}

.save__link {
    display: inline-block;
    transition: var(--transition);
}

.save__image {
    fill: gray; 
    transition: fill 0.3s ease;
}

.save__link.saved .save__image {
    fill: white;
}



.save__link:hover {
    color: var(--color-light-gray);
    opacity: 0.7;
    transform: scale(1.04);
}

.save__link:active {
    transform: scale(0.90);
    opacity: 0.8;
}

.save__link:focus-visible{
    outline: var(--focus-visible);
}

.weather__information-location {
    max-width: 500px;
    width: 100%;
    height: 400px;
    border: 1px solid inherit;
    border-radius: var(--border-radius-block);
    box-shadow: var(--box-shadow-block);
    text-align: center;
    color: var(--color-light);   
}

.weather__information-city {
    font-size: 46px;
    font-weight: 700;
    margin-top: 80px;
    margin-bottom: 40px;
}

.weather__information-time {
    font-size: 96px;
    font-weight: 700;
}

.weather__information-date {
    font-size: 20px;
    font-weight: 400;
}

.weather__information-general {
    display: flex;
    justify-content: space-around;
    column-gap: 40px;
    width: 100%;
    max-width: 800px;
    height: 400px;
    border: 1px solid inherit;
    border-radius: var(--border-radius-block);
    box-shadow: var(--box-shadow-block);
    text-align: center;
    color: var(--color-light);
}

.general__block1,
.general__block3 {
    margin-top: 40px;
}

.general__block2 {
    margin-top: 80px;
}

.temperature__title {
    font-weight: 700;
    font-size: clamp(72px, 6.15vw, 80px);
    background: linear-gradient(68deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.temperature__desc {
    margin-bottom: 30px;
    font-weight: 600;
    font-size: clamp(15px, 1.53vw, 20px);
    color: rgba(255, 255, 255, 0.8);
}

.sunrise {
    position: relative;
}

.sunrise__image {
    position: absolute;
    right: 140px;
    top: 50%;
    transform: translateY(-50%);
}

.time__sunrise-title {
    font-weight: 600;
    font-size: clamp(15px, 1.38vw, 18px);
}

.time__sunrise-desc {
    font-weight: 600;
    font-size: clamp(14px, 1.23vw, 16px);
}

.sunset {
    position: relative;
}

.sunset__image {
    position: absolute;
    right: 140px;
    top: 50%;
    transform: translateY(-50%);
}

.time__sunset-title {
    font-weight: 600;
    font-size: clamp(15px, 1.38vw, 18px);
}

.time__sunset-desc {
    font-weight: 600;
    font-size: clamp(14px, 1.23vw, 16px);
}

.weather__text {
    font-weight: 600;
    font-size:clamp(24px, 2.46vw, 32px);
    text-align: center;
}

.weather__icon {
    max-width: 200px;
    width: 100%;
}

.indicator {
    font-weight: 500;
    font-size: clamp(14px, 1.23vw, 16px);
    text-align: center;
}

.indicator__inf {
    font-weight: 600;
    font-size: 16px;
    text-align: center;
}


@media (max-width: 1200px) {
    .sunset__image,
    .sunrise__image {
        right: 120px;
    }
}

@media (max-width: 1072px) {
    .information {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 50px;
    }
    .sunset__image,
    .sunrise__image {
        right: 105px;
    }
}

@media (max-width: 768px) {
    .welcome__screen {
        margin-top: 150px;
    }
    .input__search-wrapper-page {
        justify-content: center;
    }

    .button__search {
        width: auto;
    }

    .weather__information-general {
        height: 1200px;
        justify-content: center;
        flex-direction: column;
        gap: 40px;
    }

    .sunrise__image,
    .sunset__image {
        position: static;
        margin-top: 30px;
    }

    .general__block1,
    .general__block2,
    .general__block3 {
        width: 100%;
        text-align: center;
    }

    .general__block2 {
        margin: 0;
    }
}

@media (hover:none) {
    button:hover {
        transform: none;
    }

    button:active {
        transform: scale(0.90);
    } 

    .history__toggle:active {
        transform: scale(0.90);
        opacity: 0.8;
    }

    .history__item:hover {
        transform: none;
        color: transparent;
    }

    .history__item:active {
        transform: scale(0.90);
        opacity: 0.8;
    }

    .save__link:hover {
        transform: none;
    }
    .save__link:active {
        transform: scale(0.90);
    }
}






