/* ============================================================
   DEKIDS CLASSROOM – Design System (main.css)
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand Colors */
  --clr-bg:        #0b0f1a;
  --clr-bg-2:      #111827;
  --clr-bg-3:      #1a2236;
  --clr-surface:   rgba(255, 255, 255, 0.04);
  --clr-surface-2: rgba(255, 255, 255, 0.08);
  --clr-border:    rgba(255, 255, 255, 0.10);
  --clr-border-2:  rgba(255, 255, 255, 0.18);

  /* Accent / Brand */
  --clr-primary:   #6366f1;   /* Indigo */
  --clr-primary-h: #818cf8;
  --clr-primary-d: #4f46e5;
  --clr-secondary: #06b6d4;   /* Cyan */
  --clr-success:   #10b981;
  --clr-warning:   #f59e0b;
  --clr-danger:    #ef4444;
  --clr-danger-h:  #f87171;

  /* Gradients */
  --grad-hero:    linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --grad-card:    linear-gradient(145deg, rgba(99,102,241,0.15) 0%, rgba(6,182,212,0.05) 100%);
  --grad-sidebar: linear-gradient(180deg, #111827 0%, #0b0f1a 100%);

  /* Text */
  --txt-primary:   #f1f5f9;
  --txt-secondary: #94a3b8;
  --txt-muted:     #475569;
  --txt-accent:    #818cf8;

  /* Typography */
  --font-base: 'Inter', system-ui, sans-serif;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;

  /* Spacing */
  --spc-1: 0.25rem;  --spc-2: 0.5rem;   --spc-3: 0.75rem;
  --spc-4: 1rem;     --spc-5: 1.25rem;  --spc-6: 1.5rem;
  --spc-8: 2rem;     --spc-10: 2.5rem;  --spc-12: 3rem;

  /* Radius */
  --radius-sm: 6px;  --radius: 12px;  --radius-lg: 18px;  --radius-xl: 24px;  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px rgba(99,102,241,0.25);

  /* Transition */
  --ease: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --navbar-h:  64px;
  --sidebar-w: 240px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-base);
  background-color: var(--clr-bg);
  color: var(--txt-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--clr-primary-h); text-decoration: none; }
a:hover { color: var(--txt-primary); }

img, svg { display: block; max-width: 100%; }

ul, ol { list-style: none; }

button, input, select, textarea {
  font-family: var(--font-base);
  font-size: var(--text-base);
}

/* ---------- Utility ---------- */
.hidden       { display: none !important; }
.sr-only      { position: absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.text-muted   { color: var(--txt-secondary); }
.text-accent  { color: var(--txt-accent); }
.text-success { color: var(--clr-success); }
.text-danger  { color: var(--clr-danger); }
.text-warning { color: var(--clr-warning); }
.text-center  { text-align: center; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Global Loader ---------- */
.global-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--clr-bg);
}
.loader-ring {
  width: 48px; height: 48px;
  border: 3px solid var(--clr-border);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App Shell ---------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.content-wrapper {
  display: flex;
  flex: 1;
  padding-top: var(--navbar-h);
  width: 100%;
}

/* This applies when sidebar is visible */
.app-shell.has-sidebar .content-wrapper {
  padding-left: var(--sidebar-w);
}

.page-content {
  flex: 1;
  padding: var(--spc-8);
  overflow-y: auto;
  min-height: calc(100vh - var(--navbar-h));
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clr-border-2); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--clr-primary); }

/* ---------- Selection ---------- */
::selection { background: rgba(99, 102, 241, 0.3); color: var(--txt-primary); }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--txt-primary);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .page-content,
  .app-shell.has-sidebar .page-content {
    padding: var(--spc-4);
  }
  :root { --sidebar-w: 0px; }
}
