/* 
🎨 013a Analytics Platform - Advanced Design System
========================================================
Modern, responsive design system with animations and CI branding
*/

/* === ROOT VARIABLES & DESIGN TOKENS === */
:root {
  /* 013a Brand Colors */
  --primary-gold: #d4af37;
  --primary-dark: #0d0d0d;
  --primary-gradient: linear-gradient(135deg, var(--primary-dark) 0%, #2d2d2d 100%);
  --gold-gradient: linear-gradient(135deg, var(--primary-gold) 0%, #f4d03f 100%);
  
  /* Extended Color Palette */
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
  --light: #f8f9fa;
  --dark: #343a40;
  
  /* Semantic Colors */
  --surface-primary: #ffffff;
  --surface-secondary: #f8f9fa;
  --surface-tertiary: #e9ecef;
  --surface-dark: #1a1a1a;
  --surface-darker: #0a0a0a;
  
  /* Text Colors */
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --text-inverse: #ffffff;
  
  /* Interactive States */
  --hover-overlay: rgba(212, 175, 55, 0.1);
  --active-overlay: rgba(212, 175, 55, 0.2);
  --focus-ring: 0 0 0 3px rgba(212, 175, 55, 0.25);
  
  /* Typography */
  --font-family-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  --font-family-heading: 'Inter', var(--font-family-primary);
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 900;
  
  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  
  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --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);
  --shadow-gold: 0 8px 32px rgba(212, 175, 55, 0.3);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  
  /* Breakpoints */
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;
}

/* === DARK MODE SUPPORT === */
[data-theme="dark"] {
  --surface-primary: #1a1a1a;
  --surface-secondary: #2d2d2d;
  --surface-tertiary: #3d3d3d;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #808080;
}

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

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-normal);
  color: var(--text-primary);
  background-color: var(--surface-primary);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* === ENHANCED TYPOGRAPHY === */
.heading-display {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-black);
  font-size: var(--text-6xl);
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.heading-1 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-4xl);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.heading-2 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-3xl);
  line-height: 1.3;
}

.heading-3 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-2xl);
  line-height: 1.4;
}

.body-large {
  font-size: var(--text-lg);
  line-height: 1.7;
}

.body-base {
  font-size: var(--text-base);
  line-height: 1.6;
}

.body-small {
  font-size: var(--text-sm);
  line-height: 1.5;
}

.text-muted {
  color: var(--text-muted);
}

.text-gold {
  color: var(--primary-gold);
}

/* === ADVANCED BUTTON SYSTEM === */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-base);
  line-height: 1.5;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  overflow: hidden;
  
  /* Animation preparation */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  z-index: 0;
}

.btn:hover::before {
  transform: translateX(0);
}

.btn > * {
  position: relative;
  z-index: 1;
}

/* Button Variants */
.btn-primary {
  background: var(--gold-gradient);
  color: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary {
  background: var(--surface-secondary);
  color: var(--text-primary);
  border: 1px solid var(--surface-tertiary);
}

.btn-secondary:hover {
  background: var(--surface-tertiary);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-gold);
  border: 1px solid var(--primary-gold);
}

.btn-ghost:hover {
  background: var(--hover-overlay);
  transform: scale(1.05);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

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

.btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
}

/* === ADVANCED CARD SYSTEM === */
.card {
  background: var(--surface-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-base);
  padding: var(--space-6);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gold-gradient);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--surface-tertiary);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.card-body {
  margin-bottom: var(--space-4);
}

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--surface-tertiary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* === INTERACTIVE BACKGROUNDS === */
.interactive-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.bg-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(13, 13, 13, 0.05) 0%, transparent 50%);
  animation: floating 20s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(1deg); }
  66% { transform: translateY(-10px) rotate(-1deg); }
}

.bg-geometric {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  opacity: 0.03;
  background-image: 
    linear-gradient(30deg, var(--primary-gold) 12%, transparent 12.5%, transparent 87%, var(--primary-gold) 87.5%, var(--primary-gold)),
    linear-gradient(150deg, var(--primary-gold) 12%, transparent 12.5%, transparent 87%, var(--primary-gold) 87.5%, var(--primary-gold)),
    linear-gradient(30deg, var(--primary-gold) 12%, transparent 12.5%, transparent 87%, var(--primary-gold) 87.5%, var(--primary-gold)),
    linear-gradient(150deg, var(--primary-gold) 12%, transparent 12.5%, transparent 87%, var(--primary-gold) 87.5%, var(--primary-gold));
  background-size: 80px 140px;
  animation: geometric-move 60s linear infinite;
}

@keyframes geometric-move {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(-80px) translateY(-140px); }
}

/* === ADVANCED ANIMATIONS === */
@keyframes slideInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

@keyframes fadeInScale {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

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

/* Animation Classes */
.animate-slide-up {
  animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-down {
  animation: slideInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-scale {
  animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.loading-shimmer {
  background: linear-gradient(90deg, 
    var(--surface-tertiary) 25%, 
    var(--surface-secondary) 50%, 
    var(--surface-tertiary) 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* === RESPONSIVE GRID SYSTEM === */
.container {
  width: 100%;
  max-width: var(--breakpoint-xxl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

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

.grid-cols-1 { grid-template-columns: repeat(1, 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-cols-12 { grid-template-columns: repeat(12, 1fr); }

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-6 { grid-column: span 6; }
.col-span-12 { grid-column: span 12; }

/* === UTILITY CLASSES === */
.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;
}

.focus-visible:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glass-effect {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* === RESPONSIVE BREAKPOINTS === */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-3);
  }
  
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .heading-display {
    font-size: var(--text-4xl);
  }
  
  .btn-xl {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-lg);
  }
}

@media (max-width: 480px) {
  .grid-cols-2 {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .card {
    padding: var(--space-4);
  }
  
  .btn {
    width: 100%;
  }
}

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

@media (prefers-contrast: high) {
  :root {
    --shadow-base: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
}

/* === PRINT STYLES === */
@media print {
  .interactive-bg,
  .bg-particles,
  .bg-geometric {
    display: none;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}