/* ==========================================================================
   NCLI 2026 Modern UI System — Assessment & Certification Hub
   File: css/modern/assessment-cert.css
   Target Pages: take-test.php, test-results.php, certificate-verify.php,
                 typing-certificate.php, student-receipt.php
   ========================================================================== */

/* ===== 1. ASSESSMENT & QUIZ ENGINE STYLES ===== */
.quiz-header {
  background: var(--color-surface);
  padding: 15px 30px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
}

.quiz-timer {
  background: var(--color-danger);
  color: white;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-weight: var(--font-weight-bold);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-card {
  background: var(--color-surface);
  padding: 25px;
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.q-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  align-items: center;
}

.q-badge {
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
}

.q-text {
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  margin-bottom: 20px;
  line-height: 1.5;
  color: var(--color-text);
}

.opt-label {
  display: block;
  padding: 12px 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
  color: var(--color-text);
}

.opt-label:hover {
  background: var(--color-surface-sunken);
  border-color: var(--color-primary);
}

.opt-label input {
  margin-right: 10px;
}

.btn-submit-test {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  width: 100%;
  transition: background var(--duration-fast);
  margin-bottom: 50px;
}

.btn-submit-test:hover {
  background: var(--color-primary-dark);
}

/* ===== 2. SCORECARD & TEST RESULTS STYLES ===== */
.score-card-hero {
  background: linear-gradient(135deg, #1e3a8a, var(--color-primary));
  color: white;
  padding: 26px 30px;
  border-radius: var(--radius-2xl);
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(16, 96, 208, 0.2);
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.score-val {
  font-size: 42px;
  font-weight: var(--font-weight-extrabold);
  line-height: 1;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.stat-box span {
  display: block;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  margin-bottom: 4px;
}

.stat-box strong {
  font-size: 18px;
  font-weight: var(--font-weight-extrabold);
}

.breakdown-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: flex;
  margin-top: 16px;
}

.bb-segment {
  height: 100%;
}

.bb-green { background: #22c55e; }
.bb-red { background: #ef4444; }
.bb-gray { background: #cbd5e1; }

.result-q-card {
  background: var(--color-surface);
  padding: 22px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  border-left: 5px solid #cbd5e1;
}

.result-q-card.correct { border-left-color: #22c55e; }
.result-q-card.incorrect { border-left-color: #ef4444; }

.result-opt {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--color-surface-sunken);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text);
}

.result-opt.is-correct {
  background: #ecfdf5;
  border-color: #22c55e;
  color: #166534;
  font-weight: var(--font-weight-bold);
}

.result-opt.is-wrong-picked {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
  text-decoration: line-through;
}

body.dark .result-opt.is-correct {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #86efac;
}

body.dark .result-opt.is-wrong-picked {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}

@media(max-width:600px){
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 3. CERTIFICATE VERIFICATION & TYPING CERTIFICATE STYLES ===== */
.certificate-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-8);
}

.certificate-verify-card {
  max-width: 640px;
  margin: 0 auto var(--space-8) auto;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}

/* Modern Verification Card */
.verify-modern-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-width: 600px;
  margin: 20px auto 30px auto;
  text-align: left;
  position: relative;
}

body.dark .verify-modern-card {
  background: #1e293b;
  border-color: #334155;
}

.vmc-header {
  background: var(--color-surface-sunken);
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}

body.dark .vmc-header {
  background: #0f172a;
  border-color: #334155;
}

.vmc-status {
  background: var(--color-success-bg);
  color: var(--color-success);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  display: flex;
  align-items: center;
  gap: 6px;
}

body.dark .vmc-status {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

.vmc-body {
  padding: 32px;
}

.vmc-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  font-weight: var(--font-weight-bold);
}

body.dark .vmc-label {
  color: #94a3b8;
}

.vmc-student-name h3 {
  font-size: 1.5rem;
  color: var(--color-text);
  margin: 0 0 4px 0;
  font-weight: var(--font-weight-extrabold);
}

body.dark .vmc-student-name h3 {
  color: #f8fafc;
}

.vmc-subtext {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

body.dark .vmc-subtext {
  color: #cbd5e1;
}

.vmc-course-box {
  margin: 24px 0;
  padding: 20px;
  background: var(--color-primary-light);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
}

body.dark .vmc-course-box {
  background: rgba(16, 96, 208, 0.1);
  border-color: #3b82f6;
}

.vmc-course-box h4 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

body.dark .vmc-course-box h4 {
  color: #60a5fa;
}

.vmc-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.vmc-detail-item strong {
  font-size: 15px;
  color: var(--color-text);
}

body.dark .vmc-detail-item strong {
  color: #f1f5f9;
}

.vmc-footer {
  background: var(--color-surface-sunken);
  padding: 16px 32px;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-align: center;
}

body.dark .vmc-footer {
  background: #0f172a;
  color: #94a3b8;
}

.cv-verified-badge {
  display: none !important;
}

@media (max-width: 600px) {
  .vmc-header, .vmc-body, .vmc-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .vmc-details-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ===== 4. STUDENT RECEIPT / INVOICE STYLES ===== */
.receipt-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--color-surface);
  padding: 40px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.logo-area {
  display: flex;
  flex-direction: column;
}

.logo-area img {
  height: 48px;
  width: auto;
  margin-bottom: 10px;
}

.logo-area p {
  margin: 4px 0 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.receipt-details {
  text-align: right;
}

.receipt-details h2 {
  margin: 0;
  font-size: 24px;
  color: var(--color-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.receipt-details p {
  margin: 4px 0 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
}

.receipt-details strong {
  color: var(--color-text);
}

.receipt-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.receipt-info-box h3 {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.receipt-info-box p {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 500;
}

.receipt-info-box strong {
  color: var(--color-text);
  font-weight: 700;
}

table.receipt-items {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

table.receipt-items th {
  background: var(--color-surface-sunken);
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
}

table.receipt-items td {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
  font-weight: 500;
}

table.receipt-items th.right, table.receipt-items td.right {
  text-align: right;
}

.receipt-total-row td {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  border-bottom: none;
}

.receipt-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 13px;
}

.receipt-footer p {
  margin: 4px 0;
}

.receipt-actions {
  text-align: center;
  margin-top: 30px;
}

.btn-print-receipt {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  transition: background var(--duration-fast);
}

.btn-print-receipt:hover {
  background: var(--color-primary-dark);
}

/* ===== 5. DARK MODE SUPPORTS ===== */
body.dark .assessment-hero,
body.dark .question-card,
body.dark .timer-card,
body.dark .result-card,
body.dark .certificate-card,
body.dark .certificate-verify-card,
body.dark .receipt-card,
body.dark .receipt-container,
body.dark .option-item {
  background-color: #0f172a;
  border-color: #1e293b;
}

body.dark .receipt-details h2,
body.dark .receipt-info-box strong,
body.dark .receipt-total-row td {
  color: #f8fafc;
}

/* ===== 6. RESPONSIVE BREAKPOINTS & PRINT RULES ===== */
@media (max-width: 768px) {
  .assessment-hero,
  .receipt-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .receipt-info-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .score-card {
    grid-template-columns: 1fr 1fr;
  }

  .certificate-card,
  .receipt-card,
  .receipt-container {
    padding: var(--space-4);
  }
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
    padding: 0;
  }

  .no-print,
  .site-header,
  .site-footer,
  .banner-section,
  .receipt-actions {
    display: none !important;
  }

  .certificate-card,
  .receipt-card,
  .receipt-container {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
