/* ============================================
   VeriCase Design System v3.0
   "Deep Research" Premium Aesthetic
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* ============================================
       CORE BRAND COLORS - Deep Research Palette
       ============================================ */

  /* Primary Teal - Intelligence & Technology */
  --vericase-teal: #0f9d9a;
  --vericase-teal-dark: #0a7b79;
  --vericase-teal-darker: #086665;
  --vericase-teal-light: #14b8b4;
  --vericase-teal-lighter: #5eead4;
  --vericase-teal-ghost: rgba(15, 157, 154, 0.08);

  /* Navy - Authority & Trust */
  --vericase-navy: #0f172a;
  --vericase-navy-light: #1e293b;
  --vericase-navy-lighter: #334155;

  /* Gold - Premium Accent */
  --vericase-gold: #b8860b;
  --vericase-gold-light: #d4a84b;
  --vericase-gold-muted: #a68b5b;

  /* Cream - Warmth & Sophistication */
  --vericase-cream: #faf9f6;
  --vericase-cream-dark: #f0ede8;
  --vericase-cream-warm: #fdf8f3;

  /* ============================================
       SEMANTIC COLORS
       ============================================ */

  /* Backgrounds */
  --bg-white: #ffffff;
  --bg-primary: var(--vericase-cream);
  --bg-secondary: #ffffff;
  --bg-tertiary: var(--vericase-cream-dark);
  --bg-elevated: #ffffff;
  --bg-dark: var(--vericase-navy);
  --bg-sidebar: var(--vericase-navy);
  --bg-header: var(--vericase-navy);

  /* Text */
  --text-primary: var(--vericase-navy);
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;
  --text-inverted: #ffffff;
  --text-link: var(--vericase-teal);

  /* Borders */
  --border-default: #e2e8f0;
  --border-muted: #f1f5f9;
  --border-focus: var(--vericase-teal);
  --border-inverted: rgba(255, 255, 255, 0.1);

  /* Status Colors */
  --success: #059669;
  --success-light: #d1fae5;
  --success-dark: #047857;

  --warning: #d97706;
  --warning-light: #fef3c7;
  --warning-dark: #b45309;

  --error: #dc2626;
  --error-light: #fee2e2;
  --error-dark: #b91c1c;

  --info: var(--vericase-teal);
  --info-light: rgba(15, 157, 154, 0.1);

  /* ============================================
       GRAY SCALE - Warm Slate
       ============================================ */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* ============================================
       TYPOGRAPHY
       ============================================ */
  --font-sans:
    "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;

  /* Font Sizes */
  --text-xs: 0.75rem; /* 12px */
  --text-sm: 0.8125rem; /* 13px */
  --text-base: 0.9375rem; /* 15px */
  --text-lg: 1.0625rem; /* 17px */
  --text-xl: 1.25rem; /* 20px */
  --text-2xl: 1.5rem; /* 24px */
  --text-3xl: 1.875rem; /* 30px */
  --text-4xl: 2.25rem; /* 36px */
  --text-5xl: 3rem; /* 48px */

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* ============================================
       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-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  --space-16: 4rem; /* 64px */
  --space-20: 5rem; /* 80px */
  --space-24: 6rem; /* 96px */

  /* ============================================
       BORDER RADIUS
       ============================================ */
  --radius-sm: 0.25rem; /* 4px */
  --radius-md: 0.5rem; /* 8px */
  --radius-lg: 0.75rem; /* 12px */
  --radius-xl: 1rem; /* 16px */
  --radius-2xl: 1.5rem; /* 24px */
  --radius-3xl: 2rem; /* 32px */
  --radius-full: 9999px;

  /* ============================================
       SHADOWS - Refined Depth
       ============================================ */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:
    0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:
    0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --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.08),
    0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(15, 23, 42, 0.2);

  /* Colored Shadows */
  --shadow-teal: 0 4px 14px rgba(15, 157, 154, 0.25);
  --shadow-teal-lg: 0 8px 24px rgba(15, 157, 154, 0.3);
  --shadow-gold: 0 4px 14px rgba(184, 134, 11, 0.2);

  /* Inset Shadows */
  --shadow-inset: inset 0 2px 4px rgba(15, 23, 42, 0.05);
  --shadow-inner-glow: inset 0 0 20px rgba(15, 157, 154, 0.03);

  /* ============================================
       TRANSITIONS & ANIMATION
       ============================================ */
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

  --duration-instant: 75ms;
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  /* ============================================
       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;
  --z-toast: 800;
}

/* ============================================
   GLOBAL RESETS & BASE STYLES
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* ============================================
   TYPOGRAPHY SYSTEM
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--vericase-navy);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
}

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

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

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

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
}

/* Serif Accent Typography */
.font-serif {
  font-family: var(--font-serif);
}

