/* --------- */
/* HEADER */
/* --------- */

.main-header {
    width: 100%;
    background-color: var(--background-mid);
    border-bottom: 1px solid var(--accent-base);
    padding: 10px 0;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.header-content {
    width: 900px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
    pointer-events: none;
}

.header-btn {
    padding: 8px 20px;
    background: var(--accent-base);
    color: var(--text-color);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, opacity 0.2s;
}

.header-content .header-btn:first-child {
    justify-self: start;
}

.header-content .header-btn:last-child {
    justify-self: end;
}

.header-btn:hover {
    background: var(--accent-light);
}

.header-btn.disabled,
.header-btn:disabled {
    background-color: var(--background-base);
    color: #666;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
    border: 1px solid var(--accent-base);
}

/* --------- */
/* MAIN STAGE */
/* --------- */

.main-stage {
    width: 900px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --------- */
/* LANGUAGE-CONTROLS */
/* --------- */

.language-controls {
    margin-bottom: 50px;
}

#language-select {
    padding: 8px 30px;
    background-color: var(--accent-deep);
    color: var(--text-color);
    border: 1px solid var(--accent-base);
    border-radius: var(--btn-radius);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    outline: none;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    text-align: center;
    text-align-last: center;

    background-image: url("../icons/down-arrow.svg");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

#language-select:hover {
    background-color: var(--accent-dark);
}

#language-select option {
    background-color: var(--accent-deep);
    color: var(--text-color);
    text-align: center;
}

/* --------- */
/* TYPING-CONTAINER */
/* --------- */

.typing-container {
    width: 900px;
    max-width: 100%;
    margin-bottom: 30px;
    border-radius: var(--radius);
    padding: 3px;
    background: var(--conic-gradient);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.typing-content {
    background-color: var(--background-mid);
    border-radius: calc(var(--radius) * 0.8);
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
}

#type-input {
    background-color: transparent;
    border: none;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px; 
    line-height: 1.5;
    color: var(--text-color);
    padding: 0 10px;
}

#type-input.error {
    background-color: var(--error-background);
}

.typing-separator {
    height: 1px;
    background-color: var(--accent-base);
    margin: 10px -20px 10px -20px; 
    width: calc(100% + 40px); 
    opacity: 0.75;
}

.snippet-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 8px;
}

.snippet-line {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5;
    color: #888;
    height: 23px;
    white-space: pre-wrap;
    word-break: keep-all;
    padding: 0 10px;
}

.snippet-line.active {
    color: var(--text-color);
}

/* Hidden element used for calculating line breaks */
.measure-text {
    visibility: hidden;
    position: absolute;
    white-space: pre;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    top: -9999px;
    left: -9999px;
}

/* --------- */
/* KEYBOARD */
/* --------- */

.keyboard {
    width: 900px;
    padding: 10px;
    background-color: var(--background-base);
}

.row {
    padding: 0;
    margin: 5px 0;
    list-style-type: none;
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.key {
    width: 50px;
    height: 50px;
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--radius) * 0.5);
    background: var(--conic-gradient);
    padding: 3px;
}

.key-content {
    width: 100%;
    height: 100%;
    background-color: var(--background-mid);
    transition: background-color 0.1s ease, top 0.1s ease, box-shadow 0.1s ease;
    position: relative;
    border-radius: calc(var(--radius) * 0.4);
    font-size: 14px;
    top: -2px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    z-index: 1;
    user-select: none;
    box-shadow: 0 4px rgba(0, 0, 0, 0.6);
}

.key-content:active,
.key-content.active-guide {
    top: 0px;
    box-shadow: 0 2px rgba(0, 0, 0, 0.6);
    background-color: var(--accent-light);
}

.key-content .main-char {
    font-size: 16px;
}
.key-content .sub-char {
    font-size: 12px;
    color: #888;
    position: absolute;
    top: 3px;
    right: 6px;
}

#tilde { width: 40px; }
#del { width: 80px; }
#tab { width: 75px; }
#caps { width: 85px; }
#enter { width: 85px; }
#slash { width: 65px; }
#shift { width: 115px; }
#shift2 { width: 130px; }
#space { width: 320px; }
#left-hiden { 
    width: 246px;
    visibility: hidden;
}
#right-hiden { 
    width: 306px;
    visibility: hidden;
}