/*
===================================
GLOBAL
===================================
*/
:root {
    --very-dark-gray:hsl(0, 0%, 17%);
    --dark-gray:hsl(0, 0%, 59%);
    --white:hsl(0,0%, 100%);
    --main-size:18px;
}

*,
*:before,
*:after {
    box-sizing:border-box;
    padding: 0;
    margin:0;
    font-family: 'Rubik', sans-serif;
    color: var(--very-dark-gray);
}

body {
    height: 100vh;
    position: relative;
}

h1 {
    font-weight: 500;
    color: var(--white);
    text-align: center;
}

img,
svg {
    width: 100%;
}

/*
===================================
HEADER SECTION STYLES
===================================
*/
.container {
    max-width:1440px;
    width:95%;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    height: 30%;
    background-image: url(images/pattern-bg.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.header form {
    display: grid;
    grid-template-columns: 90% 10%;
    justify-content: stretch;
    align-items: center;
    width: inherit;
    max-width: 600px;
    gap: 0;
    margin: 2rem auto;
    box-shadow: 0 1px 10px var(--vary-dark-gray);
    border-radius:15px;
}

.header form > * {
    border:none;
    height: 50px;
    padding: 2rem;
    outline: 0;
    font-size: var(--main-size);
}

.header form input {
    border-radius: 15px 0 0 15px;
}

.header form input::placeholder {
    color: var(--dark-gray);
}

.header form button {
    border-radius: 0 15px 15px 0;
    position: relative;
    background-color: var(--very-dark-gray);
    color: var(--white);
    font-size: var(--main-size);
    cursor: pointer;
}

.header form button img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    max-width: fit-content;
}

/* RESULTS DIV STYLES */
#results {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 1px 10px var(--dark-gray);
}

#results h2,
#results h3 {
    color: var(--dark-gray);
    font-weight: 400;
    font-size: 100%;
    text-transform: uppercase;
    letter-spacing: .1rem;
    margin-bottom: 1rem;
}

#results p {
    font-weight: 500;
    font-size: 24px;
}

#results > div {
    display:none;
}
#results > div.active {
    display:grid;
}

/* LOADING STYLES */
.loading h2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    place-items: center;
    text-align: center;
    margin: 0 auto;
    gap: 1rem;
}

.loading span {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid;
    border-color: var(--dark-gray) var(--dark-gray) var(--dark-gray) transparent;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

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

/* RESULTS STYLES */
#results .error-display {
    display: none;
    place-items: center;
    gap: 1rem;
}

#results .data-display {
    padding:1rem;
    display: none;
    grid-template-columns: repeat(4,1fr);
    align-items: stretch;
    justify-content: start;
}

#results .data-display > div {
    padding: 0 2rem;
}

#results .data-display > div:not(:last-child) {
    border-right: 1px solid var(--dark-gray);
}

/*
===================================
MAP SECTION STYLES
===================================
*/
.map-section {
    height: 70%;
}

#map {
    height: 100%;
    z-index: -1;
}

/*
===================================
MOBILE STYLES
===================================
*/
@media (max-width:900px) {
    .header form {
        grid-template-columns:75% 25%;
    }
    #results .data-display {
        grid-template-columns: 1fr;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    #results .data-display > div {
        padding: 1rem 0;
    }

    #results .data-display > div:not(:last-child) {
        border-right: none;
    }
}

