@keyframes pulse {
    0% { transform: scale(1, 1); }
    50% { transform: scale(0.8, 0.8); }
    100% { transform: scale(1, 1); }
}

/* layout */
div#columns {
    display: flex;
    flex: 1;
    height: 100%;
    position: relative;
}

div#score, div#exercise {
    box-sizing: border-box;
}

div#score {
    width: 215px;
    padding: 8px;
    flex-shrink: 0;
}

div#exercise {
    flex: 1;

    padding-bottom: 30px;
}

/* score block styling */
#score.READ {
    background-color: var(--color-exercise-read-background);
    color: var(--color-exercise-read-text);
}
#score.ANSWER {
    background-color: var(--color-exercise-answer-background);
    color: var(--color-exercise-answer-text);
}
#score.DESCRIBE {
    background-color: var(--color-exercise-describe-background);
    color: var(--color-exercise-describe-text);
}
#score.DETERMINE {
    background-color: color-mix(in srgb, var(--color-exercise-determine) 30%, transparent);
    color: var(--color-exercise-determine-text);
}

.score tr td,
.score tr th {
    border: none;
    font-size: 10pt;

    padding: 6px 0;
    margin: 0;
}

.score .value {
    text-align: right;
    font-weight: bold;
    font-size: 11pt;
}

.score .pronunciation {
    font-weight: bold;
}

.score tr.heading td {
    font-weight: bold;
    font-size: 12pt;
}

.score tr.separator td {
    height: 1px;
    padding: 0;
}
#score.READ .score tr.separator td {
    background-color: var(--color-exercise-read);
}
#score.ANSWER .score tr.separator td {
    background-color: var(--color-exercise-answer-text);
}

/* exercise chat */
div#exercise {
    position: relative;
}

div#exercise * {
}

div#exercise::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-image: url('../img/chat-bg-abstract.jpg');
    background-repeat: repeat;
    background-size: 25%;
    opacity: 0.3;

    z-index: -2; /* Place the pseudo-element behind the content */
}

#exercise::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #D35400FF;
    opacity: 0.04;
    z-index: -1; /* Place the overlay between the background image and the content */

    text-align: center;
}

div#exercise h1 {
    margin: 0;
    padding: 10px 20px;
    font-size: 20pt;
    font-weight: 600;

    border-bottom: 1px solid var(--color-verylightgray);
    background-color: #FFFFFF;
}

div#exercise *[author="lexorate"],
div#exercise *[author="student"] {
    display: block;
    padding: 5px 10px;
    min-width: 60px;
    max-width: 70%;
    border-radius: 10px;
    font-size: 12pt;
    clear: both;
    margin-top: 10px;
    margin-bottom: 0;
}

div#exercise *[author="lexorate"] {
    margin-left: 20px;
    background-color: #FFFFFF;
    float: left; /* Align to the left */

}
div#exercise *[author="student"] {
    margin-right: 20px;
    float: right;
    position: relative;
}
div#exercise.READ *[author="student"] {
    background-color: var(--color-exercise-read-background);
}
div#exercise.ANSWER *[author="student"] {
    background-color: var(--color-exercise-answer-background);
}
div#exercise.DESCRIBE *[author="student"] {
    background-color: var(--color-exercise-describe-background);
}

div#exercise *[author="lexorate"] h4,
div#exercise *[author="student"] h4 {
    margin: 0;
    padding: 0;
    font-weight: bold;
    font-size: 12pt;
}

div#exercise span.translation {
    font-style: italic;
    display: block;
    font-size: 80%;
}

div#exercise #textToAnalyze {
    font-weight: bold;
}

div#exercise #analyzer img {
    transition: transform 0.3s ease-in-out;
    cursor: zoom-in;
}
div#exercise #analyzer img.zoomed {
    position: fixed;
    top: 50%;
    left: 0;
    width: 100vw;
    border: 5px solid white;

    transform: translateY(-50%);

    object-fit: cover; /* Ensure the image covers the entire screen */
    z-index: 9999;
    cursor: zoom-out; /* Indicate the ability to zoom out */
    transition: transform 0.3s ease-in-out;
}
/* Overlay style */
div#exercise #analyzer #overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black */
    z-index: 9998; /* Just below the zoomed image */
}

