/* ============================================
   HYPE MANAGEMENT - Enterprise Design System
   Inspired by Stripe, Linear, Vercel, Apple
   ============================================ */

/* ----- CSS Custom Properties (Design Tokens) ----- */
:root {
  /* Brand Colors */
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;
  --brand-950: #172554;

  /* Neutral / Slate */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  --neutral-950: #020617;

  /* Accent Colors */
  --accent-purple: #7c3aed;
  --accent-teal: #0d9488;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;
  --accent-cyan: #06b6d4;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-primary-hover: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --gradient-dark: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  --gradient-card: linear-gradient(135deg, rgba(37,99,235,0.05) 0%, rgba(124,58,237,0.05) 100%);
  --gradient-glow: radial-gradient(circle at 50% 50%, rgba(37,99,235,0.15) 0%, transparent 70%);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Font Sizes - Fluid 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 */
  --text-6xl: 3.75rem;   /* 60px */
  --text-7xl: 4.5rem;    /* 72px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Line Heights */
  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Spacing (8px Grid) */
  --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-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-14: 3.5rem;   /* 56px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-28: 7rem;     /* 112px */
  --space-32: 8rem;     /* 128px */

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-3xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --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 -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-3xl: 0 35px 60px -15px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
  --shadow-glow-lg: 0 0 40px rgba(37, 99, 235, 0.2);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 500;
  --z-megamenu: 600;
  --z-overlay: 800;
  --z-modal: 900;
  --z-toast: 1000;

  /* Container */
  --container-max: 1280px;
  --container-narrow: 1024px;
  --container-wide: 1440px;
  --container-padding: 1.5rem;

  /* Navbar */
  --navbar-height: 72px;
}

/* ----- Dark Mode (prep) ----- */
@media (prefers-color-scheme: dark) {
  :root {
    /* Future dark mode variables */
  }
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--neutral-800);
  background: #ffffff;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

main,
section,
.container {
  min-width: 0;
}

.grid > *,
.card,
.animate-fade-in,
.animate-scale-in {
  min-width: 0;
  max-width: 100%;
}

img, video, canvas, svg, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--neutral-900);
  overflow-wrap: break-word;
  word-break: normal;
}

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

p {
  color: var(--neutral-500);
  line-height: var(--leading-relaxed);
  overflow-wrap: break-word;
  word-break: normal;
}

/* ----- Container ----- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.table-wrapper {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
  min-width: 600px;
}

.container-narrow {
  max-width: var(--container-narrow);
}

.container-wide {
  max-width: var(--container-wide);
}

/* ----- Section ----- */
.section {
  padding: var(--space-16) 0;
}

.section-compact {
  padding: var(--space-12) 0;
}

section.section-light[style*="padding-top:120px"] {
  padding-top: calc(var(--navbar-height) + var(--space-8)) !important;
  padding-bottom: var(--space-12);
}

section.cta-section[style*="padding:5rem"] {
  padding: var(--space-16) 0 !important;
}

.section-dark {
  background: var(--gradient-hero);
  color: #fff;
}

.section-light {
  background: var(--neutral-50);
}

.section-gradient {
  background: var(--gradient-primary);
  color: #fff;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--brand-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.section-label-light {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #93c5fd;
}

.section-title {
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: var(--font-extrabold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.section-title-light {
  color: #fff;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--neutral-400);
  max-width: 600px;
  line-height: var(--leading-relaxed);
}

.section-subtitle-light {
  color: rgba(255, 255, 255, 0.7);
}

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

.section-header-left {
  text-align: left;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  min-height: 44px;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--brand-600);
  border: 2px solid var(--brand-200);
}

.btn-outline:hover {
  border-color: var(--brand-600);
  background: rgba(37, 99, 235, 0.05);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--neutral-600);
}

