@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --very-dark-gray: hsl(0, 0%, 17%);
    --dark-gray: hsl(0, 0%, 59%);
    font-size: 18px;
}

body {
    height: 100dvh;
    width: 100vw;
    text-align: center;
    font-family: 'Rubik', sans-serif; 
    
}

.container {
    padding: 5%;
    background-image: url('./images/pattern-bg-desktop.png');
    background-size: cover;
    background-repeat: no-repeat;
    height: 35%;
}

main { 
    margin: auto;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

header {
    width: 100%;
    height: 3rem;
}

header h1{
    color: white;
    font-weight: 500;
    margin: 1% auto;
    padding: 1%;
    font-size: 1.8rem;
}

#IP-input {
    width: 100%; 
    padding: 1%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 10px;
}

#IP-input input {
    width: 30vw;
    height: 2.5rem;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border: none;
    padding: 1%;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--very-dark-gray);
}

button {
    background-color: black;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    cursor: pointer;
    border: none;
    width: 45px;
}

.IP-address::-webkit-outer-spin-button,
.IP-address::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#IP-result {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding-top: 3%;
    padding-left: 4%;
    width: 60vw;
    background-color: white;
    min-height: 10rem;
    border-radius: 10px;
    margin-top: 3%;
    position: relative;
    z-index: 101;
}

.result-group {
    display: flex;
    flex-direction: column;
    text-align: start;
}

.result-head {
    color: var(--dark-gray);
    font-size: 0.8rem;
    padding: 5%;
    font-weight: 500;
    margin-bottom: 1%;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.result-value {
    color: var(--very-dark-gray);
    font-size: 1.40rem;
    font-weight: 400;
    padding: 5% 0;
    margin: 1% 0;
    border-right: 1px solid var(--dark-gray);
}

.no-border {
    border-right: none;
}

#map {
    position: relative;
    height: 500px;
    z-index: 100;
}

@media (max-width: 1241px) {

    .container {
        padding: 5%;
        background-image: url('./images/pattern-bg-mobile.png');
        background-size: cover;
        background-repeat: no-repeat;
        height: 35%;
    }

    #IP-result {
        display: flex;
        flex-direction: column;
        width: 80vw;
        background-color: white;
        padding-left: 0;
        padding: 2% 0;
        margin: 2% auto;
    }

    #IP-input input {
        width: 60vw;
        height: 4rem;
        font-size: 1.5rem;
        padding: 2%;
    }

    #IP-input button {
        width: 4rem;
    }

    button img {
        height: 1.25rem;
    }

    .result-value{
        border-right: none;
        padding: 0;
        font-size: 1.60rem;
        font-weight: 500;
        letter-spacing: 2%;
    }

    .result-group{
        text-align: center;
    }

    .result-head {
        font-size: 0.9rem;
        margin: 0;
    }

    #map {
        height: 70vh;    
    }
}