/* ============================================================
   EduVerify Pakistan — Design Tokens
   Central design system: colors, spacing, typography, shadows.
   Light + dark mode via CSS variables.
   ============================================================ */

:root {
  /* ---------- Brand Colors ---------- */
  --ev-navy-900: #0F172A;
  --ev-navy-800: #1E293B;
  --ev-blue-700: #1D4ED8;
  --ev-blue-600: #2563EB;
  --ev-blue-50:  #EFF6FF;

  /* ---------- Semantic Colors ---------- */
  --ev-emerald-600: #059669;   /* verified */
  --ev-amber-600:   #D97706;   /* review / conditional */
  --ev-crimson-600: #DC2626;   /* critical warning */

  /* ---------- Surface & Text (Light Mode) ---------- */
  --ev-bg:            #F8FAFC;
  --ev-surface:       #FFFFFF;
  --ev-surface-2:     #F1F5F9;
  --ev-border:        #E2E8F0;
  --ev-border-strong: #CBD5E1;
  --ev-text:          #0F172A;
  --ev-text-muted:    #475569;
  --ev-text-subtle:   #64748B;

  /* ---------- Elevation ---------- */
  --ev-shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  --ev-shadow:    0 1px 3px 0 rgb(15 23 42 / 0.08), 0 1px 2px -1px rgb(15 23 42 / 0.08);
  --ev-shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.08);

  /* ---------- Radii ---------- */
  --ev-radius-sm: 6px;
  --ev-radius:    10px;
  --ev-radius-lg: 16px;

  /* ---------- Spacing Scale ---------- */
  --ev-space-1: 0.25rem;
  --ev-space-2: 0.5rem;
  --ev-space-3: 0.75rem;
  --ev-space-4: 1rem;
  --ev-space-6: 1.5rem;
  --ev-space-8: 2rem;
  --ev-space-12: 3rem;
  --ev-space-16: 4rem;

  /* ---------- Typography ---------- */
  --ev-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ev-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --ev-text-xs:   0.75rem;
  --ev-text-sm:   0.875rem;
  --ev-text-base: 1rem;
  --ev-text-lg:   1.125rem;
  --ev-text-xl:   1.25rem;
  --ev-text-2xl:  1.5rem;
  --ev-text-3xl:  1.875rem;
  --ev-text-4xl:  2.25rem;
  --ev-text-5xl:  3rem;

  /* ---------- Motion ---------- */
  --ev-duration: 180ms;
  --ev-ease: cubic-bezier(0.2, 0, 0, 1);

  /* ---------- Focus ring ---------- */
  --ev-focus-ring: 0 0 0 3px rgb(37 99 235 / 0.35);
}

/* ============================================================
   DARK MODE OVERRIDES
   ============================================================ */
.dark {
  --ev-bg:            #020617;
  --ev-surface:       #0F172A;
  --ev-surface-2:     #1E293B;
  --ev-border:        #1E293B;
  --ev-border-strong: #334155;
  --ev-text:          #F1F5F9;
  --ev-text-muted:    #CBD5E1;
  --ev-text-subtle:   #94A3B8;

  --ev-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --ev-shadow:    0 1px 3px 0 rgb(0 0 0 / 0.5), 0 1px 2px -1px rgb(0 0 0 / 0.5);
  --ev-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);

  --ev-focus-ring: 0 0 0 3px rgb(96 165 250 / 0.45);
}

/* ============================================================
   GLOBAL BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ev-font-sans);
  font-size: var(--ev-text-base);
  line-height: 1.6;
  color: var(--ev-text);
  background-color: var(--ev-bg);
  transition: background-color var(--ev-duration) var(--ev-ease),
              color var(--ev-duration) var(--ev-ease);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   ACCESSIBLE FOCUS RINGS
   ============================================================ */
:focus-visible {
  outline: none;
  box-shadow: var(--ev-focus-ring);
  border-radius: var(--ev-radius-sm);
}

/* ============================================================
   UTILITY CLASSES (used across pages)
   ============================================================ */
.ev-card {
  background-color: var(--ev-surface);
  border: 1px solid var(--ev-border);
  border-radius: var(--ev-radius);
  box-shadow: var(--ev-shadow-sm);
  transition: border-color var(--ev-duration) var(--ev-ease),
              box-shadow var(--ev-duration) var(--ev-ease);
}

.ev-card:hover {
  border-color: var(--ev-border-strong);
  box-shadow: var(--ev-shadow);
}

.ev-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--ev-radius);
  font-weight: 600;
  font-size: var(--ev-text-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--ev-duration) var(--ev-ease),
              border-color var(--ev-duration) var(--ev-ease),
              transform var(--ev-duration) var(--ev-ease);
}

.ev-btn:active { transform: translateY(1px); }

.ev-btn-primary {
  background-color: var(--ev-blue-700);
  color: #fff;
}
.ev-btn-primary:hover { background-color: #1E40AF; }

.ev-btn-secondary {
  background-color: transparent;
  color: var(--ev-text);
  border-color: var(--ev-border-strong);
}
.ev-btn-secondary:hover { background-color: var(--ev-surface-2); }

.ev-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: var(--ev-radius);
  border: 1px solid var(--ev-border-strong);
  background-color: var(--ev-surface);
  color: var(--ev-text);
  font-size: var(--ev-text-sm);
  transition: border-color var(--ev-duration) var(--ev-ease),
              box-shadow var(--ev-duration) var(--ev-ease);
}
.ev-input:focus {
  outline: none;
  border-color: var(--ev-blue-600);
  box-shadow: var(--ev-focus-ring);
}

.ev-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: var(--ev-text-sm);
  font-weight: 500;
  color: var(--ev-text-muted);
}

/* Status badges */
.ev-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: var(--ev-text-xs);
  font-weight: 600;
}
.ev-badge-verified { background-color: rgb(5 150 105 / 0.12); color: var(--ev-emerald-600); }
.ev-badge-review   { background-color: rgb(217 119 6 / 0.12); color: var(--ev-amber-600); }
.ev-badge-outdated { background-color: rgb(220 38 38 / 0.12); color: var(--ev-crimson-600); }
.ev-badge-unverified { background-color: var(--ev-surface-2); color: var(--ev-text-subtle); }

/* Skeleton shimmer loader */
.ev-skeleton {
  background: linear-gradient(
    90deg,
    var(--ev-surface-2) 25%,
    var(--ev-border) 50%,
    var(--ev-surface-2) 75%
  );
  background-size: 200% 100%;
  animation: ev-shimmer 1.4s infinite linear;
  border-radius: var(--ev-radius-sm);
}

@keyframes ev-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast container (used by JS) */
#ev-toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