.btn-ghost:hover {
  background: var(--neutral-100);
  color: var(--neutral-900);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

.btn i {
  font-size: 1.1em;
}

/* ----- Cards ----- */
.card {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.card-gradient {
  background: var(--gradient-card);
  border-color: transparent;
}

.card-dark {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.card-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}

/* ----- Grids ----- */
.grid {
  display: grid;
  gap: var(--space-6);
}

.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); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-12 { gap: var(--space-12); }
.items-center { align-items: center; }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-16 { margin-bottom: var(--space-12); }
.max-w-4xl { max-width: 56rem; }

/* ----- Badge ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}

.badge-blue {
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand-600);
}

.badge-green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
}

.badge-purple {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-purple);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
}

/* ----- Animations ----- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

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

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

@keyframes barGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* Scroll-triggered animation classes */
.animate-fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-scale-in {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.animate-scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

.animate-stagger > * {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.animate-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.animate-stagger.visible > *:nth-child(2) { transition-delay: 100ms; }
.animate-stagger.visible > *:nth-child(3) { transition-delay: 200ms; }
.animate-stagger.visible > *:nth-child(4) { transition-delay: 300ms; }
.animate-stagger.visible > *:nth-child(5) { transition-delay: 400ms; }
.animate-stagger.visible > *:nth-child(6) { transition-delay: 500ms; }
.animate-stagger.visible > *:nth-child(7) { transition-delay: 600ms; }
.animate-stagger.visible > *:nth-child(8) { transition-delay: 700ms; }

.animate-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

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

/* ----- Glassmorphism ----- */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ----- Gradient Text ----- */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ----- Dividers ----- */
.divider {
  width: 100%;
  height: 1px;
  background: var(--neutral-200);
  margin: var(--space-8) 0;
}

.divider-light {
  background: rgba(255, 255, 255, 0.08);
}

/* ----- Skeleton Loading ----- */
.skeleton {
  background: linear-gradient(90deg, var(--neutral-200) 25%, var(--neutral-100) 50%, var(--neutral-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ----- Responsive Utilities ----- */
.hidden-mobile { display: block; }
.hidden-desktop { display: none; }

@media (max-width: 1024px) {
  :root {
    --container-padding: 1.25rem;
  }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .hidden-tablet { display: none; }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
    --navbar-height: 64px;
  }
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 {
    grid-template-columns: 1fr;
  }
  .section {
    padding: var(--space-12) 0;
  }
  .section-compact {
    padding: var(--space-10) 0;
  }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  .hidden-mobile { display: none; }
  .hidden-desktop { display: block; }
  .section-header {
    margin-bottom: var(--space-10);
  }
  .mb-16 {
    margin-bottom: var(--space-8);
  }
  .btn,
  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }
  .btn-lg {
    padding: var(--space-3) var(--space-6);
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 0.875rem;
  }
  .section {
    padding: var(--space-10) 0;
  }
  .section-compact {
    padding: var(--space-8) 0;
  }
  .section-header {
    margin-bottom: var(--space-8);
  }
  .section-title {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }
  .section-subtitle {
    font-size: var(--text-base);
  }
  .card[style*="padding:2rem"],
  .card[style*="padding:2.5rem"],
  .feature-card[style*="padding:2rem"],
  .feature-card-large,
  .testimonial-card[style*="padding:2.5rem"],
  .chart-container {
    padding: var(--space-5) !important;
  }
  .card > [style*="display:flex"] > div:last-child {
    min-width: 0;
  }
  .card a[href^="mailto:"],
  .card a[href^="tel:"] {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }
  .btn,
  .cta-btn-primary,
  .cta-btn-secondary {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 360px) {
  :root {
    --container-padding: 0.75rem;
  }
  .btn {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  .card a[href^="mailto:"],
  .card a[href^="tel:"] {
    font-size: var(--text-sm);
  }
}

/* ----- Focus Styles ----- */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ----- Selection ----- */
::selection {
  background: var(--brand-600);
  color: #fff;
}

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

::-webkit-scrollbar-track {
  background: var(--neutral-100);
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

/* ----- Print ----- */
@media print {
  .no-print { display: none !important; }
}
