﻿:root {
    --font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --body-color: #212529;
    --body-bg: #fff;
    --title-letter-border-color: rgb(70 70 70);
    --title-letter-completed-color: green;
    --answer-input-color: #212529;
    --answer-input-bg: #fff;
    --answer-input-border-color: #000;
}

@media (prefers-color-scheme: dark) {
    :root {
        --body-color: rgb(230 230 230);
        --body-bg: rgb(50 50 50);
        --title-letter-border-color: rgb(150 150 150);
        --title-letter-completed-color: rgb(100 255 100);
        --answer-input-color: rgb(230 230 230);
        --answer-input-bg: rgb(50 50 50);
        --answer-input-border-color: rgb(150 150 150);
    }
}

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

button, input, optgroup, select, textarea {
    margin: 0;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: var(--body-color);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    background-color: var(--body-bg);
    -webkit-text-size-adjust: 100%;
}

/* Training UI */
.title-letter {
    font-weight: lighter;
    text-transform: uppercase;
    margin-right: 2px;
    margin-left: 2px;
    padding-bottom: .25rem;
    padding-right: .5rem;
    padding-left: .5rem;
    position: relative;
    border-bottom: var(--title-letter-border-color) 5px solid;
}

.title-letter[data-active-letter="true"] {
    transition: transform 0.1s ease-in-out;
    transform: translateY(-5px);
    cursor: pointer;
}

.title-letter[data-completed-letter="true"] {
    border-bottom: var(--title-letter-completed-color) 5px solid;
    color: var(--title-letter-completed-color);
}

.title-letter[data-invalid-letter="true"] {
    border-bottom: none;
}

#answer-input {
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--answer-input-color);
    background-color: var(--answer-input-bg);
    background-clip: padding-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    border-bottom: 2px dotted var(--answer-input-border-color);
    outline: none;
    text-align: center;
    font-family: monospace;
    text-transform: uppercase;
}

#content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

#title {
    display: flex;
    flex-wrap: wrap;
    margin: 0 4rem .5rem 4rem;
    user-select: none;
    font-family: var(--font-monospace), monospace;
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1.2;
}

#title-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

#answer-container {
    width: 176px;
    margin-top: 5vh;
}

#answer-input-label {
    display: none;
}

.nato-table-button {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1001;
    padding: .5rem .75rem;
    border: 1px solid var(--answer-input-border-color);
    background: var(--answer-input-bg);
    color: var(--body-color);
    border-radius: .5rem;
    cursor: pointer;
}

#nato-table-container[hidden] {
    display: none;
}

#nato-table-container {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.nato-modal {
    background: var(--answer-input-bg);
    color: var(--body-color);
    border: 1px solid var(--answer-input-border-color);
    border-radius: .75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    max-width: 560px;
    width: 90vw;
    max-height: 85vh;
    overflow: auto;
    padding: 1rem;
}

.nato-table {
    width: 100%;
    border-collapse: collapse;
}

.nato-table th, .nato-table td {
    border: 1px solid var(--answer-input-border-color);
    padding: .1rem .6rem;
}

.nato-table th {
    text-align: left;
}

@media (max-width: 600px) {
    .nato-modal {
        width: 96vw;
        max-height: 92vh;
        padding: .75rem;
    }
}
