/* Main Containers*/
body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    background-color: #080d13;
    color: #b3c2d6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

header {
    box-sizing: border-box;
    color: #d9ebe6;
    width: 100%;
    max-width: 1100px;
    padding: 0.5em 0.5em 0 0.5em;
    margin: 0 0 -8px 0;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    border-bottom: 2px solid #030e1e;
}

#header-container {
    border-radius: 12px 12px 0 0;
    width: 100%;
    max-width: 1100px;
    margin: 0 0 0 0;
    
}

/* Container of the UI and the Canvas (i.e. the complete JS controlled interface)*/
#app-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 1100px;
    padding: 0 0.5em 0 0.5em;
    margin: 0 0.2em 0.2em 0.2em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}


/* Panel with all UI elements*/
#ui-panel {
    width: 100%;
}

/* Panel with the interactive canvas*/
#canvas-wrapper {
    background: #202e49;
    height: 450px;
    width: 100%;
    border: none;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

#glyph-canvas {
    flex: 1 1 100%;
    width: 100%;
    height: 100%;
    display: block;
}
/* Not sure what this is */
pre {
    background: #18243a;
    color: #e3f0ff;
    padding: 10px;
    border-radius: 8px;
    overflow: auto;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
    font-size: 0.95em;
}

/* Not sure what this is */
footer {
    color: #6d87a5;
    margin-top: 24px;
    margin-bottom: 50px;
    margin-left: 30px;
    margin-right: 30px;
    font-size: 0.92em;
    display: flex;
    flex-wrap: wrap;
    justify-content:  center;
    gap: 1em;
    
}

/* ------------------------------------------------------------- */
/*                           UI ELEMENTS                         */
/* ------------------------------------------------------------- */

.menu-div {
    box-sizing: border-box;
    width: 100%;
    margin: 0.7em 0 0.7em 0;
    padding: 0.5em;
    gap: 0.5em;
    min-width: 150px;

    background-color:#0f1923;
    border: 1px solid #152531;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
    padding: 5px 5px 5px 5px;
    
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
#toolbar-overlay {
    background-color: #7f7f7f17;
    height: 60px;
    margin-top: -60px;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
    border: none;
}
@media screen and (max-width: 407px) {
    #toolbar-overlay {
        height: 120px;
        margin-top: -120px;
    }
}
#sentence-preview {
    color: #e3f0ff;
    min-height: 3em;
    border-radius: 0 0 8px 8px;
    margin-top: -8px;

    align-items: center;
    justify-content: center;
    text-align: center;

    font-size: 1.08em;
    font-weight: 400;
}

/* ----------------- Sentence parsing sectiona ----------------------- */
#parse-section {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1 1 70%;
    max-width: 800px;
    min-width: 10px; 
    align-items: center;
    justify-content: stretch;
    flex-wrap: wrap;
}
#sentence-input {
    flex: 1 1 0;            /* let input grow to fill space */
    min-width: 100px;        /* don’t let it get too small */
    max-width: 100%;        /* don’t overflow */
}
#import-export-container {
    margin-left: auto;
    display: flex;
}

/* ----------------- Wordmanager Section ----------------------- */
.word-manager {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.word-field {
    display: flex;
    flex-direction: column;
    min-width: 105px;
    max-width: 150px;
    align-items: center;
    flex: 1 1 0;
    text-align: center;
}
.word-field label {
    font-size: 0.95em;
    color: #b3c2d6;
    margin-bottom: 4px;
    font-weight: 500;
    text-align: center;
}

.button-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3em;
    align-items: center;
}

/* ----------------- Toolbar Section ----------------------- */

.toolbar-group {
    display: flex;
    flex-wrap: wrap;
    flex: 1 1 50%;
    max-width: 500px;
    justify-content:  space-evenly;
    gap: 0.1em;
    align-items: center;
}
.toolbar-group > * {
    flex: 1 1 0;
    min-width: 190px;
    max-width: 400px;   /* optional: controls max stretch */
}