/* Document */
html {
    min-height: 100%;
    min-width: fit-content;
}

body {
    height: 100%;
    min-height: 100%;
    width: 100%;
    min-width: fit-content;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 0.5px;
    font-weight: 400;
    background: linear-gradient(135deg, #f7f6f4, #e9e2d6, #d9cbb1);
    font-size: 1em;
}

iframe {
    width: 100%;
    height: 196px;
    margin-top: 30px;
}

/* Global container */
body > div {
    display: grid;
    grid-template-columns: minmax(180px, 230px) auto;
    grid-template-rows: 1fr auto;
    grid-template-areas:
        'menu main'
        'menu footer';
    min-height: 100vh;
}

/* Fade in and fade out */
.fade {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    pointer-events: auto;
}

.fade.hidden {
    opacity: 0;
    pointer-events: none;
}

.display-none {
    display: none;
}

/* Forms */
input {
    border: 1px solid #bbb;
    border-radius: 4px;
    outline: none;
    height: 21px;
}

input[type='button'] {
    cursor: pointer;
    height: 25px;
    background-color: #fff;
    border: 1px solid #bbb;
    width: 110px;
}

input[type='button']:hover {
    cursor: pointer;
    background-color: #eee;
}

input[type='checkbox'] {
    cursor: pointer;
    margin: 0;
}

input[type='number'] {
    width: 50px;
    margin-right: 10px;
}

select {
    height: 25px;
    padding: 0 1vh;
    text-align: left;
    text-align-last: center;
    border: 1px solid #bbb;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

input[type='number'] {
    appearance: textfield;
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

input:disabled {
    cursor: auto !important;
}

/* Icons */
.icon {
    display: inline-block;
    width: 25px;
    height: 25px;
    vertical-align: top;
    background-size: 100% 100%;
}

.icon-phy-mini {
    background-image: url(../images/0.png);
}

.icon-men-mini {
    background-image: url(../images/1.png);
}

.icon-tac-mini {
    background-image: url(../images/2.png);
}

/* Navigation */
nav {
    grid-area: menu;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #202124;
    color: #cfcfcf;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.3);
    padding: 0 8px;
    box-sizing: border-box;
    border-right: 1px solid #1c1919;
}

nav hr {
    opacity: 0;
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

nav li {
    cursor: pointer;
    margin-bottom: 4px;
    padding: 10px;
    border-radius: 6px;
    background: #2a2b2f;
    user-select: none;
}

nav li:hover,
nav li.active {
    background: #333437;
}

nav li.active {
    cursor: default;
}

#v2-menu {
    display: flex;
    justify-content: space-between;
}

#v2-menu span {
    color: yellow;
    text-shadow: 0 0 4px #ffb100;
    display: block;
    position: relative;
    animation: floatNew 2.5s ease-in-out infinite alternate;
}

@keyframes floatNew {
    0% {
        transform: translateY(-1px);
    }
    100% {
        transform: translateY(1px);
    }
}

/* Header */
header {
    grid-area: header;
    width: 70%;
    aspect-ratio: 1;
    background: url(../images/title.png) no-repeat center center;
    background-size: 100%;
    background-position: center center;
    margin: 0 auto;
    image-rendering: pixelated;
}

/* Main container */
main {
    grid-area: main;
    display: flex;
    padding: 20px 30px;
    gap: 3vh;
}

#content-left {
    display: flex;
    flex-direction: column;
    width: 50%;
    min-width: 670px;
}

#content-right {
    width: 50%;
    min-width: 500px;
}

/* Footer */
footer {
    grid-area: footer;
    text-align: center;
    font-size: 0.6em;
    margin: 10px 0 5px 0;
}

footer p {
    margin: 0;
}

/* Category title */
.category-title {
    position: relative;
    width: 100%;
    text-align: center;
    font-weight: bold;
    color: #615850;
    margin-bottom: 12px;
}

.category-title::after {
    content: ' ';
    margin-top: 6px;
    display: block;
    width: 100%;
    height: 2px;
    background-color: #615850;
}

/* Content line */
.content-line {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    gap: 4px;
}

.content-line select#workerCount {
    margin-right: 10px;
}

