/*
 * Exercise-specific styles
 * Consolidated styles for all exercise types: cards, vocabulary, fill-in-the-gaps, review items
 */

/* =================================================================
   EXERCISE CARDS
   ================================================================= */

.exercise-card {
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(0,0,0,0.125);
    border-radius: 0.5rem;
    height: 100%;
}

.exercise-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--bs-gray-400);
}

.exercise-card:active {
    transform: translateY(0);
}

.exercise-card .text-preview {
    font-size: 0.9rem;
    color: #6c757d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.exercise-component-card {
    margin-bottom: 1rem;
}


/* =================================================================
   REVIEW ITEMS
   ================================================================= */

.review-item {
    border: 1px solid rgba(0,0,0,0.125);
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.review-item.correct {
    border-color: var(--bs-success);
    background-color: rgba(25, 135, 84, 0.05);
}

.review-item.incorrect {
    border-color: var(--bs-danger);
    background-color: rgba(220, 53, 69, 0.05);
}

.review-item.pending {
    border-color: var(--bs-warning);
    background-color: rgba(255, 193, 7, 0.05);
}

.review-item .status-badge {
    font-size: 0.75rem;
}

.review-item .review-actions .btn {
    font-size: 0.875rem;
}

/* =================================================================
   VOCABULARY EXERCISE
   ================================================================= */

/* Toast notification styles */
.exercise-toast {
    padding: 0.5rem 0.75rem;
    border-radius: 50%; /* Changed from 1.5rem to 50% for perfect circles */
    color: white;
    width: 50px;        /* Fixed width */
    height: 50px;       /* Added fixed height equal to width */
    text-align: center;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
    animation: toast-in 0.3s ease forwards;
    pointer-events: none; /* Doesn't interfere with clicks */
    display: flex;        /* Added flex to center content */
    align-items: center;  /* Added to center content vertically */
    justify-content: center; /* Added to center content horizontally */
}

.exercise-toast.success {
    background-color: #28a745; /* Green */
}

.exercise-toast.error {
    background-color: #dc3545; /* Red */
}

.exercise-toast.hiding {
    animation: toast-out 0.3s ease forwards;
}

.exercise-toast .toast-body {
    padding: 0;           /* Removed padding to let flex centering work */
    text-align: center;
    font-weight: bold;    /* Make the +1/-1 more visible */
    font-size: 1rem;    /* Slightly smaller to fit better in circle */
    line-height: 1;       /* Tight line height for better centering */
}

/* Icon column: shrink to fit content width, no reflow when rows are added. */
.exercise-error-table table th:first-child,
.exercise-error-table table td:first-child {
    width: 1px;
    white-space: nowrap;
}

.vocabulary-errors-table .error-type-column {
    width: 50px;
}

.vocabulary-errors-table .vocabulary-word {
    font-weight: 400;
}

/* Specific adjustments for the word column */
.vocabulary-errors-table .vocabulary-word-column {
    width: 30%;
}

/* Animations: simple fade in and out with no movement */
@keyframes toast-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes toast-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* =================================================================
   FILL-IN-THE-GAPS EXERCISE
   ================================================================= */

/* Sentence container: block flow so spans and inputs wrap naturally as inline text. */
.fitg-sentence {
    line-height: 2.4; /* Extra line-height to give inputs vertical room without clipping. */
}

/* Gap text inputs: inline-block so they sit in the text flow. */
.fitg-gap-input {
    display: inline-block;
    vertical-align: middle;
    width: 7rem;
    margin: 0 0.5rem;
}

/* Gap select dropdowns: inline-block, same vertical alignment. */
.fitg-gap-select {
    display: inline-block;
    vertical-align: middle;
    width: auto;
    margin: 0 1rem;
}

/* =================================================================
   INPUT ANSWER MARKING (InputAnswerMarker utility)
   ================================================================= */

/* Correct answer: green border and subtle green background. */
.input-correct {
    border-color: var(--bs-success) !important;
    background-color: var(--bs-success-bg-subtle) !important;
}

/* Incorrect answer: red border and subtle red background. */
.input-incorrect {
    border-color: var(--bs-danger) !important;
    background-color: var(--bs-danger-bg-subtle) !important;
}

/* Shared icon style for exercise error/partial badges (counter + error table). */
.exercise-error-icon {
    font-size: 1.25rem;
    -webkit-text-stroke: 0.75px currentColor;
}

/* bi-x glyph sits high in its em-box without this correction. */
.bi-x.exercise-error-icon {
    line-height: 1;
}


/* Circular badge wrapper for error/partial icons in the error table. */
.exercise-error-badge {
    width: 1.75rem;
    height: 1.75rem;
}

/* =================================================================
   CHAR BAR
   ================================================================= */

.btn.char-btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50% !important;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn.char-btn:active { transform: scale(0.9); }

/* Shift active state: filled white button with primary text. */
.btn.char-btn.shift-active {
    background-color: #fff;
    color: var(--bs-primary);
}
