
/* 
  =============================================================
  TDV ECOSYSTEM DESIGN TOKENS (Linear / Vercel / Stripe Grade)
  =============================================================
*/
:root {
  /* LIGHT MODE SURFACES (Alabaster & Pure White) */
  --surface-bg: #F8FAFC;
  --surface-card: #FFFFFF;
  --surface-elevated: #F1F5F9;
  
  /* BORDERS */
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);
  
  /* SHADOWS (Surface elevation, not heavy black boxes) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.02);

  /* SPRING PHYSICS & ANIMATIONS */
  --transition-spring: 150ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-spring-slow: 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

html.dark {
  /* DARK MODE SURFACES (Deep Charcoal / Slate) */
  --surface-bg: #090A0F;
  --surface-card: #0F1117;
  --surface-elevated: #161922;
  
  /* BORDERS */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  /* SHADOWS (Dark mode uses almost no shadow, relies on border & elevation) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Base resets for optical perfection */
body {
  background-color: var(--surface-bg);
  transition: background-color var(--transition-spring), color var(--transition-spring);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography refinements */
.tabular-nums { font-variant-numeric: tabular-nums; }
.tracking-tight { letter-spacing: -0.02em; }
.max-w-65ch { max-width: 65ch; }

/* Concentric Border Radius Utility Math */
.radius-card { border-radius: 20px; padding: 12px; }
.radius-inner { border-radius: 8px; /* 20 - 12 = 8 */ }

/* Micro-interactions: Buttons */
.btn-spring {
  transition: all var(--transition-spring);
}
.btn-spring:active {
  transform: scale(0.98);
}

/* Micro-interactions: Cards */
.card-spring {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-spring);
}
.card-spring:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Skeleton Loading (No Layout Shifts) */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton-pulse {
  background: linear-gradient(90deg, var(--surface-elevated) 25%, var(--border-subtle) 50%, var(--surface-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: inherit;
}

/* Ensure minimum touch targets for mobile */
@media (max-width: 768px) {
  button, a.tap-target, .tap-target {
    min-height: 44px;
    min-width: 44px;
  }
}

/* TDV E-School - Dual-Theme Design System & Print Standards */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ─── TDV DESIGN SYSTEM TOKENS & DUAL THEME ─────────────────────────────── */

:root {
  --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Default Light Mode tokens */
  --bg-main: #fafafa; /* zinc-50 */
  --bg-card: #ffffff;
  --bg-card-subtle: #f4f4f5; /* zinc-100 */
  --border-main: #e4e4e7; /* zinc-200 */
  --border-subtle: #f4f4f5; /* zinc-100 */
  --text-primary: #09090b; /* zinc-950 */
  --text-secondary: #52525b; /* zinc-600 - WCAG AA compliant (4.5:1+) */
  --text-muted: #71717a; /* zinc-500 */
  
  --shadow-diffuse: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 25px -4px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
}

.dark {
  /* Dark Mode tokens */
  --bg-main: #09090b; /* zinc-950 */
  --bg-card: #18181b; /* zinc-900 */
  --bg-card-subtle: #27272a; /* zinc-800 */
  --border-main: #27272a; /* zinc-800 */
  --border-subtle: #3f3f46; /* zinc-700 */
  --text-primary: #fafafa; /* zinc-50 */
  --text-secondary: #a1a1aa; /* zinc-400 - WCAG AA compliant (4.5:1+) */
  --text-muted: #71717a; /* zinc-500 */
  
  --shadow-diffuse: 0 8px 30px -4px rgba(0, 0, 0, 0.6), 0 2px 8px -2px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 16px 36px -6px rgba(0, 0, 0, 0.8), 0 4px 14px -2px rgba(168, 85, 247, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100vw;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  max-width: 100vw;
  overflow-x: clip;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  transition: background-color 200ms ease, color 200ms ease;
}

body.dark {
  background-color: #09090b;
  background-image: 
    radial-gradient(ellipse 70% 40% at 50% -10%, rgba(147, 51, 234, 0.15), transparent 70%),
    radial-gradient(ellipse 50% 30% at 90% 15%, rgba(6, 182, 212, 0.08), transparent 60%);
  background-attachment: fixed;
}

/* Card Micro-interactions (8pt & Zinc elevation) */
.ui-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-diffuse);
  border-radius: 16px;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1), border-color 200ms ease;
}

.ui-card-hover {
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ui-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Frosted Optical Glass */
.glass-panel {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid #e4e4e7; /* zinc-200 */
  box-shadow: var(--shadow-diffuse);
}

.dark .glass-panel {
  background: rgba(24, 24, 27, 0.85); /* zinc-900 */
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid #27272a; /* zinc-800 */
  box-shadow: var(--shadow-diffuse);
}

/* Bento Card Micro-Dynamics */
.bento-card {
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.bento-card:hover {
  transform: translateY(-2px);
}

html.dark .bento-card:hover {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 12px 30px -10px rgba(147, 51, 234, 0.25);
}

html:not(.dark) .bento-card:hover {
  border-color: rgba(147, 51, 234, 0.35);
  box-shadow: 0 10px 25px -5px rgba(147, 51, 234, 0.12);
}

/* KaTeX Düstur İnteqrasiyası və Uyğunluğu */
.katex {
  font-size: 1.05em !important;
}

.katex-display {
  margin: 0.8em 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25em 0;
}

.katex-inline-formula {
  display: inline-block;
  vertical-align: middle;
}

/* Səliqəli Xüsusi Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(147, 51, 234, 0.6);
}

/* Animasiyalar */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   RƏSMİ ÇAP VƏ PDF STANDARTLARI (@media print)
   Azərbaycan məktəb standartı A4 formatında təmiz imtahan vərəqi
   ========================================================================== */
@media print {
  /* Ekran elementlərini tam gizlət */
  .no-print,
  header,
  nav,
  aside,
  button,
  footer,
  .phet-container {
    display: none !important;
  }

  /* Səhifə xüsusiyyətləri */
  @page {
    size: A4 portrait;
    margin: 12mm 15mm 15mm 15mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.35 !important;
  }

  /* Çap vərəqinin genişliyi və kənarları */
  .print-page {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
  }

  /* KaTeX çapda yüksək kontrastlı olsun */
  .katex {
    color: #000 !important;
  }

  /* Səhifə qırılması qaydaları */
  .break-inside-avoid {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Bütün rəngləri mürəkkəb qənaəti üçün ağ-qara et */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