.content-line input[type='button']:first-of-type {
    margin-left: 10px;
}

.content-line input[type='checkbox'] {
    margin-right: 10px;
}

.content-line.double > div {
    display: flex;
    align-items: center;
    width: 35%;
}

/* Content title */
.content-title {
    font-size: 0.9em;
    width: 130px;
}

.content-title:nth-of-type(2) {
    margin: 0 30px 0 50px;
    width: auto;
}

/* Simulation data */
#simulation-data {
    width: 100%;
    margin-bottom: 14px;
}

#simulation-data input[type='button']:first-child {
    margin-left: 0;
}

/* Mission  */
#mission-data {
    width: 100%;
    margin-bottom: 14px;
}

/* Squadron */
#squadron {
    width: 100%;
    margin-bottom: 14px;
}

#squadron .sortable {
    display: flex;
    align-items: center;
    gap: 1vh;
    margin-bottom: 4px;
}

#squadron .excluded input,
#squadron .excluded select {
    background-color: #f7f571;
}

#squadron .missing-data input,
#squadron .missing-data select {
    background-color: #e27070;
}

#squadron .recruit-number {
    cursor: pointer;
}

#squadron .exp-recruit {
    width: 60px;
}

#squadron .exp-needed-recruit {
    font-size: 0.85em;
    width: 45px;
    display: inline-block;
}

#squadron .image-chemistry {
    width: 15px;
    height: 20px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
}

#squadron .image-chemistry {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 133.33"><polygon points="25,0 70,0 40,47 95,47 20,133 40,73 0,73" fill="%23AAAAAA" stroke="%23777777" stroke-width="1" stroke-linejoin="arcs"/></svg>');
}

#squadron .image-chemistry.active {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 133.33"><polygon points="25,0 70,0 40,47 95,47 20,133 40,73 0,73" fill="%2387BCE8" stroke="%235A7B91" stroke-width="1" stroke-linejoin="arcs"/></svg>');
}

/* Training */
#training {
    width: 100%;
}

#training #squadron-bonus input {
    width: 40px;
    margin-right: 10px;
}

#training #squadron-rank,
#training #select-squadron-rank {
    display: inline-block;
    font-size: 0.9em;
}

#training-list {
    margin-top: 20px;
    display: flex;
    gap: 6px;
}

#training-list div:not(#apply-training):not(#apply-training *) {
    background-position: 50% 50%;
    background-repeat: no-repeat;
    background-color: #766b61;
}

#training-list #training-0 {
    background-image: url(../images/0.png);
}
#training-list #training-1 {
    background-image: url(../images/1.png);
}
#training-list #training-2 {
    background-image: url(../images/2.png);
}
#training-list #training-3 {
    background-image: url(../images/3.png);
}
#training-list #training-4 {
    background-image: url(../images/4.png);
}
#training-list #training-5 {
    background-image: url(../images/5.png);
}
#training-list #training-6 {
    background-image: url(../images/6.png);
}

#training-list .training-icon {
    width: 50px;
    height: 50px;
    border: 2px solid #615850;
    cursor: pointer;
}

#training-list .active {
    background-color: #3e3833 !important;
    border: 2px solid #000;
}

#apply-training input {
    width: 110px;
    margin-bottom: 4px;
    cursor: pointer;
}

#mission-exp-reward {
    margin-top: 20px;
}

#mission-exp-reward #select-classes-exp {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 1vh;
    height: 32px;
}

#mission-exp-reward #select-classes-exp .text {
    font-size: 0.9em;
}

#mission-exp-reward #select-classes-exp .images {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 1vh;
}

#mission-exp-reward #select-classes-exp .images img {
    cursor: pointer;
    opacity: 0.5;
}

#mission-exp-reward #select-classes-exp .images img.active {
    opacity: 1;
}

#mission-exp-reward #mission-experience-reward {
    display: flex;
    gap: 30px;
    font-size: 0.9em;
    margin-bottom: 1vh;
}

#mission-exp-reward #mission-experience-reward div {
    display: flex;
    align-items: center;
    gap: 5px;
}

#mission-exp-reward #mission-experience-reward input[type='number'] {
    width: 60px;
}

