/* ============================================================================
   DREAMDRAGON - GLOBAL VARIABLES & BASE STYLES
   ============================================================================ */

:root {
  /* === COLORS === */
  --bg-main: #020617;
  --bg-alt: #0b1120;
  --bg-purple: #1e122d;
  --bg-card: #0f172a;
  --bg-card-soft: rgba(15, 23, 42, 0.95);
  --bg-sidebar: #020617;
  
  /* === ACCENTS === */
  --accent-purple: #7c3aed;
  --accent-purple-soft: rgba(124, 58, 237, 0.16);
  --accent-purple-strong: rgba(124, 58, 237, 0.7);
  --accent-neon: #22c55e;
  --accent-blue: #60a5fa;
  --accent-gold: #facc15;
  --accent-gold-dark: #b45309;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  
  /* === TEXT === */
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-secondary: #d1d5db;
  --text-dark: #374151;
  
  /* === BORDERS === */
  --border-subtle: rgba(148, 163, 184, 0.25);
  --border-strong: rgba(55, 65, 81, 0.8);
  --border-purple: rgba(124, 58, 237, 0.3);
  
  /* === RADIUS === */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-pill: 999px;
  
  /* === SHADOWS === */
  --shadow-soft: 0 16px 45px rgba(0, 0, 0, 0.6);
  --shadow-deep: 0 22px 60px rgba(0, 0, 0, 0.8);
  --shadow-purple: 0 0 32px rgba(124, 58, 237, 0.4);
  --shadow-neon: 0 0 24px rgba(34, 197, 94, 0.6);
  
  /* === LAYOUT === */
  --nav-height: 70px;
  --sidebar-width: 260px;
  --container-max-width: 1200px;
  --container-padding: 20px;
  
  /* === TRANSITIONS === */
  --transition-fast: 0.2s ease-out;
  --transition-medium: 0.3s ease-out;
  --transition-slow: 0.5s ease-out;
  
  /* === SPACING === */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* === TYPOGRAPHY === */
  --font-family-primary: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-family-pixel: "Press Start 2P", monospace;
  
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 30px;
  --font-size-4xl: 36px;
  --font-size-5xl: 48px;
  --font-size-6xl: 60px;
  
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* === Z-INDEX === */
  --z-dropdown: 1000;
  --z-modal: 2000;
  --z-tooltip: 3000;
  --z-navbar: 100;
  --z-sidebar: 50;
}

/* === DARK MODE OVERRIDES === */
@media (prefers-color-scheme: dark) {
  :root {
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --bg-main: #020617;
    --bg-alt: #0b1120;
  }
}

/* === RESPONSIVE BREAKPOINTS === */
/* Mobile First Approach */

/* xs: 0px - 475px (extra small phones) */
@custom-media --screen-xs (max-width: 475px);

/* sm: 476px - 639px (small phones) */
@custom-media --screen-sm (min-width: 476px) and (max-width: 639px);

/* md: 640px - 767px (tablets) */
@custom-media --screen-md (min-width: 640px) and (max-width: 767px);

/* lg: 768px - 1023px (small laptops) */
@custom-media --screen-lg (min-width: 768px) and (max-width: 1023px);

/* xl: 1024px - 1279px (laptops) */
@custom-media --screen-xl (min-width: 1024px) and (max-width: 1279px);

/* 2xl: 1280px+ (large screens) */
@custom-media --screen-2xl (min-width: 1280px);

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family-primary);
  background: radial-gradient(circle at top, #2e1065 0%, var(--bg-main) 55%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-md);
  color: var(--text-main);
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-purple);
}

/* === IMAGES === */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === BUTTONS === */
button {
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* === INPUTS === */
input,
textarea,
select {
  font-family: inherit;
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
}

/* === LISTS === */
ul, ol {
  list-style: none;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple-strong);
}

/* === SELECTION === */
::selection {
  background: var(--accent-purple-soft);
  color: var(--text-main);
}

::-moz-selection {
  background: var(--accent-purple-soft);
  color: var(--text-main);
}

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

/* === FOCUS VISIBLE === */
.focus-visible {
  outline: 2px solid var(--accent-neon);
  outline-offset: 2px;
}

/* === SCREEN READER ONLY === */
.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;
}

/* === RESPONSIVE FONT SCALING === */
@media screen and (max-width: 768px) {
  :root {
    --font-size-5xl: 36px;
    --font-size-4xl: 28px;
    --font-size-3xl: 24px;
    --font-size-2xl: 20px;
  }
}

@media screen and (max-width: 475px) {
  :root {
    --font-size-5xl: 28px;
    --font-size-4xl: 24px;
    --font-size-3xl: 20px;
    --font-size-2xl: 18px;
    --container-padding: 16px;
  }
}