.text-serif-heading {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.01em;
}

.text-serif-quote {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--text-secondary);
}

/* Monospace */
.font-mono {
  font-family: var(--font-mono);
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Text Colors */
.text-primary {
  color: var(--text-primary);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-tertiary {
  color: var(--text-tertiary);
}
.text-muted {
  color: var(--text-muted);
}
.text-teal {
  color: var(--vericase-teal);
}
.text-navy {
  color: var(--vericase-navy);
}
.text-gold {
  color: var(--vericase-gold);
}
.text-success {
  color: var(--success);
}
.text-warning {
  color: var(--warning);
}
.text-error {
  color: var(--error);
}

/* ============================================
   VERICASE LOGO
   ============================================ */

.vericase-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--text-xl);
  text-decoration: none;
  transition: opacity var(--duration-fast) var(--ease-default);
}

.vericase-logo:hover {
  opacity: 0.9;
}

.logo-veri {
  color: var(--vericase-teal);
}

.logo-case {
  color: var(--text-inverted);
}

/* Dark variant */
.vericase-logo--dark .logo-case {
  color: var(--vericase-navy);
}

/* Image logo */
.vericase-logo img {
  height: 32px;
  width: auto;
}

/* ============================================
   PREMIUM BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--vericase-teal-ghost),
    0 0 0 1px var(--vericase-teal);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button - Teal */
.btn-primary,
.btn-vericase {
  background: linear-gradient(
    135deg,
    var(--vericase-teal) 0%,
    var(--vericase-teal-dark) 100%
  );
  color: var(--text-inverted);
  box-shadow: var(--shadow-teal), var(--shadow-sm);
}

.btn-primary:hover:not(:disabled),
.btn-vericase:hover:not(:disabled) {
  background: linear-gradient(
    135deg,
    var(--vericase-teal-light) 0%,
    var(--vericase-teal) 100%
  );
  box-shadow: var(--shadow-teal-lg), var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled),
.btn-vericase:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary Button - Navy */
.btn-secondary,
.btn-navy {
  background: var(--vericase-navy);
  color: var(--text-inverted);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled),
.btn-navy:hover:not(:disabled) {
  background: var(--vericase-navy-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--vericase-teal);
  border: 1.5px solid var(--vericase-teal);
}

.btn-outline:hover:not(:disabled) {
  background: var(--vericase-teal-ghost);
  border-color: var(--vericase-teal-dark);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: 1rem 1.75rem;
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
}

/* Icon Button */
.btn-icon {
  padding: 0.625rem;
  width: 36px;
  height: 36px;
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
  padding: 0.375rem;
}

/* ============================================
   PREMIUM CARDS
   ============================================ */

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-muted);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  transition: all var(--duration-normal) var(--ease-default);
}

.card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
}

.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--vericase-teal);
}

/* Card Variants */
.card-teal {
  background: linear-gradient(
    135deg,
    var(--vericase-teal) 0%,
    var(--vericase-teal-dark) 100%
  );
  border: none;
  color: var(--text-inverted);
}

.card-navy {
  background: linear-gradient(
    135deg,
    var(--vericase-navy) 0%,
    var(--vericase-navy-light) 100%
  );
  border: none;
  color: var(--text-inverted);
}

.card-glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ============================================
   FORM INPUTS
   ============================================ */

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: all var(--duration-fast) var(--ease-default);
}

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

.input:focus {
  outline: none;
  border-color: var(--vericase-teal);
  box-shadow: 0 0 0 3px var(--vericase-teal-ghost);
}

