/**
 * SMARTDOCIFY FOUNDATION DESIGN SYSTEM
 * High-performance, zero-dependency, modern CSS variables & base styles
 */

:root {
  /* Color Palette - Light Mode */
  --bg-body: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FFFFFF;
  --bg-surface-alt: #F1F5F9;
  --bg-input: #FFFFFF;
  
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-subtle: #64748B;
  --text-inverse: #FFFFFF;

  --border-subtle: #E2E8F0;
  --border-focus: #2563EB;
  --border-strong: #CBD5E1;

  /* Brand Accents */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-glow: rgba(37, 99, 235, 0.15);

  --secondary: #7C3AED;
  --secondary-hover: #6D28D9;
  --secondary-light: #F5F3FF;

  --accent-amber: #F59E0B;
  --accent-amber-light: #FFFBEB;
  --accent-emerald: #10B981;
  --accent-emerald-light: #ECFDF5;
  --accent-rose: #EF4444;
  --accent-rose-light: #FEF2F2;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  --grad-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 1) 100%);
  --grad-accent-banner: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.2);

  /* Layout & Spacing */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --container-max: 1240px;
  --header-height: 70px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --bg-body: #0B0F19;
  --bg-surface: #131B2E;
  --bg-surface-elevated: #1E293B;
  --bg-surface-alt: #162036;
  --bg-input: #10172A;

  --text-main: #F8FAFC;
  --text-muted: #CBD5E1;
  --text-subtle: #94A3B8;
  --text-inverse: #0F172A;

  --border-subtle: #1E293B;
  --border-focus: #3B82F6;
  --border-strong: #334155;

  --primary: #3B82F6;
  --primary-hover: #60A5FA;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-glow: rgba(59, 130, 246, 0.25);

  --secondary: #8B5CF6;
  --secondary-hover: #A78BFA;
  --secondary-light: rgba(139, 92, 246, 0.15);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.65);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-body);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  color: var(--text-main);
  overflow-x: hidden;
}

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

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem auto;
}

.section-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.section-title {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-surface-alt);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-outline {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* Pills & Badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-working {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
}

.badge-coming-soon {
  background: var(--accent-amber-light);
  color: #D97706;
}

.badge-flagship {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-free {
  background: #DCFCE7;
  color: #15803D;
}

.badge-paid,
.badge-premium {
  background: #EFF6FF;
  color: #1D4ED8;
}

.badge-popular {
  background: #EEF2FF;
  color: #4F46E5;
}

.badge-top-search {
  background: #FEF3C7;
  color: #B45309;
}

.badge-featured {
  background: #F3E8FF;
  color: #7E22CE;
}

.badge-new {
  background: #DCFCE7;
  color: #15803D;
}

/* Responsive utilities */
@media (max-width: 768px) {
  .section {
    padding: 2.75rem 0;
  }
  .section-title {
    font-size: 1.75rem;
  }
  .section-subtitle {
    font-size: 0.95rem;
  }
}
