/*
   General structure
*/

html {
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/*
   Containers
*/

#container-1 {
    width: 100%;
    height: 100vh;
}

#textbox {
    width: 80%;
    margin: 0 auto;
    flex: 1;
    background-color: white;
}

/*
   Loader
*/

#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f0f0f0;
    border-top: 5px solid rgb(248, 46, 46);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loader-text {
    margin-top: 20px;
    font-family: "Google Sans", sans-serif;
    font-size: 18px;
    color: #555;
}

#bar {
    width: 100vw;
    height: 55px;
    background-color: rgb(248, 46, 46);
    border-radius: 0px 0px 6px 6px;
    transition: width 0.3s ease, height 0.3s ease;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 10px;
    align-items: start;
    padding: 12px 16px 0;
    box-sizing: border-box;
    box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.4);
}

.bar-left {
    justify-self: start;
    align-self: center;
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.bar-center {
    justify-self: center;
    align-self: center;
    min-width: 0;
    overflow: hidden;
    text-align: center;
}

.bar-right {
    justify-self: end;
    align-self: center;
}

@media (max-width: 768px) {
    #bar {
        grid-template-columns: 1fr auto;
        column-gap: 16px;
        padding-right: 12px;
    }

    .bar-center {
        display: none;
    }

    .bar-left {
        gap: 8px;
        max-width: 100%;
    }

    .bar-left button {
        font-size: 14px;
        padding: 0 8px;
    }
}

/*
   Typography
*/

h1,
h2,
h3 {
    margin: 0;
    padding: 0;
    font-family: "Google Sans";
}

/*
   Buttons
*/

button {
    background-color: white;
    border: 0px solid;
    border-radius: 20px;
    font-size: 16px;
    width: 105px;
    height: 30px;
}

button:hover {
    background-color: rgb(245, 244, 244);
}

/*
   Language
*/

.lang-btn {
    position: relative;
}

#bar-buttons {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 10px;
    padding-bottom: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    flex-wrap: wrap;
}

#bar-buttons button {
    background-color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    padding: 6px 14px;
    width: auto;
    height: 32px;
    cursor: pointer;
    white-space: nowrap;
    font-family: "Google Sans";
}

.bar-left button {
    width: auto;
    padding: 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#bar-buttons button:hover {
    background-color: rgb(245, 244, 244);
}

.lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin: 4px 0 0;
    padding: 4px;
    list-style: none;
    background: white;
    border-radius: 2px;
    box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.4);
}

.lang-menu.open {
    display: block;
}

/*
   Animations
*/

#arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

#options-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

/*
   Subtopic buttons
*/

.subtopic-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 30px 16px;
}

.subtopic-buttons button {
    width: auto;
    padding: 0 12px;
    overflow: hidden;
    white-space: nowrap;
    border: 1px solid black;
    cursor: pointer;
}