/* === exercises.css — Quiz & Exercise Styling === */

/* --- Exercise Container --- */
.exercise-container {
    max-width: 700px;
    margin: 0 auto;
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e8f5e9;
}

.exercise-progress {
    font-size: 0.9rem;
    color: #6b7280;
}

.exercise-progress .current {
    font-weight: 700;
    color: #1a5632;
}

/* --- Progress Bar --- */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2d8a4e, #4caf50);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* --- Question Card --- */
.question-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #1a1a2e;
}

.question-text .urdu-inline {
    font-size: 1.5rem;
}

/* --- Multiple Choice --- */
.mcq-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mcq-option {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    background: #fff;
}

.mcq-option:hover {
    border-color: #2d8a4e;
    background: #f0fdf4;
}

.mcq-option.selected {
    border-color: #2d8a4e;
    background: #e8f5e9;
}

.mcq-option.correct {
    border-color: #16a34a;
    background: #dcfce7;
    color: #15803d;
}

.mcq-option.incorrect {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}

.mcq-option.correct::before {
    content: '\2713';
    margin-right: 0.75rem;
    font-weight: 700;
    color: #16a34a;
}

.mcq-option.incorrect::before {
    content: '\2717';
    margin-right: 0.75rem;
    font-weight: 700;
    color: #dc2626;
}

.mcq-option .option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f0f0;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.mcq-option .option-urdu {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.6rem;
    line-height: 2.2;
    direction: rtl;
}

/* --- Matching Exercise --- */
.matching-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.matching-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.matching-column-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8e8e8;
}

.matching-item {
    padding: 0.75rem 1rem;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matching-item:hover {
    border-color: #2d8a4e;
    background: #f0fdf4;
}

.matching-item.selected {
    border-color: #2d8a4e;
    background: #e8f5e9;
    box-shadow: 0 0 0 2px rgba(45, 138, 78, 0.2);
}

.matching-item.matched {
    border-color: #16a34a;
    background: #dcfce7;
    cursor: default;
    opacity: 0.7;
}

.matching-item.wrong {
    border-color: #dc2626;
    background: #fef2f2;
    animation: shake 0.4s;
}

.matching-item .urdu-text {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.8rem;
    line-height: 2.2;
    direction: rtl;
}

/* --- Fill in the Blank --- */
.fill-blank-sentence {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 6px;
}

.fill-blank-sentence .blank {
    display: inline-block;
    min-width: 100px;
    border-bottom: 2px dashed #2d8a4e;
    margin: 0 0.25rem;
    text-align: center;
}

.fill-blank-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.fill-blank-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.fill-blank-input:focus {
    outline: none;
    border-color: #2d8a4e;
}

.fill-blank-input.correct {
    border-color: #16a34a;
    background: #f0fdf4;
}

.fill-blank-input.incorrect {
    border-color: #dc2626;
    background: #fef2f2;
}

.fill-blank-hint {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-style: italic;
}

/* --- Word Order Exercise --- */
.word-tiles-source {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 60px;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.word-tiles-target {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 60px;
    padding: 1rem;
    background: #f0fdf4;
    border: 2px dashed #c8e6c9;
    border-radius: 8px;
    margin-bottom: 1rem;
    direction: rtl;
}

.word-tile {
    padding: 0.5rem 1rem;
    background: #fff;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.4rem;
    line-height: 2;
    direction: rtl;
}

.word-tile:hover {
    border-color: #2d8a4e;
    background: #e8f5e9;
}

.word-tile.placed {
    opacity: 0.3;
    cursor: default;
}

/* --- True/False --- */
.tf-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.tf-option {
    flex: 1;
    max-width: 200px;
    padding: 1rem;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.tf-option:hover {
    border-color: #2d8a4e;
}

.tf-option.correct {
    border-color: #16a34a;
    background: #dcfce7;
}

.tf-option.incorrect {
    border-color: #dc2626;
    background: #fef2f2;
}

/* --- Check / Submit Button --- */
.check-btn {
    display: block;
    width: 100%;
    padding: 0.85rem;
    background: #1a5632;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.check-btn:hover {
    background: #2d8a4e;
}

.check-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* --- Feedback Message --- */
.feedback {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-weight: 500;
    display: none;
}

.feedback.show {
    display: block;
}

.feedback.correct {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.feedback.incorrect {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* --- Results Screen --- */
.results-screen {
    text-align: center;
    padding: 2rem;
}

.results-score {
    font-size: 3rem;
    font-weight: 700;
    color: #1a5632;
    margin: 1rem 0;
}

.results-message {
    font-size: 1.1rem;
    color: #374151;
    margin-bottom: 1.5rem;
}

.results-breakdown {
    text-align: left;
    max-width: 400px;
    margin: 1.5rem auto;
}

.results-breakdown .result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* --- Animations --- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-card {
    animation: fadeIn 0.3s ease;
}