#mission-exp-reward #b-apply-exp-reward {
    width: 110px;
}

#mission-bonus select.mission-bonus {
    width: 120px;
}

/* How to use */
#how-to-use {
    font-size: 0.9em;
    text-align: justify;
    display: none;
}

#how-to-use.visible {
    display: block;
}

#how-to-use .important {
    font-weight: bold;
}

/* Pages */
#v2,
#support-me {
    display: none;
    font-size: 0.9em;
}

#v2.visible,
#support-me.visible {
    display: block;
}

#v2 li,
#support-me li {
    margin-bottom: 10px;
}

/* Overlay */
#windows {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 20;
}

.title-window {
    height: 30px;
    line-height: 30px;
    padding-left: 10px;
    background: #615850;
    font-size: 0.9em;
    margin-bottom: 10px;
    font-weight: bold;
    color: #eee;
}

.line-window {
    height: 27px;
}

.title-line-window {
    width: 120px;
    display: inline-block;
    font-size: 0.9em;
}

.content-line-window {
    width: 340px;
    display: inline-block;
}

#window-manage .content-line-window {
    width: 100%;
    display: inline-block;
    margin-top: 10px;
    text-align: center;
}

#window-export,
#window-import,
#window-chemistry,
#window-manage,
#window-clear {
    width: 470px;
    background: #e9e2d6;
    border: 4px solid #615850;
    padding: 20px;
    margin: 0 auto;
}

#window-manage {
    width: 570px;
}

#window-chemistry select,
#window-chemistry input {
    width: 100%;
}

#window-manage input {
    width: 50%;
}

#window-manage .line-window {
    margin-bottom: 20px;
}

#window-manage .line-window:has(#apply-manage) {
    margin-top: 30px;
}

#window-manage input[type='text'] {
    margin-left: 6px;
    width: 20%;
}

#window-manage select {
    width: 20%;
}

#window-manage .inline-title {
    display: inline-block;
    margin-right: 5px;
    font-size: 0.8em;
}

#window-export #export-explanation,
#window-import #import-explanation,
#window-clear #clear-explanation,
#window-manage #manage-explanation {
    text-align: justify;
    font-size: 0.8em;
    margin-bottom: 30px;
}

#window-import input {
    margin-top: 10px;
    width: 110px;
}

#window-clear input {
    width: 110px;
}

textarea {
    height: 98px;
    width: 462px;
    resize: none;
}

#processed {
    position: absolute;
    display: block;
    right: 0;
    top: 0;
    text-align: right;
}

#calc-in-progress {
    margin-bottom: 18px;
    font-weight: bold;
    color: #c61515;
    text-align: justify;
}

#window-chemistry #bonus-chemistry {
    display: inline-block;
    width: 70%;
}

#window-chemistry #chk_all {
    font-size: 0.9em;
    display: inline-block;
    width: 28%;
    text-align: right;
}

#window-chemistry #chk_all div {
    display: inline-block;
}

#window-chemistry #chk_all input {
    margin: 0;
    width: auto;
    vertical-align: top;
}

#explanation-max-trainings {
    position: relative;
    width: 85%;
    display: inline-block;
    font-size: 0.7em;
    vertical-align: bottom;
    top: -1px;
}

#progress {
    width: 80%;
    height: 10px;
    margin: 0 auto;
    border: 1px solid #fff;
    border-radius: 2px;
}

#progress-bar {
    height: 100%;
    width: 0;
    background: #123456;
}

.chemistry {
    color: #577f96;
}

#window-chemistry input[type='radio'] {
    width: auto;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
}

label {
    margin-right: 10px;
    margin-left: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

#overlay {
    background: rgba(0, 0, 0, 0.9);
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: none;
}

#overlay #message-cookie {
    position: relative;
    color: #fff;
    font-weight: bold;
    width: 70%;
    margin: 0 auto;
    line-height: 2em;
    font-size: 1em;
    padding: 10px;
}

#overlay #overlay-content {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

#overlay #message-cookie {
    margin-top: 2vh;
}

#overlay #close-button {
    position: relative;
    margin: 2vh auto 0;
    width: 10%;
}

#overlay #close-message {
    font-size: 1.5em;
    padding: 5px;
}
