/* ============================================================
   Global styles — School Exams App
   ============================================================ */

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Arabic font boost */
[dir="rtl"] body {
    font-family: 'Segoe UI', 'Arial', Tahoma, Geneva, Verdana, sans-serif;
}

/* ── Cards ── */
.card {
    border: none;
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
}

/* ── Buttons ── */
.btn {
    border-radius: 8px;
    font-weight: 600;
}

/* ── Badges ── */
.badge {
    font-weight: 600;
}

/* ── Tables ── */
.table th {
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Navbar active link underline ── */
.navbar-nav .nav-link.active {
    font-weight: 700;
}

/* ── Form controls ── */
.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ── Quiz take page ── */
.quiz-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.timer-container {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    text-align: center;
}

[dir="rtl"] .timer-container {
    right: auto;
    left: 20px;
}

.timer {
    font-size: 2rem;
    font-weight: bold;
    color: #0d6efd;
}

.timer.warning { color: #fd7e14; animation: pulse 1s infinite; }
.timer.danger  { color: #dc3545; animation: pulse 0.5s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.question-number-btn {
    padding: 12px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.question-number-btn:hover      { transform: scale(1.05); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.question-number-btn.current    { background: #0d6efd; color: white; border-color: #0a58ca; }
.question-number-btn.answered   { background: #198754; color: white; border-color: #146c43; }
.question-number-btn.unanswered { background: white;   color: #666;  border-color: #dee2e6; }

.question-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
}

.option-container { margin: 12px 0; }

.option-label {
    display: flex;
    align-items: center;
    gap: 14px;              /* 👈 this replaces margin-right & RTL rule */
    padding: 14px 18px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.option-label:hover { border-color: #0d6efd; background: #f0f5ff; }
.option-label:has(input[type="radio"]:checked) { border-color: #0d6efd; background: #e7f1ff; }

.option-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}



.option-text { font-size: 1rem; flex: 1; }

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-nav {
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back   { background: #6c757d; color: white; }
.btn-next   { background: #0d6efd; color: white; }
.btn-submit { background: #198754; color: white; padding: 14px 36px; font-size: 1.05rem; }

.btn-back:hover:not(:disabled)   { background: #5c636a; }
.btn-next:hover                  { background: #0a58ca; }
.btn-submit:hover                { background: #146c43; }
.btn-nav:disabled                { opacity: 0.5; cursor: not-allowed; }

/* ── Results page ── */
.results-hero {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 30px;
}

.answer-block {
    padding: 18px 20px;
    margin-bottom: 14px;
    border-radius: 10px;
}

.answer-correct  { background: #f1f8f4; border-left: 5px solid #198754; }
.answer-wrong    { background: #fef5f5; border-left: 5px solid #dc3545; }
.answer-skipped  { background: #fff8f0; border-left: 5px solid #fd7e14; }

[dir="rtl"] .answer-correct  { border-left: none; border-right: 5px solid #198754; }
[dir="rtl"] .answer-wrong    { border-left: none; border-right: 5px solid #dc3545; }
[dir="rtl"] .answer-skipped  { border-left: none; border-right: 5px solid #fd7e14; }

/* ── Step breadcrumb ── */
.step-breadcrumb {
    background: #e9ecef;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 1rem;
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .question-grid { grid-template-columns: repeat(4, 1fr); }
    .timer-container { top: auto; bottom: 20px; right: 10px; padding: 10px 16px; }
    [dir="rtl"] .timer-container { right: auto; left: 10px; }
}
