/* Open-ended response widget - scrollable to prevent overflow */

/* Make open-ended and MCQ slides scrollable */
.open-slide,
.mcq-slide {
    overflow-y: auto !important;
}

.open-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.open-prompt {
    font-size: 0.55em;
    line-height: 1.35;
    margin-bottom: 0.5em;
    color: #e6edf3;
}

.open-context {
    font-size: 0.45em;
    color: #8b949e;
    margin-bottom: 0.4em;
    font-style: italic;
}

.open-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 120px;
    background: rgba(13, 17, 23, 0.9);
    border: 1px solid #30363d;
    border-radius: 5px;
    color: #e6edf3;
    padding: 0.4em 0.6em;
    font-size: 0.5em;
    font-family: inherit;
    line-height: 1.4;
    resize: vertical;
}
.open-textarea:focus {
    outline: none;
    border-color: #61afef;
}
.open-textarea:disabled {
    opacity: 0.6;
}

.open-actions {
    display: flex;
    gap: 0.5em;
    align-items: center;
    margin-top: 0.3em;
}

.open-submit {
    padding: 0.3em 1em;
    background: #61afef;
    color: #0d1117;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.5em;
    cursor: pointer;
    transition: background 0.15s;
}
.open-submit:hover { background: #79bff5; }
.open-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.open-char-count {
    font-size: 0.42em;
    color: #8b949e;
    margin-left: auto;
}

.open-feedback {
    margin-top: 0.3em;
    padding: 0.4em 0.6em;
    background: rgba(97, 175, 239, 0.08);
    border-left: 3px solid #61afef;
    border-radius: 0 4px 4px 0;
    font-size: 0.45em;
    line-height: 1.4;
    color: #c5dff6;
    display: none;
}
.open-feedback.show { display: block; }

.open-loading {
    font-size: 0.45em;
    color: #8b949e;
    margin-top: 0.3em;
    display: none;
}
.open-loading.show { display: block; }
.open-loading::after {
    content: '';
    animation: open-dots 1.2s steps(3, end) infinite;
}
@keyframes open-dots {
    0%   { content: '.'; }
    33%  { content: '..'; }
    66%  { content: '...'; }
}

.open-previous {
    margin-top: 0.3em;
    padding: 0.35em 0.6em;
    background: rgba(152, 195, 121, 0.08);
    border-left: 3px solid #98c379;
    border-radius: 0 4px 4px 0;
    font-size: 0.42em;
    color: #c3e6a0;
}
.open-previous .prev-label {
    font-weight: 600;
    margin-bottom: 0.2em;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .open-container { max-width: 100%; padding: 0 0.5em; }
    .open-prompt { font-size: 0.65em; }
    .open-textarea { font-size: 0.6em; min-height: 80px; }
    .open-submit { font-size: 0.6em; }
    .open-feedback { font-size: 0.55em; }
    .open-actions { flex-wrap: wrap; }
}
