/* KlasChat Exercise Components */

/* Exercise container */
.exercise-container {
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin: 0.75rem 0;
    max-width: 100%;
}

.exercise-container.correct {
    border-color: #27AE60;
    background: #f0fdf4;
}

.exercise-container.incorrect {
    border-color: #E74C3C;
    background: #fef2f2;
}

/* Number Line (Canvas-based — old SVG rules removed) */
.number-line-answer {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

/* Clock */
.clock-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.clock-canvas {
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.clock-display {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
    min-height: 1.5em;
}

.clock-input-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.clock-input-row input {
    width: 3rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.3rem;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
}

.clock-input-row span {
    font-size: 1.3rem;
    font-weight: 700;
}

/* Calendar */
.calendar-wrap {
    max-width: 320px;
    margin: 0 auto;
}

.calendar-header {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    padding: 0.25rem;
    text-transform: uppercase;
}

.calendar-day {
    text-align: center;
    padding: 0.4rem 0.2rem;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.calendar-day:hover {
    background: #ebf4ff;
    transform: scale(1.05);
}

.calendar-day.selected {
    background: #4A90D9;
    color: #fff;
    font-weight: 700;
}

.calendar-day.empty {
    cursor: default;
    pointer-events: none;
}

.calendar-day.today {
    border: 2px solid #4A90D9;
}

/* Multiple Choice */
.mc-buttons-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.mc-btn {
    min-width: 80px;
    min-height: 48px;
    padding: 0.5rem 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    background: #fff;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.mc-btn:hover:not(:disabled) {
    border-color: #4A90D9;
    background: #ebf4ff;
    transform: translateY(-1px);
}

.mc-btn:active:not(:disabled) {
    transform: translateY(0);
}

.mc-btn.correct {
    border-color: #27AE60;
    background: #d4edda;
    color: #155724;
}

.mc-btn.incorrect {
    border-color: #E74C3C;
    background: #f8d7da;
    color: #721c24;
}

.mc-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

/* Dice Net */
.dice-net-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.dice-net-svg {
    max-width: 280px;
}

.dice-face {
    fill: #fff;
    stroke: #2d3748;
    stroke-width: 2;
    cursor: pointer;
    transition: fill 0.15s;
}

.dice-face:hover {
    fill: #ebf4ff;
}

.dice-face.selected {
    fill: #4A90D9;
    stroke: #2b6cb0;
}

.dice-face.correct {
    fill: #d4edda;
    stroke: #27AE60;
}

.dice-face.incorrect {
    fill: #f8d7da;
    stroke: #E74C3C;
}

.dice-dot {
    fill: #2d3748;
    pointer-events: none;
}

.dice-face.selected .dice-dot,
.dice-face.correct .dice-dot {
    fill: #fff;
}

/* Exercise feedback */
.exercise-feedback {
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.exercise-feedback.correct {
    background: #d4edda;
    color: #155724;
}

.exercise-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
}

/* Exercise submit button */
.exercise-submit-btn {
    display: block;
    margin: 0.75rem auto 0;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background: #4A90D9;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    min-height: 44px;
    min-width: 120px;
}

.exercise-submit-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
}

.exercise-submit-btn:active {
    transform: translateY(0);
}

.exercise-submit-btn:disabled {
    background: #a0aec0;
    cursor: default;
    transform: none;
}

/* Progress indicator */
.exercise-progress-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.exercise-progress-fill {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.exercise-progress-fill-inner {
    height: 100%;
    background: #4A90D9;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.exercise-progress-text {
    font-size: 0.8rem;
    color: #718096;
    white-space: nowrap;
}

/* Stars */
.exercise-stars {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 0.25rem;
}

.exercise-star {
    font-size: 1.2rem;
    opacity: 0.3;
}

.exercise-star.earned {
    opacity: 1;
}

/* Responsive */
@media (max-width: 480px) {
    .exercise-container {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }

    .mc-btn {
        min-width: 60px;
        padding: 0.4rem 0.8rem;
        font-size: 1rem;
    }

    .clock-canvas {
        width: 180px;
        height: 180px;
    }

    .calendar-wrap {
        max-width: 280px;
    }
}

/* Self-Assessment Flower Picker */
.sa-wrapper {
    padding: 1rem;
    margin: 0.75rem 0;
}

.sa-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.75rem;
}

.sa-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.sa-btn {
    min-width: 100px;
    min-height: 56px;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 3px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.sa-btn:hover:not(:disabled) {
    border-color: #4A90D9;
    background: #ebf4ff;
    transform: translateY(-2px);
}

.sa-btn.sa-selected {
    border-color: #27AE60;
    background: #d4edda;
    color: #155724;
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .sa-btn {
        min-width: 80px;
        min-height: 48px;
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
    }
}

/* Open Input Component — child types the answer */
.open-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
}

.open-input-question {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1E2D3B;
    font-family: 'Baloo 2', cursive, sans-serif;
    letter-spacing: 0.05em;
}

.open-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.open-input-field {
    width: 100px;
    height: 56px;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Baloo 2', cursive, sans-serif;
    text-align: center;
    border: 3px solid #2c3e50;
    border-radius: 12px;
    outline: none;
    color: #2c3e50;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.open-input-field:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.open-input-field:disabled {
    background: #f0f0f0;
    color: #888;
}

.open-input-submit {
    height: 56px;
    padding: 0 1.2rem;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Baloo 2', cursive, sans-serif;
    background: #27ae60;
    color: #fff;
    border: 3px solid #1e8449;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 3px 0 #1e8449;
    transition: background 0.15s, transform 0.1s;
}

.open-input-submit:hover { background: #2ecc71; }
.open-input-submit:active { transform: translateY(2px); box-shadow: 0 1px 0 #1e8449; }
.open-input-submit:disabled { background: #95a5a6; border-color: #7f8c8d; cursor: not-allowed; }

@media (max-width: 480px) {
    .open-input-question { font-size: 1.3rem; }
    .open-input-field { width: 80px; height: 48px; font-size: 1.3rem; }
    .open-input-submit { height: 48px; font-size: 1rem; }
}