/* Show overlay when image is zoomed */
div#exercise #analyzer img.zoomed + div#exercise #analyzer #overlay {
    display: block;
}

/* assessment */
div#exercise #analyzer .assessment p.score {
    font-weight: bold;
    font-size: 20pt;
}

/* recording behavior */

#recording {
    width: 100px;
    cursor: pointer;
    display: none;
}

#recording.disabled {
    cursor: not-allowed;
    color: lightgray;
}

#recording iconify-icon {
    display: block;
    height: 48px;
    width: 48px;
}

#recording.enabled iconify-icon {
    color: red;
    animation: pulse 1.5s linear infinite;
}

#language {
    text-align: center;
    position: absolute;
    top: 15px;
    right: 25px;
}

iconify-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
}

a.button.exercise {
    border-radius: 20px;
    padding: 0.5rem 2rem;
    height: auto;
    line-height: normal;
}

a.button.exercise:hover {
    background-color: #606c76 !important;
    border-color: #606c76 !important;
    color: white !important;
}

a.button.exercise[type="READ"] {
    background-color: var(--color-exercise-read);
    border-color: var(--color-exercise-read);
}

a.button.exercise[type="ANSWER"] {
    background-color: var(--color-exercise-answer);
    border-color: var(--color-exercise-answer);
    color: black;
}

a.button.exercise[type="DESCRIBE"] {
    background-color: var(--color-exercise-describe);
    border-color: var(--color-exercise-describe);
}

a.button.exercise[type="DETERMINE"] {
    background-color: var(--color-exercise-determine);
    border-color: var(--color-exercise-determine);
}

#options {
    text-align: center;
}

#options a.button.exercise {
    padding: 0.9rem 2.4rem;
    margin: 0 10px 20px 0;
    font-size: 1.2rem;
}

/**/
.assessment div.word {
    display: inline-block;
    margin: 4px 5px;
    position: relative;
    color: black;
}

.assessment div.word.missed {
    color: gray;
    font-weight: normal;
    background: lightgray;
}
.assessment div.word.missed:before { content: '['; }
.assessment div.word.missed:after { content: ']'; }


.assessment div.word.mispronounced {
    font-style: italic;
    text-decoration: underline;
    text-decoration-style: wavy;
}

.assessment div.word.perfect {
    font-weight: bold;
    color: darkgreen;
}

.assessment div.word.almost {
    color: darkgreen;
}

.assessment div.word.imperfect {
    font-weight: bold;
    color: darkred;
}

.assessment div.word div.phonemes {
    display: none;

    position: absolute;
    top: -20px;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgb(244, 227, 130);
    border-radius: 3px;
    padding: 5px;
    white-space: nowrap;
}

.assessment div.word div.phonemes h5 {
    margin: 0;
    padding: 0;
    font-size: 12pt;
    font-weight: bold;
    font-style: initial;
}

.assessment div.word div.phonemes span {
    margin: 0 3px;
}

#textToAnalyze {
    cursor: help;
    position: relative;
}

#clickToPlay {
    display: none;
    position: absolute;
    padding: 5px 15px;
    border-radius: 5px;
    background: #a7dcff;
}

@media only screen and (max-width: 600px) {
    div#score {
        display: none;
    }
    div#exercise {
        width: 100%;
        min-height: calc(100vh - 40px);
    }
}

#exercise #result {
    display: none;
}

#exercise #analyzer *[author="lexorate"] a {
    font-size: 10pt;
}

#templates {
    display: none;
}

/* history */

div.assessment-summary {
    display: flex;
    margin-bottom: 10px;
    padding: 5px;
    border-radius: 5px;

    background-color: var(--color-verylightgray);

    position: relative;
}

div.assessment-summary.best {
    background-color: var(--color-message-success-bg);
}
div.assessment-summary.overdue {
    font-style: italic;
}

div.assessment-summary div.result {
    width: calc(100% - 100px);
    font-size: 10pt;
}

div.assessment-summary .actions {
    width: 100px;
    text-align: right;
    font-size: 10pt;
}

div.assessment-summary div.created {
    position: absolute;
    bottom: 5px;
    right: 5px;
}
