
/* Importing fonts from google fonts*/
@import url('https://fonts.googleapis.com/css2?family=Odibee+Sans&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;700&display=swap');


/* Resetting default margins and padding*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 20px;
    font-family: 'Comfortaa';
    line-height: 1.5;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--gainsboro);
}


/* Utility classes*/
.height-screen {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.fail-request {
    margin: 1rem 0;
    font-size: 0.8rem;
}

.invisible {
    display: none;
}

.contrast {
    color: var(--gainsboro);
    background-color: var(--raisin-black-80);
}

.content-box {
    display: block;
    margin: 1rem auto;
    min-width: 15rem;
    width: 60vw;
    max-width: 30rem;
    border-radius: 0.25rem;
    text-align: center; 
}

.nav {
    position: absolute;
    left : calc(50% - 3vh);
    min-width: 2rem;
    width: 6vh;
    max-width: 3rem;
    border-radius: 50%;
    background-color: var(--gainsboro-80);
    opacity: 0.4;
    cursor: pointer;
    z-index: 2;
    transition: opacity 800ms;
}
    .nav:hover {
        opacity: 1;
    }
    .nav:active {
        opacity: 0.1;
        transition: opacity 100ms;
}

.nav-up {
    top: 101vh;
    transform: rotate(180deg);
}

.nav-down {
    bottom: 1vh;
}

.background-filter {
    position: absolute;
    top:0;
    width: 100%;
    backdrop-filter: saturate(var(--weather-temp)) brightness(var(--time)) grayscale(var(--weather-clouds));
    z-index: 1;
    transition: backdrop-filter 5s;
}

/* Variable declarations*/
:root {
    /* Main colors*/
    --raisin-black-80: hsla(260, 7%, 16%, 80%);
    --raisin-black: hsla(260, 7%, 16%, 1);
    --gainsboro: hsla(276, 8%, 88%, 1);
    --gainsboro-80: hsla(276, 8%, 88%, 80%);


    /* Dynamically altered variables*/
    --time: 0;
    --weather-temp: 0%;
    --weather-clouds: 0%;
    --page-position: 0;
    --greeting-position: 0;
    
    /* Background images associated with corresponding weather*/
    --Thunderstorm: url('./resources/Thunderstorm.jpg'); /*Photo by Ayu Shakya from Pexels*/
    --Drizzle: url('./resources/Drizzle.jpg'); /*Photo by Sitthan Kutty from Pexels*/
    --Rain: url('./resources/Rain.jpg'); /*Photo by Rodrigo Souza from Pexels*/
    --Snow: url('./resources/Snow.jpg'); /*from Pexels*/
    --Clear: url('./resources/Clear.jpg'); /*Photo by Matheus Viana from Pexels*/
    --Other: url('./resources/Other.jpg'); /*Photo by Pedro Figueras from Pexels*/
    --Clouds: url('./resources/Clouds.jpg'); /*Photo by Stanislav Kondratiev from Pexels*/
    --Map: url('./resources/Map.jpg'); /*Photo by Filippo Peisino from Pexels*/
}


/* element styling */
body {
    height: 100vh;
    min-width: 300px;
    overflow-y: hidden;
    transform: translateY(var(--page-position));
    background-color: var(--raisin-black);
    transition: transform 1s cubic-bezier(0.6, 0.2, 0.735, 0.045);    
}

section {
    margin: 8vh 0;
    padding: 4vh 0;
    height: 88vh;
    background-color: var(--gainsboro);
    background-position: center;
    background-size: cover;
}
    section h1 {
        font-size: 2.5rem;
    }


/* Structure relative styling */

/* First 'page'*/
.home {
    background-image: ''/* set via js */;
    user-select: none;
    }
.home-banner {
    position: absolute;
    top: 15vh;
    width: 100%;
    z-index: 2;
    }
.home-banner-text {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Odibee sans', sans;
    font-size: min(35vh, 45vw);
    line-height: 1;
}

.home-greeting {
    position: absolute;
    top: 60vh;
    height: 8rem;
    width: 100%;
    overflow: hidden;
    z-index: 2;
    }
.home-greeting-slider {
    transform: translateY(var(--greeting-position));
    transition: transform 1s ease-in-out;
    }
    .home-greeting-slider h2 {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 8rem;
        font-size: 2rem;
        line-height: 1;
}

/* Second 'page'*/
.second-page  {
    background-image: var(--Map);
}

.city-input {
    height: 3rem;
    border-width: 0;
    font-size: 1.5rem;
    transition: border-width 200ms;
}
    .city-input:hover {
        border-width: 0.1rem;
    }
    .city-input:focus {
        border-width: 0.2rem;
        outline: none;
    }

.city-submit {
    height: 2rem;
    border-width: 0;
    font-size: 1rem;
    transition: border-width 200ms;
    cursor: pointer;
}
    .city-submit:hover {
        border-width: 0.1rem;
    }
    .city-submit:active {
        border-width: 0.2rem;
    }

.weather-table {
    display: table;
    border-collapse: collapse;
    }
    .weather-table tr:nth-of-type(2n) {
        border-top: 0.15rem solid var(--raisin-black-80);
        border-bottom: 0.15rem solid var(--raisin-black-80);
    }
    .weather-table td {
        padding: 0.4rem;
        text-align: center;
    }
        .weather-table img {
            display: block;
            margin: 0 auto;
            height: 4rem;
}

/* Fixes some elements overlapping on very small screen sizes*/
@media only screen and (max-height: 590px), only screen and (max-width: 325px) and (max-height: 690px) {
    html {
        font-size: 18px;
    }
}

@media only screen and (max-height: 515px) {
    html {
        font-size: 16px;
    }
}

@media only screen and (max-height: 430px) {
    html {
        font-size: 12px;
    }
    .home-greeting-slider h2 {
        font-size: 2rem;
    }
    .second-page {
        overflow-y: scroll;
    }
}