/* ────────────────────────────────────────────────────────────────
   GrowMath Quiz Manager — Frontend Styles
   Extends your existing .gm-* dashboard classes.
   ──────────────────────────────────────────────────────────────── */

/* ── SECTION WRAPPER ─────────────────────────────────────────── */
.gm-quiz-section {
    width: 100%;
}

/* ── ROLE BADGE ──────────────────────────────────────────────── */
.gm-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4a5568;
    background: #f0f4f9;
    border: 1px solid #e4eaf3;
    border-radius: 20px;
    padding: 5px 14px;
    margin-bottom: 20px;
}
.gm-role-badge strong { color: #1a3a5c; }

/* ── GRID (inherited from dashboard, extended here) ──────────── */
.gm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

/* ── SCORE BADGE ─────────────────────────────────────────────── */
.gm-score-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}
.gm-score--great {
    background: #d1fae5;
    color: #065f46;
}
.gm-score--good {
    background: #dbeafe;
    color: #1e40af;
}
.gm-score--try {
    background: #fee2e2;
    color: #991b1b;
}

/* ── NEW BADGE ───────────────────────────────────────────────── */
.gm-new-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

/* ── ATTEMPTS LABEL ──────────────────────────────────────────── */
.gm-attempts-label {
    font-size: 10px;
    color: #a0aec0;
}

/* ── CARD ATTEMPTED STATE ────────────────────────────────────── */
.gm-card--attempted {
    border-width: 1.5px;
}
.gm-card--abacus.gm-card--attempted  { border-color: #f59e0b; }
.gm-card--student.gm-card--attempted { border-color: #3b82f6; }

/* ── NO ACCESS BLOCK ─────────────────────────────────────────── */
.gm-no-access {
    text-align: center;
    padding: 40px 24px;
    background: #f7f8fa;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
}
.gm-no-access-icon { font-size: 40px; display: block; margin-bottom: 12px; }
.gm-no-access h3 { color: #1a3a5c; font-size: 18px; margin-bottom: 8px; }
.gm-no-access p  { color: #718096; font-size: 14px; margin-bottom: 20px; }

.gm-btn-upgrade {
    display: inline-block;
    background: linear-gradient(135deg, #1a7f8e, #0b4f6c);
    color: #fff !important;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 24px;
    border-radius: 25px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.gm-btn-upgrade:hover { opacity: 0.88; }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.gm-empty {
    text-align: center;
    padding: 32px;
    color: #a0aec0;
    font-size: 14px;
}
.gm-empty p { margin-top: 10px; }

/* ── NOTICE ──────────────────────────────────────────────────── */
.gm-notice {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
}
.gm-notice--warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ── PROGRESS WRAP ───────────────────────────────────────────── */
.gm-progress-wrap { width: 100%; }

/* ── STATS ROW ───────────────────────────────────────────────── */
.gm-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.gm-stat-card {
    background: #ffffff;
    border: 1px solid #e4eaf3;
    border-radius: 14px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.gm-stat-num {
    font-size: 28px;
    font-weight: 800;
    color: #1a7f8e;
    line-height: 1.1;
}

.gm-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #a0aec0;
}

.gm-stat-card--sm { padding: 12px; }
.gm-stat-card--sm .gm-stat-num { font-size: 20px; }

/* ── RESULTS TABLE ───────────────────────────────────────────── */
.gm-panel {
    background: #ffffff;
    border: 1px solid #e4eaf3;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
}

.gm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.gm-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e4eaf3;
}

.gm-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #a0aec0;
}

.gm-table tbody tr {
    border-bottom: 1px solid #f0f4f9;
    transition: background 0.15s;
}
.gm-table tbody tr:last-child { border-bottom: none; }
.gm-table tbody tr:hover { background: #f8fafc; }

.gm-table td {
    padding: 12px 16px;
    color: #2d3748;
    vertical-align: middle;
}

/* ── RETRY BUTTON ────────────────────────────────────────────── */
.gm-btn-sm {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    background: #e8f5f8;
    color: #1a7f8e;
    text-decoration: none;
    transition: background 0.15s;
}
.gm-btn-sm:hover {
    background: #1a7f8e;
    color: #fff;
}

/* ── CARD GROUP LABEL ────────────────────────────────────────── */
.gm-card-group { margin-bottom: 24px; }
.gm-group-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #a0aec0;
    margin-bottom: 12px;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .gm-stats-row { grid-template-columns: repeat(2, 1fr); }
    .gm-table { font-size: 12px; }
    .gm-table th, .gm-table td { padding: 10px 10px; }
    /* Hide less critical columns on mobile */
    .gm-table th:nth-child(4),
    .gm-table td:nth-child(4) { display: none; }
}
