/**
 * Design System - Foundation CSS Variables
 * Modern single-color palette with indigo primary color
 */

:root {
  /* ==========================================
     BRAND COLORS - Orange/Amber Palette (CIA Platform)
     ========================================== */
  --color-primary: #f59e0b;
  --color-primary-dark: #d97706;
  --color-primary-darker: #b45309;
  --color-primary-light: #fbbf24;
  --color-primary-lighter: #fcd34d;
  --color-primary-50: #fffbeb;
  --color-primary-100: #fef3c7;

  /* Accent Color - Dark Gray/Black */
  --color-accent: #1f2937;
  --color-accent-dark: #111827;
  --color-accent-light: #374151;

  /* Secondary - Light Beige (for sidebar) */
  --color-secondary: #faf8f5;
  --color-secondary-dark: #f5f3f0;
  --color-secondary-light: #fefdfb;

  /* ==========================================
     FUNCTIONAL COLORS
     ========================================== */
  --color-success: #10b981;
  --color-success-dark: #059669;
  --color-success-light: #34d399;
  --color-success-bg: #d1fae5;

  --color-danger: #ef4444;
  --color-danger-dark: #dc2626;
  --color-danger-light: #f87171;
  --color-danger-bg: #fee2e2;

  --color-warning: #f59e0b;
  --color-warning-dark: #d97706;
  --color-warning-light: #fbbf24;
  --color-warning-bg: #fef3c7;

  --color-info: #3b82f6;
  --color-info-dark: #2563eb;
  --color-info-light: #60a5fa;
  --color-info-bg: #dbeafe;

  /* ==========================================
     NEUTRAL PALETTE - Grays
     ========================================== */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* ==========================================
     BACKGROUNDS & SURFACES
     ========================================== */
  --bg-primary: #e5e5e5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f5f5;
  --bg-sidebar: #faf8f5;
  --bg-sidebar-hover: #f5f3f0;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-disabled: #f3f4f6;

  /* ==========================================
     TEXT COLORS
     ========================================== */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-muted: #d1d5db;
  --text-inverse: #ffffff;
  --text-link: #4f46e5;
  --text-link-hover: #4338ca;

  /* ==========================================
     BORDERS
     ========================================== */
  --border-color: #e5e7eb;
  --border-color-light: #f3f4f6;
  --border-color-dark: #d1d5db;
  --border-color-focus: #4f46e5;

  --border-width: 1px;
  --border-width-thick: 2px;

  --border-radius-sm: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;
  --border-radius-2xl: 20px;
  --border-radius-full: 9999px;

  /* ==========================================
     SHADOWS
     ========================================== */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --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-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

  /* ==========================================
     SPACING SCALE (8px base)
     ========================================== */
  --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-11: 2.75rem;  /* 44px */
  --space-12: 3rem;     /* 48px */
  --space-14: 3.5rem;   /* 56px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* ==========================================
     TYPOGRAPHY
     ========================================== */
  --font-family-base: 'NimbusSanT', 'SharpGrotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif, serif;
  --font-family-mono: 'Consolas', 'Monaco', 'Courier New', monospace;

  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */

  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

  /* ==========================================
     Z-INDEX SCALE
     ========================================== */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-notification: 1080;

  /* ==========================================
     TRANSITIONS & ANIMATIONS
     ========================================== */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  --transition-slower: 500ms ease-in-out;

  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ==========================================
     LAYOUT DIMENSIONS
     ========================================== */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 80px;
  --topbar-height: 60px;
  --content-max-width: 1400px;

  /* ==========================================
     BREAKPOINTS (for JS)
     ========================================== */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* ==========================================
   GLOBAL RESETS & BASE STYLES
   ========================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
}

/* ==========================================
   TYPOGRAPHY UTILITIES
   ========================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin: 0;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin: 0;
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-link-hover);
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-inverse { color: var(--text-inverse) !important; }

.text-xs { font-size: var(--font-size-xs) !important; }
.text-sm { font-size: var(--font-size-sm) !important; }
.text-base { font-size: var(--font-size-base) !important; }
.text-lg { font-size: var(--font-size-lg) !important; }
.text-xl { font-size: var(--font-size-xl) !important; }
.text-2xl { font-size: var(--font-size-2xl) !important; }
.text-3xl { font-size: var(--font-size-3xl) !important; }

.font-light { font-weight: var(--font-weight-light) !important; }
.font-normal { font-weight: var(--font-weight-normal) !important; }
.font-medium { font-weight: var(--font-weight-medium) !important; }
.font-semibold { font-weight: var(--font-weight-semibold) !important; }
.font-bold { font-weight: var(--font-weight-bold) !important; }

.bg-primary { background-color: var(--bg-primary) !important; }
.bg-secondary { background-color: var(--bg-secondary) !important; }
.bg-white { background-color: #ffffff !important; }

.rounded-sm { border-radius: var(--border-radius-sm) !important; }
.rounded-md { border-radius: var(--border-radius-md) !important; }
.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.rounded-xl { border-radius: var(--border-radius-xl) !important; }
.rounded-full { border-radius: var(--border-radius-full) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }

.hidden { display: none !important; }
.block { display: block !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.grid { display: grid !important; }

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* ==========================================
   FOCUS STATES
   ========================================== */

*:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ==========================================
   SELECTION
   ========================================== */

::selection {
  background-color: var(--color-primary-100);
  color: var(--color-primary-darker);
}

::-moz-selection {
  background-color: var(--color-primary-100);
  color: var(--color-primary-darker);
}
/* ==========================================
   GLOBAL UTILITIES & ANIMATIONS
   ========================================== */

/* Details/Summary Animation */
@keyframes details-show {
  from {
    opacity: 0;
    transform: var(--details-translate, translateY(-1em));
  }
}

details[open] > *:not(summary) {
  animation: details-show 200ms ease-in-out;
}

/* Hide time picker calendar indicator */
input[type="time"]::-webkit-calendar-picker-indicator {
  display: none;
}

/* Utility class to reset all styles */
.all-unset {
  all: unset;
}

/* Direct Upload Styles (for file uploads) */
.direct-upload {
  display: inline-block;
  position: relative;
  padding: 2px 4px;
  margin: 0 3px 3px 0;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  font-size: 11px;
  line-height: 13px;
}

.direct-upload--pending {
  opacity: 0.6;
}

.direct-upload__progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  opacity: 0.2;
  background: var(--color-primary);
  transition: width 120ms ease-out, opacity 60ms 60ms ease-in;
  transform: translate3d(0, 0, 0);
}

.direct-upload--complete .direct-upload__progress {
  opacity: 0.4;
}

.direct-upload--error {
  border-color: var(--color-danger);
}

input[type="file"][data-direct-upload-url][disabled] {
  display: none;
}

/* Tooltip arrow fix */
div.ant-tooltip-arrow::before,
div.ant-tooltip-arrow::after {
  display: none !important;
}
