/* ================================================================
   TOKENS.CSS — UNEC Students Hub · Dizayn sistemi v2
   ----------------------------------------------------------------
   Bu fayl bütün saytın vahid dizayn tokenlərini müəyyən edir.
   Köhnə CSS dəyişənləri (--bg, --surface, --accent ...) bu tokenlərə
   "körpü" olur: tema seçimi (applyTheme) köhnə dəyişənləri dəyişdirir,
   yeni --color-* tokenləri isə onlardan törəyir — beləliklə 12 temanın
   hamısı yeni komponentlərdə də işləyir.

   Yüklənmə sırası: base → components → ... → tokens → shell → screens → legacy
   ================================================================ */

:root {
  /* ── 1. Marka paleti (referans dizayn) ──────────────────────────
     Bunlar "unec" (default) temasının dəyərləridir.               */
  --bg:       #030B19;   /* Primary background            */
  --surface:  #0B2140;   /* Card surface                  */
  --surface2: #102B50;   /* Daxili / hover səthi          */
  --accent:   #087BFF;   /* Primary blue                  */
  --accent2:  #4DA6FF;   /* Mətn üçün açıq mavi (AA kontrast) */
  --accent3:  #0A4FB3;   /* Tünd mavi                     */
  --text:     #F3F7FF;   /* Primary text                  */
  --muted:    #8CA3C4;   /* Secondary/muted (AA)          */
  --border:   #17365D;   /* Border                        */
  --glow:     rgba(8, 123, 255, 0.10);

  /* ── 2. Semantik tokenlər (köhnə dəyişənlərdən törəyir) ─────── */
  --color-background:        var(--bg);
  --color-background-alt:    color-mix(in srgb, var(--bg) 78%, var(--surface));   /* #06142A */
  --color-surface:           var(--surface);
  --color-surface-elevated:  color-mix(in srgb, var(--surface) 72%, var(--bg));   /* #0A1D38 */
  --color-surface-inner:     var(--surface2);
  --color-primary:           var(--accent);
  --color-primary-hover:     color-mix(in srgb, var(--accent) 86%, white);        /* #168BFF */
  --color-primary-soft:      color-mix(in srgb, var(--accent) 16%, transparent);
  --color-accent:            #28C8F5;                                              /* Cyan accent */
  --color-text-primary:      var(--text);
  --color-text-secondary:    color-mix(in srgb, var(--text) 64%, var(--muted));    /* #9DB4D3 */
  --color-text-muted:        var(--muted);
  --color-border:            var(--border);
  --color-border-strong:     color-mix(in srgb, var(--accent) 38%, var(--border));
  --color-on-primary:        #FFFFFF;

  /* Statuslar */
  --color-success: #23C99A;
  --color-warning: #FFB547;
  --color-danger:  #FF5364;

  /* Xüsusiyyət rəngləri — bütün tətbiqdə eyni mənanı daşıyır */
  --fc-tests:    #087BFF;   /* Testlər              */
  --fc-gpa:      #23C99A;   /* GPA Kalkulyator      */
  --fc-requests: #9267FF;   /* Material İstəkləri   */
  --fc-plan:     #FF9B38;   /* İxtisas Planı        */
  --fc-timer:    #FF5364;   /* Taymer & İmtahan     */
  --fc-dash:     #28C8F5;   /* Dashboard            */
  --fc-support:  #FF6FA5;   /* Dəstək               */

  /* ── 3. Tipoqrafiya ─────────────────────────────────────────── */
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --fs-xs:   0.75rem;    /* 12 — meta        */
  --fs-sm:   0.8125rem;  /* 13 — ikinci dərəcəli */
  --fs-base: 0.9375rem;  /* 15 — əsas mətn   */
  --fs-md:   1rem;       /* 16               */
  --fs-lg:   1.125rem;   /* 18 — kart başlığı */
  --fs-xl:   1.5rem;     /* 24 — səhifə başlığı */
  --fs-2xl:  1.875rem;   /* 30 — hero        */

  /* ── 4. Məsafə (4px şəbəkə) ─────────────────────────────────── */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* ── 5. Radius ──────────────────────────────────────────────── */
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;

  /* ── 6. Kölgə / keçid ───────────────────────────────────────── */
  --shadow-card:  0 8px 24px rgba(0, 8, 24, 0.28);
  --shadow-float: 0 18px 48px rgba(0, 8, 24, 0.55);
  --shadow-glow:  0 8px 24px color-mix(in srgb, var(--accent) 38%, transparent);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms var(--ease);
  --t-base: 220ms var(--ease);

  /* ── 7. Maket ölçüləri ──────────────────────────────────────── */
  --header-h: 64px;
  --nav-h: 68px;
  --sidebar-w: 268px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --page-gutter: 16px;
  --z-header: 400;
  --z-nav: 500;
  --z-overlay: 900;
  --z-drawer: 910;
  --z-sheet: 920;
  --z-toast: 1000;
}

/* ── Əsas səthlər ──────────────────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--color-text-primary);
  background:
    radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%),
    linear-gradient(180deg, var(--color-background-alt) 0%, var(--bg) 46%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Köhnə dekorativ qatlar (şəbəkə fon) — yeni dizaynda istifadə olunmur */
body::before, .grid-bg { display: none; }

button, input, select, textarea { font-family: var(--font); }
button { -webkit-tap-highlight-color: transparent; }

/* Başlıqlar — yeni miqyas (köhnə clamp(2rem,5vw,3.2rem) əvəzinə) */
h1, h2 {
  font-family: var(--font);
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
}
h1 span, h2 span {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--accent2);
}
body[data-theme="rainbow"] h1 span,
body[data-theme="rainbow"] h2 span {
  background: linear-gradient(90deg, #c026d3, #f59e0b, #06b6d4, #c026d3);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── İkon (inline SVG sprite) ──────────────────────────────────── */
.ic {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: middle;
  pointer-events: none;
}
.ic--fill, .is-active .ic--fillable, .fav-btn.active .ic { fill: currentColor; }
.ic--sm { width: 1.05em; height: 1.05em; }
.ic--lg { width: 1.5em; height: 1.5em; }

/* ── Fokus və əlçatanlıq ───────────────────────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: calc(var(--z-toast) + 10);
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Köhnə mətn düymələrinin səhifə konteyneri ─────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--page-gutter) calc(var(--nav-h) + var(--safe-bottom) + 28px) !important;
}

@media (min-width: 1024px) {
  .container { padding-bottom: 56px !important; }
}
