/* ============================================
   C++ АКАДЕМІЯ — MAIN CSS DESIGN SYSTEM
   ============================================ */

/* ---- GOOGLE FONTS ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Fira+Code:wght@400;500&display=swap');

/* ---- CSS CUSTOM PROPERTIES (TOKENS) ---- */
:root {
  /* Colors - Dark Theme (default) */
  --bg-primary:     #0d0e1a;
  --bg-secondary:   #12142a;
  --bg-tertiary:    #1a1c35;
  --bg-card:        rgba(26, 28, 53, 0.85);
  --bg-glass:       rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);

  --text-primary:   #f0f2ff;
  --text-secondary: #a0a8cc;
  --text-muted:     #5a6080;
  --text-code:      #e0e8ff;

  --accent-blue:    #6366f1;
  --accent-purple:  #8b5cf6;
  --accent-cyan:    #22d3ee;
  --accent-green:   #10b981;
  --accent-orange:  #f59e0b;
  --accent-red:     #ef4444;
  --accent-pink:    #ec4899;

  --gradient-hero:  linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #22d3ee 100%);
  --gradient-card:  linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(139,92,246,0.1) 100%);
  --gradient-btn:   linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-gold:  linear-gradient(135deg, #f59e0b, #fbbf24);

  --border-color:   rgba(99, 102, 241, 0.2);
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --shadow-card:    0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow:    0 0 40px rgba(99,102,241,0.3);
  --shadow-btn:     0 4px 20px rgba(99,102,241,0.4);

  --sidebar-width:  260px;
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --radius-full:    9999px;

  --transition:     all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: 'Fira Code', 'Consolas', monospace;
}

/* ---- LIGHT THEME ---- */
[data-theme="light"] {
  --bg-primary:     #f8f9ff;
  --bg-secondary:   #eef0fa;
  --bg-tertiary:    #e8eaf5;
  --bg-card:        rgba(255, 255, 255, 0.9);
  --bg-glass:       rgba(255, 255, 255, 0.7);
  --bg-glass-hover: rgba(255, 255, 255, 0.9);

  --text-primary:   #0f1020;
  --text-secondary: #4a5080;
  --text-muted:     #8890b0;
  --text-code:      #1e2040;

  --border-color:   rgba(99, 102, 241, 0.25);
  --border-subtle:  rgba(0, 0, 0, 0.08);
  --shadow-card:    0 8px 32px rgba(0,0,0,0.1);
  --shadow-glow:    0 0 40px rgba(99,102,241,0.15);
  --shadow-btn:     0 4px 20px rgba(99,102,241,0.3);
}

/* ---- BASE RESET ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

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

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

img { max-width: 100%; }

ul, ol { list-style: none; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-blue); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-purple); }

/* ---- SELECTION ---- */
::selection {
  background: rgba(99,102,241,0.35);
  color: var(--text-primary);
}

/* ---- TYPOGRAPHY ---- */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; line-height: 1.25; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 600; line-height: 1.35; }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text-secondary); line-height: 1.75; }

.gradient-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- UTILITY CLASSES ---- */
.text-muted    { color: var(--text-muted); }
.text-accent   { color: var(--accent-blue); }
.text-green    { color: var(--accent-green); }
.text-red      { color: var(--accent-red); }
.text-orange   { color: var(--accent-orange); }

.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-col      { display: flex; flex-direction: column; }
.gap-sm        { gap: 0.5rem; }
.gap-md        { gap: 1rem; }
.gap-lg        { gap: 1.5rem; }

.mt-sm  { margin-top: 0.5rem; }
.mt-md  { margin-top: 1rem; }
.mt-lg  { margin-top: 1.5rem; }
.mt-xl  { margin-top: 2rem; }
.mb-md  { margin-bottom: 1rem; }
.mb-lg  { margin-bottom: 1.5rem; }
.mb-xl  { margin-bottom: 2rem; }

.hidden { display: none !important; }
.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;
}

/* ---- SECTION HEADERS ---- */
.section-header {
  margin-bottom: 2.5rem;
}
.section-header h2 { margin-bottom: 0.5rem; }
.section-header p  { font-size: 1.05rem; }

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* ---- LOADER ---- */
.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}
.loader-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---- DIVIDER ---- */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 2rem 0;
}
