/* ============================================================
   PYQ MOCK TEST — MOBILE AUDIT FIXES (Phase 5)
   Loaded only on page-mock-test.php via class-frontend-manager.
   Append-only — no rules in this file conflict with the inline
   <style> block inside page-mock-test.php; we only OVERRIDE the
   gaps the mobile audit found.
   ============================================================ */

/* ============================================================
   P1 — Question palette grid (1, 2, 3... numbered buttons)
   Original: grid-template-columns: repeat(5, 1fr) — too cramped on phones.
   ============================================================ */

@media (max-width: 640px) {
    .palette-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .palette-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .p-btn {
        min-height: 44px;
    }
}

@media (max-width: 380px) {
    .palette-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================================
   P2 — Sidebar width: never overflow viewport on tiny phones
   Original: width: 300px (clipped on 320px screens).
   ============================================================ */

@media (max-width: 480px) {
    .test-sidebar {
        width: min(calc(100vw - 48px), 300px) !important;
    }
}

/* ============================================================
   P3 — Footer action buttons meet 44px touch target
   Original: 5 buttons in flex row, ~32px tall.
   ============================================================ */

@media (max-width: 640px) {
    .test-footer {
        gap: 6px;
        padding: 0 8px;
    }
    .btn-nav {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Footer becomes a 2-row grid on small phones for clean tap zones */
    .test-footer {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        height: auto;
        padding: 8px 10px;
    }
    .btn-nav {
        padding: 12px 8px;
        font-size: 11px;
        white-space: nowrap;
    }
}

@media (max-width: 380px) {
    .btn-nav {
        font-size: 10px;
        padding: 11px 6px;
    }
}

/* ============================================================
   P4 — Test header (exam name + timer + submit)
   Original: 3 items fight for space; exam name truncates.
   ============================================================ */

@media (max-width: 480px) {
    .test-header {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 8px;
    }
    .test-header-left,
    .test-exam-name {
        flex: 1 1 100%;
        min-width: 0;
    }
    .timer-box {
        font-size: 14px;
        padding: 5px 10px;
    }
    .btn-submit-test {
        padding: 7px 12px;
        font-size: 12px;
    }
}

@media (max-width: 380px) {
    .test-header {
        padding: 6px 10px;
    }
    .timer-box {
        font-size: 13px;
    }
    .btn-submit-test {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* ============================================================
   P5 — Question + option font sizing for readability
   Slight reduction (1px) helps Hindi/Devanagari text breathe.
   ============================================================ */

@media (max-width: 480px) {
    .test-q-text {
        font-size: 15px;
    }
    .opt-text {
        font-size: 14px;
    }
    .opt-circle {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    .intro-stat-val {
        font-size: 18px;
    }
}

/* ============================================================
   Bonus — Result tools sticky-bar overlap fix on mobile
   Original: position:sticky bar covers first solution card on scroll.
   ============================================================ */

@media (max-width: 480px) {
    .sol-card {
        scroll-margin-top: 110px;
    }
}
