html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #cbd5e1;
}

.main-container {
    width: calc(100vw);
    height: calc(100vh - 60px);
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.box-container {
    display: flex;
    overflow: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

.box {
    flex: 1 0 calc(50% - 20px);
    height: calc(80vw / 2);
    margin: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    border: solid black;
    position: relative;
    padding: 20px;
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    overflow: hidden;
}


.scroll-button {
    background-color: #007bff;
    border: none;
    color: white;
    padding: 10px;
    cursor: pointer;
    font-size: 20px;
}

.scroll-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.box-text {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: white;
}

.empty-space {
    flex: 0 0 45%;
}

.nameLore-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nameLore-container h1 {
    font-size: 1.5em;
}

.lore-style {
    font-size: 0.70em;
    overflow: auto;
    flex-grow: 1;
}


.content-container {
    flex: 0 0 20%;
    display: flex;
    flex-direction: column;
}

.sides-container {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: auto;
}

.right-container {
    margin-top: auto;
}

.sides-container p {
    flex: 1;
    text-align: center;
    font-size: 1em;
}

.obj-map-style {
    font-size: 0.75em;
    margin-top: auto;
}

.map-label {
    font-size: 1em;
    font-weight: bold;
}


.button-container {
    flex: 0 0 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    text-align: center;
    margin-top: auto;
}

.open-button {
    margin-top: 10px;
    padding: 6px 12px;
    background-color: #4CAF50;
    width: auto;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.open-button:hover {
    background-color: #45a049;
}


.slotting-start {
    font-size: 0.8em;
    color: #FFC000;
    text-align: center;
}

/*** START OF MISSION.HTM ***/

.main-container-mission {
    width: calc(100vw);
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.side-box-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
}

.side {
    width: calc(50% - 10px);
    height: 50px;
    border: solid black 1px;
    display: flex;
    justify-content: center;
    font-size: large;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgb(0, 0, 0);
    align-items: center;
    border-radius: 12px;
}

.squad-setting {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100px;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid black;
    background-color: #f0f1f3;
}

.left,
.center,
.right {
    flex: 1;
    display: flex;
    align-items: center;
}

.center {
    justify-content: center;
    text-align: center;
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: break-word;
}

.right {
    justify-content: flex-end;
}

.right p {
    margin-right: 20px;
}

.button-squad {
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.button-squad:hover {
    background-color: #388e3c;
}

#side1-box {
    transition: box-shadow 0.3s ease-in-out;
}

#side1-box:hover {
    box-shadow: 0px 4px 15px rgba(0, 0, 255, 1);
}

#side2-box {
    transition: box-shadow 0.3s ease-in-out;
}

#side2-box:hover {
    box-shadow: 0px 4px 15px rgba(255, 0, 0, 1);
}

/** HAMBURGER START **/

nav {
    position: relative;
    z-index: 1000;
    background-color: #1f2937;
}

.nav-links {
    list-style: none;
    display: flex;
    z-index: 1000;
}

.nav-links a {
    text-decoration: none;
    color: white;
    font-size: 16px;
    padding: 10px;
    transition: color 0.3s ease;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1100;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile view fixes */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        background-color: #4b5563;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        text-align: center;
        z-index: 999;
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    }

    .nav-links.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links li {
        width: 100%;
        display: flex;
    }

    #theme-toggle {
        width: 100%;
        text-align: center;
        padding: 15px 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    #theme-text {
        margin-right: 8px;
    }

    #theme-toggle:hover {
        background-color: #374151;
    }
    .nav-links a:hover {
        background-color: #374151;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 15px 20px;
        display: block;
        color: white;
        font-size: 16px;
        transition: background-color 0.3s ease;
    }


    /* Hamburger menu animation */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Dark Mode */
    body.dark-mode .nav-links {
        background-color: #273447;
    }
}



/** HAMBURGER END **/


/** DARK MODE **/
body.dark-mode {
    background-color: #1f2937;
    color: white;
}

body.dark-mode .scroll-button {
    background-color: #374151;
    color: white;
}

body.dark-mode .open-button {
    background-color: #2563eb;
}

body.dark-mode .squad-setting {
    background-color: #374151;
}

body.dark-mode nav {
    background-color: #111827;
}

/** END OF DARK MODE **/

@media (max-width: 1250px) {

    html,
    body {
        overflow: auto;
    }

    .main-container {
        flex-direction: column;
        overflow: auto;
    }

    .box-container {
        flex-direction: column;
        width: auto;
        height: calc(4 * 160px);

        overflow-y: auto;
        overflow-x: hidden;
    }

    .box {
        position: relative;
        min-width: auto;
        width: 90vw;
        height: 150px;
        margin: 5px 0;
        background-color: transparent;
    }

    .empty-space {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 50%;
        background-color: transparent;
    }

    .nameLore-container {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 40%;
        height: 50%;
        padding: 10px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .right-container {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 60%;
        height: 50%;
        padding: 10px;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
    }

    .content-container {
        flex: none;
        width: 70%;
        height: 100%;
    }

    .button-container {
        flex: 1;
        margin-top: 0%;
    }

    .sides-container {
        align-items: center;
        margin-top: 20px;
    }

    .obj-map-style {
        margin-top: 5px;
    }

    .scroll-button {
        display: none;
    }

    .sides-container p {
        font-size: 0.8em;
    }

    .open-button {
        margin-top: 10px;
        padding: 3px 6px;
        background-color: #4CAF50;
        width: auto;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 0.9em;
        transition: background-color 0.3s;
    }

    .slotting-start {
        font-size: 0.6em;
    }
}

@media (max-width: 880px) {
    .sides-container {
        display: flex;
        justify-content: center;
        gap: 0px;
    }
}

@media (max-width: 690px) {
    .sides-container {
        margin-top: 15px;
    }

    .content-container {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .nameLore-container h1 {
        font-size: 1em;
    }

    .lore-style {
        font-size: 0.6em;
    }

    .sides-container {
        margin-top: 5px;
    }
}

/*FOR MISSION.HTM*/

@media (max-width: 850px) {
    .squad-setting {
        font-size: 12px;
    }

    .button-squad {
        padding: 5px 10px;
        font-size: 12px;
    }

    .right p {
        margin-right: 5px;
    }

    .mission-stats {
        font-size: 14px;
    }
}

@media (max-width: 550px) {
    .squad-setting {
        height: 150px;
        font-size: 12px;
    }

    .mission-stats {
        font-size: 12px;
        line-height: 1rem;
    }

    .button-squad {
        font-size: 12px;
    }

    .right {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .right p {
        margin-right: 5px;
    }
}

@media (max-width: 420px) {
    .center {
        font-size: 9px;
    }
}

@media (max-width: 350px) {
    .squad-setting {
        height: 150px;
        font-size: 10px;
        padding: 10px;
        padding-right: 0;
    }

    .mission-stats {
        font-size: 10px;
        line-height: 1rem;
    }

    .center {
        font-size: 9px;
    }

    .button-squad {
        font-size: 10px;
    }

    .right p {
        margin-right: 2px;
    }
}