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

body {
    width: 100%;
    text-align: center;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: whitesmoke;
}

.navbar {
    height: 10vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f9f9f9;
    border-bottom: 1px solid #ccc;
    padding: 0 5vw;
}

.navbar .logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .logo-container img {
    display: block;
}

.navbar a {
    text-decoration: none;
    color: black;
    font-size: 1.5rem;
    font-weight: bold;
}

h1 {
    font-size: 1.5rem;
}

#searchInput {
    margin-top: 2vh;
    display: inline-block;
    background-color: #ffffff;
    text-align: left;
    height: 40px !important;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 50%;

}

.mål {
    margin: 5vh auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 40px;
    padding: 0 5vw;
}

.konvertering {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f9f9f9;
}

.konvertering h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.konvertering div {
    display: flex;
    justify-content: space-between;
}

.inn_ut_container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 80%;
}

.inn_ut {
    display: grid !important;
    grid-template-columns: 1fr 1fr ;
    gap: 10px;
    width: 100%;
}

.konvertering select,
.konvertering input,
.tall_inn,
.formatted-output {
    font-size: 16px;
    height: 40px;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
}



.flip-knapp {
    align-self: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    cursor: pointer;
    width: 15%;
    height: 90px;
    background-color: #ffffff;
}

.flip-knapp img {
    width: 50px;
    height: 50px;
}

.select2-container {
    box-sizing: border-box;
}

.select2-container--default .select2-selection--single {
    border-color: #ccc;
    height: 40px;
    width: 100% !important;
    box-sizing: border-box;
}

.select2-container--default .select2-selection__arrow {
    top: 8px !important;
}

.select2-container--default .select2-selection__rendered {
    line-height: 2.5 !important;
}

.select2-container--default .select2-selection__clear {
    line-height: 2.5 !important;
}

.formatted-output {
    display: inline-block;
    background-color: #ffffff;
    text-align: left;
    height: 40px !important;
    align-items: center;
    padding-top: 10px;
    width: 100%;
    box-sizing: border-box;
}



@media only screen and (max-width: 900px) {
    #searchInput {
        width: 90%;
        margin-top: 2vh;
    }

    .navbar a {
        font-size: 2.25vh;
    }

    .navbar img {
        width: 30px;
    }

    .mål {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 5vw;
        margin-top: 0;
        width: 100%;
    }

    .konvertering {
        width: 100%;
        margin: 0 auto;
    }

    .konvertering div {
        flex-direction: column;
        gap: 10px;
    }

    .inn_ut_container {
        width: 100%;
    }

    .konvertering input,
    .select2-container,
    .select2-container--default .select2-selection--single,
    .formatted-output {
        height: 40px !important;
        flex: none;
    }
    .flip-knapp {
        width: 100%;
    }

    
}

@media only screen and (max-width: 600px) {
    .mål {
        grid-template-columns: 1fr;
        padding: 5vw;
    }
}

footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

footer a {
    color: #666;
}

h2[data-tooltip] {
    position: relative; /* For å plassere tooltip relativt til h2 */
    cursor: pointer;
}

h2[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%; /* Plasser tooltip over h2 */
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    z-index: 10;
}

h2[data-tooltip]:hover::after {
    opacity: 1; /* Gjør tooltip synlig når man hovrer */
    pointer-events: auto;
}

.disclaimer {
    text-decoration: underline dotted;
}