/**
 * SYD Platform - Slack-Inspired Design System
 * Clean, consistent, professional
 */

/* ================================
   1. CSS VARIABLES - Design Tokens
   ================================ */
:root {
  /* Colors - Dark theme with SYD blue accents */
  --color-bg-primary: #0a0a0f;        /* Main background (from original) */
  --color-bg-secondary: #12121a;      /* Card background */
  --color-bg-elevated: #1f1f2e;       /* Elevated surfaces */
  --color-bg-hover: #2a2a3a;          /* Hover state */

  --color-text-primary: #ffffff;      /* Primary text */
  --color-text-secondary: #b4b4c0;    /* Secondary text */
  --color-text-muted: #9aa0a6;        /* Muted text — bumped for WCAG AA contrast (≥4.5:1) */

  --color-accent: #00e5ff;            /* Primary accent (SYD cyan) */
  --color-accent-hover: #00c9e6;      /* Accent hover */
  --color-purple: #7c4dff;            /* Secondary accent (SYD purple) */
  --color-blue: #4a9eff;              /* Info accent */

  --color-border: rgba(255,255,255,0.1);  /* Borders */
  --color-border-hover: rgba(255,255,255,0.2);

  /* Typography Scale - Consistent sizing */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'Monaco', 'Menlo', 'Consolas', monospace;

  --fs-xs: 0.75rem;     /* 12px */
  --fs-sm: 0.875rem;    /* 14px */
  --fs-base: 1rem;      /* 16px */
  --fs-lg: 1.125rem;    /* 18px */
  --fs-xl: 1.5rem;      /* 24px */
  --fs-2xl: 2rem;       /* 32px */
  --fs-3xl: 2.5rem;     /* 40px */
  --fs-4xl: 3rem;       /* 48px */
  --fs-5xl: 3.5rem;     /* 56px */

  /* Font Weights */
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 900;

  /* Spacing Scale - 8pt grid */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 1rem;      /* 16px */
  --space-md: 1.5rem;    /* 24px */
  --space-lg: 2rem;      /* 32px */
  --space-xl: 3rem;      /* 48px */
  --space-2xl: 4rem;     /* 64px */
  --space-3xl: 6rem;     /* 96px */
  --space-4xl: 8rem;     /* 128px */

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.2);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-index Scale */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-overlay: 1200;
  --z-modal: 1300;
  --z-toast: 1400;

  /* Container Widths */
  --container-xs: 480px;
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1440px;
}

/* ================================
   2. RESET & BASE
   ================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  min-height: 100vh;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================================
   3. TYPOGRAPHY CLASSES
   ================================ */
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }
.text-2xl { font-size: var(--fs-2xl); }
.text-3xl { font-size: var(--fs-3xl); }
.text-4xl { font-size: var(--fs-4xl); }
.text-5xl { font-size: var(--fs-5xl); }

.font-normal { font-weight: var(--fw-normal); }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }
.font-black { font-weight: var(--fw-black); }

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 2rem); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-base); }

/* ================================
   4. LAYOUT UTILITIES
   ================================ */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-3xl) 0;
}

.section-sm { padding: var(--space-2xl) 0; }
.section-lg { padding: var(--space-4xl) 0; }

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Grid */
.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ================================
   5. COMPONENTS
   ================================ */

/* Buttons - Unified System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

/* Button Variants */
.btn-primary {
  background: linear-gradient(92deg, #00E5FF 0%, #7C3AED 100%);
  color: #001017; /* dark text on cyan/purple gradient — passes WCAG AAA on the cyan portion */
  border: none;
  font-weight: var(--fw-bold);
  box-shadow: 0 4px 14px -4px rgba(0, 229, 255, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(92deg, #1AEFFF 0%, #8B4DFF 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(124, 58, 237, 0.45);
}

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-secondary:hover {
  background: rgba(0, 229, 255, 0.08);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--fs-sm);
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--fs-lg);
}

/* Cards */
.card {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-border-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  color: var(--color-text-secondary);
}

.badge-accent {
  background: linear-gradient(92deg, #00E5FF 0%, #7C3AED 100%);
  color: var(--color-bg-primary);
}

/* Forms */
.input {
  width: 100%;
  padding: var(--space-sm);
  font-size: var(--fs-base);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  transition: all var(--transition-base);
}

.input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-bg-elevated);
}

/* ================================
   6. ANIMATIONS
   ================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade { animation: fadeIn 0.6s ease forwards; }
.animate-slide { animation: slideIn 0.4s ease forwards; }
.animate-pulse { animation: pulse 2s ease infinite; }

/* ================================
   7. RESPONSIVE
   ================================ */
@media (max-width: 768px) {
  :root {
    --fs-5xl: 2.5rem;
    --fs-4xl: 2rem;
    --fs-3xl: 1.75rem;
  }

  .container {
    padding: 0 var(--space-sm);
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }

  .hide-mobile { display: none; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none; }
}

/* ================================
   8. UTILITIES
   ================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* ================================
   9. MODERN SCROLLBAR — branded thin
   Replaces the default "90s grey" scrollbar with a thin, brand-aligned
   one that fades in subtly and brightens on hover.
   ================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.25) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.18);
  border-radius: 4px;
  transition: background 0.2s ease;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.55);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* ================================
   10. ACCESSIBILITY — prefers-reduced-motion
   Respect users who opt out of animations (vestibular disorders, focus issues).
   WCAG 2.3.3 (AAA) and 2.2.2 (AA).
   ================================ */
@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;
  }
  /* Disable transform-based hover lifts that can be disorienting */
  .card:hover,
  .btn:hover {
    transform: none !important;
  }
}