/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: 'Georgia', serif;
    color: #5b4636;
    overflow: auto;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Main Section (70%) */
.main-section {
    /* Left side: 70% width, full height */
    width: 70%;
    height: 100%;
    min-height: 0;
    /* enable child shrink */
    display: flex;
    flex-direction: column;
    background-color: #fdf5e6;
    position: relative;
    /* for absolute footer */
    padding-bottom: 60px;
    /* space for toolbar */
}

/* Info Section (30%) */
.info-section {
    flex: 0 0 30%;
    background-color: #fbf0d9;
    padding: 20px;
    overflow-y: auto;
    height: 100%;
}

/* Align bullets with text */
.info-section ul, .info-section ol {
    padding-left: 1em;
    margin-left: 0;
}

.info-section li {
    margin-left: 0.5em;
}

/* Header */
.app-header {
    background-color: #e8d1a6;
    color: #5b4636;
    text-align: center;
    flex-shrink: 0;
    height: 60px;
    line-height: 60px;
    /* center h2 vertically */
}

/* Submission History */
.history {
    /* Positioned between header and form+toolbar without flex */
    position: absolute;
    top: 60px;
    /* below header */
    bottom: 110px;
    /* above form (50px) + toolbar (60px) */
    left: 0;
    right: 0;
    overflow-y: auto;
    /* enable scrolling */
    padding: 16px;
    background-color: #f5e8d0;
}

.entry {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.entry+.entry {
    border-top: 2px solid #8b6e4a;
    padding-top: 12px;
    margin-top: 12px;
}

/* Audio Player in Entry */
.entry audio {
    flex: 0 0 30%;
    max-width: 100%;
    margin: 0;
}

/* Word Scores (Text Column) */
.entry .sentence {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
}

.entry .sentence span {
    position: relative;
    cursor: pointer;
    margin-right: 0.5em;
    padding: 0 2px;
    border-bottom: 3px solid;
    transform: translateY(-2px);
}

.entry .sentence span.green {
    border-color: green;
}

.entry .sentence span.yellow {
    border-color: goldenrod;
}

.entry .sentence span.red {
    border-color: red;
}

.entry .sentence span.grey {
    color: #888;
    border-bottom: none;
}

.tippy-box .tippy-content span {
    padding: 2px 4px;
    display: inline-block;
    margin-top: .10rem;
    margin-bottom: .10rem;
}

span.phoneme-green {
    background-color: green;
}

span.phoneme-yellow {
    background-color: goldenrod;
}

span.phoneme-red {
    background-color: red;
}

#infoSection .green {
    color: green;
}

#infoSection .yellow {
    color: goldenrod;
}

#infoSection .red {
    color: red;
}

/* Submission Form */
.submission-form {
    position: absolute;
    height: 50px;
    /* fixed form height */
    bottom: 60px;
    /* right above toolbar */
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background-color: #f5e3b3;
    border-top: 1px solid #dcc9a1;
}

.submission-form input[type="text"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
    outline: none;
    background-color: #fff;
}

.submission-form .word-count {
    margin-left: 12px;
    font-size: 12px;
    color: #5b4636;
}

/* Recording Toolbar */
.record-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background-color: #e8d1a6;
    flex-shrink: 0;
    height: 60px;
    overflow: hidden;
    position: absolute;
    /* stick to bottom */
    bottom: 0;
    left: 0;
    right: 0;
}

.record-toolbar button {
    margin-right: 12px;
    padding: 6px 12px;
    border: 1px solid #5b4636;
    background-color: #fbf0d9;
    cursor: pointer;
    font-size: 14px;
}

.record-toolbar #submitRecord {
    margin-left: auto;
    font-weight: bold;
}

.record-toolbar .timer {
    font-size: 14px;
    color: #5b4636;
}

.record-toolbar audio {
    margin-left: 12px;
    max-height: 100%;
}
