/* ============================================================
   FastScores Web — style.css
   Bootstrap 5.3 overrides + custom components.
   Bootstrap handles layout, grid, and dark mode via
   data-bs-theme. This file only adds what Bootstrap
   does not provide out of the box.
   ============================================================ */

/* ── Brand / Accent tokens ─────────────────────────────────── */
:root {
  --cp-accent:      #4F6EF7;
  --cp-accent-dark: #6B8AFF;
  --cp-font:        'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Base typography ────────────────────────────────────────── */
body {
  font-family: var(--cp-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Navbar ─────────────────────────────────────────────────── */
#mainNavbar {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(var(--bs-body-bg-rgb, 255,255,255), .88) !important;
}

[data-bs-theme="dark"] #mainNavbar {
  background: rgba(13,13,13,.88) !important;
}

.navbar-brand .brand-icon {
  flex-shrink: 0;
}

.navbar-brand .brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ── Hero section ───────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--bs-primary) 0%, #6B8AFF 50%, #8B5CF6 100%);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.hero-section > * { position: relative; }

.hero-icon-wrap {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-headline {
  letter-spacing: -.035em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.15);
}

.hero-sub {
  color: rgba(255,255,255,.88);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero-trust-badge {
  background: rgba(255,255,255,.18);
  color: #fff;
  font-weight: 500;
  font-size: .8rem;
  border: 1px solid rgba(255,255,255,.25);
  padding: .35em .85em;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: .4em 1em;
  font-size: .875rem;
  font-weight: 500;
  color: #fff;
}

.text-purple { color: #6f42c1 !important; }

/* ── Section eyebrow label ──────────────────────────────────── */
.section-eyebrow {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

/* ── Feature cards ──────────────────────────────────────────── */
.feature-card {
  transition: transform .2s ease, box-shadow .2s ease;
  border-radius: 14px !important;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,.12) !important;
}

.feature-icon-tile {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Accent bar (4px colored strip) ────────────────────────── */
.accent-bar {
  height: 4px;
  border-radius: 2px;
  margin-bottom: 1rem;
  width: 36px;
}

/* ── How it works step circle ───────────────────────────────── */
.step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bs-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ── Stat cards (report/dashboard) ─────────────────────────── */
.stat-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
}

.stat-card .stat-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--bs-secondary-color);
}

/* ── Grade chips ────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}

.grade-chip-A { background: rgba(52,199,89,.15);  color: #1a8a3a; }
.grade-chip-B { background: rgba(0,122,255,.13);  color: #0055cc; }
.grade-chip-C { background: rgba(255,159,10,.13); color: #c47600; }
.grade-chip-D { background: rgba(255,107,0,.13);  color: #b84a00; }
.grade-chip-F { background: rgba(255,59,48,.13);  color: #cc1a15; }

[data-bs-theme="dark"] .grade-chip-A { background: rgba(52,199,89,.2);  color: #4cd964; }
[data-bs-theme="dark"] .grade-chip-B { background: rgba(0,122,255,.2);  color: #409cff; }
[data-bs-theme="dark"] .grade-chip-C { background: rgba(255,159,10,.2); color: #ffb340; }
[data-bs-theme="dark"] .grade-chip-D { background: rgba(255,107,0,.2);  color: #ff8c42; }
[data-bs-theme="dark"] .grade-chip-F { background: rgba(255,59,48,.2);  color: #ff6961; }

/* ── Attendance chips ───────────────────────────────────────── */
.att-chip-good { background: rgba(52,199,89,.15);  color: #1a8a3a; }
.att-chip-ok   { background: rgba(255,159,10,.13); color: #c47600; }
.att-chip-bad  { background: rgba(255,59,48,.13);  color: #cc1a15; }

[data-bs-theme="dark"] .att-chip-good { background: rgba(52,199,89,.2);  color: #4cd964; }
[data-bs-theme="dark"] .att-chip-ok   { background: rgba(255,159,10,.2); color: #ffb340; }
[data-bs-theme="dark"] .att-chip-bad  { background: rgba(255,59,48,.2);  color: #ff6961; }

/* ── Report table ───────────────────────────────────────────── */
.report-table th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  white-space: nowrap;
  color: var(--bs-secondary-color);
  user-select: none;
}

.report-table td {
  vertical-align: middle;
}

.rank-cell {
  font-weight: 700;
}

.rank-1 { color: #FF9F0A; }
.rank-2 { color: var(--bs-secondary-color); }
.rank-3 { color: #CD7F32; }

.rank-medal { font-size: 1.1rem; }

th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--bs-body-color); }
th.sort-asc::after  { content: ' ↑'; color: var(--bs-primary); }
th.sort-desc::after { content: ' ↓'; color: var(--bs-primary); }

/* ── Student avatar circle ──────────────────────────────────── */
.student-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
}

/* ── Score pill (grade entry) ───────────────────────────────── */
.score-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bs-secondary-bg);
  font-size: .8rem;
  margin: 1px;
}

/* ── Info row (student details) ─────────────────────────────── */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: .6rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

.info-row:last-child { border-bottom: none; }

.info-label {
  color: var(--bs-secondary-color);
  font-size: .85rem;
}

.info-value {
  font-weight: 500;
}

/* ── Report footer line ─────────────────────────────────────── */
.report-footer-line {
  text-align: center;
  color: var(--bs-secondary-color);
  font-size: .8rem;
  margin-top: 3rem;
  padding-bottom: 1rem;
}

/* ── Export row ─────────────────────────────────────────────── */
.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}

/* ── Skeleton loading ───────────────────────────────────────── */
@keyframes cp-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--bs-secondary-bg) 25%,
    var(--bs-tertiary-bg)  50%,
    var(--bs-secondary-bg) 75%
  );
  background-size: 1200px 100%;
  animation: cp-shimmer 1.4s infinite;
}

/* ── Attendance breakdown stats ─────────────────────────────── */
.att-stat {
  border-radius: 10px;
  padding: 14px 16px;
}

.att-stat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.att-stat-label {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

.att-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

/* ── Badge chip (monitor, etc.) ─────────────────────────────── */
.badge-chip {
  background: rgba(79,110,247,.1);
  color: var(--cp-accent);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 600;
}

[data-bs-theme="dark"] .badge-chip {
  background: rgba(107,138,255,.15);
  color: var(--cp-accent-dark);
}

/* ── Scores list (grade categories) ────────────────────────── */
.scores-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 240px;
}

/* ── Error page ─────────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  text-align: center;
  padding: 40px 20px;
}

.error-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

/* ── Misc utility ───────────────────────────────────────────── */
.font-mono { font-variant-numeric: tabular-nums; }
.score-dash { color: var(--bs-secondary-color); }
.student-code { font-size: .75rem; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; }
.name-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.cat-avg { font-weight: 700; }
.cat-weight { font-size: .75rem; color: var(--bs-secondary-color); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 576px) {
  .hero-icon-wrap { width: 68px; height: 68px; border-radius: 16px; }
  .hero-headline  { font-size: 2.25rem; }
  .stat-card .stat-value { font-size: 1.5rem; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  #mainNavbar, .export-row { display: none !important; }
  body { color: #000 !important; background: #fff !important; }
}
