/* G-Exam — design system (refonte visuelle) */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root {
  --gexam-brand: #073763;
  --gexam-brand-hover: #0b5394;
  --gexam-surface: #f1f5f9;
  --gexam-sidebar: #0c1222;
  --gexam-sidebar-border: rgba(148, 163, 184, 0.12);
}

.gexam-body .drawer-content {
  background: transparent;
}

.gexam-body,
.gexam-login-body {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  background-color: var(--gexam-surface);
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(7, 55, 99, 0.08), transparent 50%),
    radial-gradient(ellipse 90% 60% at 0% 100%, rgba(11, 83, 148, 0.06), transparent 45%);
  background-attachment: fixed;
}

.gexam-login-body {
  background-image:
    radial-gradient(ellipse 100% 70% at 50% -25%, rgba(7, 55, 99, 0.14), transparent 50%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(11, 83, 148, 0.1), transparent 45%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(7, 55, 99, 0.06), transparent 40%);
}

/* Boutons primaires — marque */
.btn.btn-primary:not(.btn-outline):not(.btn-ghost):not(.btn-link) {
  background-color: var(--gexam-brand);
  border-color: var(--gexam-brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(7, 55, 99, 0.2);
}

.btn.btn-primary:not(.btn-outline):not(.btn-ghost):not(.btn-link):hover {
  background-color: var(--gexam-brand-hover);
  border-color: var(--gexam-brand-hover);
}

.btn.btn-primary:not(.btn-outline):not(.btn-ghost):not(.btn-link):focus-visible {
  outline: 2px solid var(--gexam-brand-hover);
  outline-offset: 2px;
}

/* Sidebar navigation */
.gexam-sidebar .sidebar-link {
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  border-radius: 0.75rem;
}

.gexam-sidebar .sidebar-link:hover {
  transform: translateX(2px);
}

.gexam-sidebar .sidebar-link.active {
  background: linear-gradient(90deg, rgba(11, 83, 148, 0.35), rgba(7, 55, 99, 0.2));
  color: #f8fafc;
  font-weight: 600;
  box-shadow: inset 3px 0 0 0 var(--gexam-brand-hover);
}

/* Cartes & stats */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 12px 40px -12px rgba(7, 55, 99, 0.15),
    0 4px 12px -4px rgba(15, 23, 42, 0.08);
}

.gexam-body .drawer-content main .card {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Tableaux */
.gexam-body .table thead tr {
  border-bottom-color: rgba(148, 163, 184, 0.35);
}

.gexam-body .table thead th {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(100, 116, 139);
  background: rgba(248, 250, 252, 0.95);
}

.gexam-body .table tbody tr:hover {
  background-color: rgba(7, 55, 99, 0.04);
}

/* Alertes */
.alert {
  transition: opacity 0.3s ease;
  border-radius: 0.75rem;
}

/* Entrées (focus marque) */
.gexam-body .input:focus,
.gexam-body .select:focus,
.gexam-body .textarea:focus {
  border-color: var(--gexam-brand-hover);
  box-shadow: 0 0 0 3px rgba(11, 83, 148, 0.2);
}

/* Animation d’entrée des pages */
.fade-in {
  animation: gexamFadeIn 0.35s ease-out;
}

@keyframes gexamFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar discrète (WebKit) */
.gexam-sidebar nav::-webkit-scrollbar {
  width: 6px;
}

.gexam-sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

/* Impression */
@media print {
  .drawer-side,
  .gexam-header,
  .btn,
  .alert {
    display: none !important;
  }

  .drawer-content {
    margin-left: 0 !important;
  }

  main {
    padding: 0 !important;
    max-width: none !important;
  }

  .gexam-body .drawer-content main .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* Saisie des notes */
.scores-sticky-toolbar {
  position: sticky;
  top: 3.75rem;
  z-index: 20;
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.score-input-valid {
  background-color: rgba(34, 197, 94, 0.12) !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
}

.score-input-below {
  background-color: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}

.score-input-warning {
  border-color: rgba(234, 179, 8, 0.9) !important;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.25);
}

.score-input-flash {
  animation: scoreFlash 0.35s ease-out;
}

@keyframes scoreFlash {
  from {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.45);
  }
  to {
    box-shadow: none;
  }
}

.scores-table-wrap {
  max-height: min(70vh, 720px);
  overflow: auto;
}

.scores-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.35);
}
