/* ============================================
   MODERN DESIGN SYSTEM & VARIABLES
   Premium, elegant, minimal aesthetic
   ============================================ */

/* ─── ROOT VARIABLES ─── */
:root {
  /* Color Palette - Warm Wood Brown Theme */
  --color-primary: #0ea5e9;        /* Sky blue (accent) */
  --color-primary-dark: #0284c7;   /* Deeper sky blue */
  --color-secondary: #06b6d4;      /* Cyan accent */
  --color-accent: #f43f5e;         /* Rose (subtle accent) */
  
  /* Neutral palette - Wood Brown Theme */
  --color-white: #ffffff;
  --color-bg-light: #8d6e63;       /* Light warm brown */
  --color-bg-lighter: #6d4c41;     /* Medium warm brown */
  --color-border: #a1887f;         /* Brown border */
  --color-text-primary: #fff5f1;   /* Warm white text */
  --color-text-secondary: #efebe9; /* Light taupe text */
  --color-text-muted: #d7ccc8;     /* Muted brown */
  
  /* Dark mode - Wood Brown Theme */
  --color-dark-bg: #4e342e;        /* Dark rich brown */
  --color-dark-bg-secondary: #5d4037;  /* Navy-brown secondary */
  --color-dark-border: #6d4c41;    /* Brown border */
  --color-dark-text: #efebe9;      /* Light text on brown */
  
  /* Shadows - Layered depth */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Glassmorphism shadow */
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  
  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helverica Neue', sans-serif;
  --font-mono: 'Fira Code', 'Monaco', 'Consolas', monospace;
  --font-display: 'Montserrat', sans-serif;
  
  /* Font sizes - Modular scale */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  
  /* Font weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Line heights */
  --line-tight: 1.25;
  --line-snug: 1.375;
  --line-normal: 1.5;
  --line-relaxed: 1.625;
  --line-loose: 2;
  
  /* Spacing scale */
  --space-0: 0;
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-7: 1.75rem;    /* 28px */
  --space-8: 2rem;       /* 32px */
  --space-9: 2.25rem;    /* 36px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  
  /* Border radius */
  --radius-none: 0;
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slowest: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-index scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
}

/* Dark mode theme */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-light: #1e293b;
    --color-bg-lighter: #0f172a;
    --color-border: #334155;
    --color-text-primary: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
  }
}

/* ─── BASE STYLES ─── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background-color: #6d4c41 !important;
  background: linear-gradient(135deg, #5d4037 0%, #6d4c41 50%, #8d6e63 100%) !important;
  line-height: var(--line-normal);
  transition: background-color var(--transition-base), color var(--transition-base);
}

html[mode="dark"] body {
  background-color: #4e342e !important;
  background: linear-gradient(135deg, #3e2723 0%, #4e342e 50%, #5d4037 100%) !important;
  color: var(--color-dark-text);
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--line-tight);
  color: var(--color-text-primary);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  letter-spacing: -0.5px;
}

html[mode="dark"] h1,
html[mode="dark"] h2,
html[mode="dark"] h3,
html[mode="dark"] h4,
html[mode="dark"] h5,
html[mode="dark"] h6 {
  color: var(--color-dark-text);
}

h1 {
  font-size: var(--text-5xl);
  letter-spacing: -1px;
}

h2 {
  font-size: var(--text-4xl);
  letter-spacing: -0.75px;
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

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

html[mode="dark"] p {
  color: var(--color-dark-text);
  opacity: 0.9;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
  position: relative;
}

a:hover {
  color: var(--color-primary-dark);
  opacity: 0.8;
}

/* Underline effect on links */
a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: currentColor;
  transition: width var(--transition-fast);
}

a:hover::after {
  width: 100%;
}

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

/* ─── UTILITIES ─── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-sm {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-20) var(--space-6);
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-title h1,
.section-title h2 {
  margin-top: 0;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

/* Primary button */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Secondary button */
.btn-secondary {
  background-color: var(--color-bg-lighter);
  color: var(--color-text-primary);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--color-border);
  box-shadow: var(--shadow-md);
}

/* Ghost button */
.btn-ghost {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-ghost:hover {
  background-color: var(--color-primary);
  color: white;
}

/* ─── CARDS ─── */
.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--transition-base);
  overflow: hidden;
  position: relative;
}

html[mode="dark"] .card {
  background-color: var(--color-dark-bg-secondary);
  border-color: var(--color-dark-border);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

/* ─── GLASS EFFECT ─── */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-glass);
}

html[mode="dark"] .glass {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.1);
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  background-color: var(--color-bg-lighter);
  color: var(--color-text-primary);
}

.badge-primary {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  color: var(--color-primary);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}

.animate-slide-in-up {
  animation: slideInUp var(--transition-slow) ease-out;
}

.animate-slide-in-down {
  animation: slideInDown var(--transition-slow) ease-out;
}

/* ─── FOCUS & ACCESSIBILITY ─── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ─── SCROLLBAR STYLING ─── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}