.input:disabled {
  background: var(--gray-50);
  cursor: not-allowed;
}

/* Input Sizes */
.input-sm {
  padding: 0.5rem 0.75rem;
  font-size: var(--text-xs);
}

.input-lg {
  padding: 1rem 1.25rem;
  font-size: var(--text-base);
}

/* ============================================
   BADGES & PILLS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.25rem 0.625rem;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-teal {
  background: var(--vericase-teal-ghost);
  color: var(--vericase-teal-dark);
}

.badge-navy {
  background: rgba(15, 23, 42, 0.08);
  color: var(--vericase-navy);
}

.badge-success {
  background: var(--success-light);
  color: var(--success-dark);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning-dark);
}

.badge-error {
  background: var(--error-light);
  color: var(--error-dark);
}

.badge-gold {
  background: rgba(184, 134, 11, 0.1);
  color: var(--vericase-gold);
}

/* ============================================
   AI ENTITY PILLS (Seamless Integration)
   ============================================ */

.entity-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  margin: 0 4px 4px 0;
}

.entity-pill--person {
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.2);
}

.entity-pill--org {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.2);
}

.entity-pill--date {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
}

.entity-pill--location {
  background: rgba(139, 92, 246, 0.08);
  color: #7c3aed;
  border-color: rgba(139, 92, 246, 0.2);
}

/* ============================================
   STATUS INDICATORS
   ============================================ */

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.status-dot--active,
.status-dot--success {
  background: var(--success);
}

.status-dot--pending,
.status-dot--warning {
  background: var(--warning);
}

.status-dot--error {
  background: var(--error);
}

.status-dot--muted {
  background: var(--gray-400);
}

/* Pulse Animation */
.status-dot--pulse {
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  font-size: var(--text-sm);
}

.alert-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-info {
  background: var(--info-light);
  border-color: var(--info);
  color: var(--vericase-teal-dark);
}

.alert-success {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success-dark);
}

.alert-warning {
  background: var(--warning-light);
  border-color: var(--warning);
  color: var(--warning-dark);
}

.alert-error {
  background: var(--error-light);
  border-color: var(--error);
  color: var(--error-dark);
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--vericase-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner--sm {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}

.loading-spinner--lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-100) 0%,
    var(--gray-200) 20%,
    var(--gray-100) 40%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Display */
.hidden {
  display: none;
}
.block {
  display: block;
}
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.grid {
  display: grid;
}

/* Flex */
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-start {
  align-items: flex-start;
}
.items-center {
  align-items: center;
}
.items-end {
  align-items: flex-end;
}
.justify-start {
  justify-content: flex-start;
}
.justify-center {
  justify-content: center;
}
.justify-end {
  justify-content: flex-end;
}
.justify-between {
  justify-content: space-between;
}
.flex-1 {
  flex: 1;
}
.flex-shrink-0 {
  flex-shrink: 0;
}

/* Gap */
.gap-1 {
  gap: var(--space-1);
}
.gap-2 {
  gap: var(--space-2);
}
.gap-3 {
  gap: var(--space-3);
}
.gap-4 {
  gap: var(--space-4);
}
.gap-6 {
  gap: var(--space-6);
}
.gap-8 {
  gap: var(--space-8);
}

/* Width/Height */
.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}
.min-h-screen {
  min-height: 100vh;
}

/* Text Alignment */
.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}

/* Border Radius */
.rounded {
  border-radius: var(--radius-md);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}
.rounded-xl {
  border-radius: var(--radius-xl);
}
.rounded-full {
  border-radius: var(--radius-full);
}

/* Shadows */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}
.shadow {
  box-shadow: var(--shadow-md);
}
.shadow-lg {
  box-shadow: var(--shadow-lg);
}
.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* Overflow */
.overflow-hidden {
  overflow: hidden;
}
.overflow-auto {
  overflow: auto;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cursor */
.cursor-pointer {
  cursor: pointer;
}

/* Transition */
.transition {
  transition: all var(--duration-fast) var(--ease-default);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  :root {
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.375rem;
  }
}

@media (max-width: 640px) {
  :root {
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
    --space-6: 1.25rem;
    --space-8: 1.5rem;
  }
}
