/**
 * Design System Variables for Clinical Speed Support Center
 * CSS Custom Properties (CSS Variables) for cross-component consistency
 * Based on Material Design 3 and modern support platform patterns
 */

:root {
  /* ===== COLOR PALETTE ===== */

  /* Primary Colors (Clinical Speed Blue to Navy - Brand for buttons) */
  --primary-start: #306fb6;
  --primary-end: #0b263e;

  /* Accent Colors (Clinical Speed Cyan/Teal - for headers/decorative) */
  --accent-start: #23b4c9;
  --accent-end: #6481b9;

  /* Semantic Colors */
  --success: #28a745;
  --success-light: #d4edda;
  --success-dark: #1e7e34;

  --error: #dc3545;
  --error-light: #f8d7da;
  --error-dark: #bd2130;

  --warning: #ff9800;
  --warning-light: #fff3cd;
  --warning-dark: #e68900;

  --info: #17a2b8;
  --info-light: #d1ecf1;
  --info-dark: #117a8b;

  /* Neutral Colors (Apple-inspired) */
  --background: #f5f5f7;
  --surface: #ffffff;
  --surface-hover: #fafafa;
  --divider: #e0e0e0;
  --border: #d1d1d6;

  /* Text Colors */
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-disabled: #c7c7cc;
  --text-inverse: #ffffff;

  /* Status Colors */
  --status-online: #28a745;
  --status-offline: #6c757d;
  --status-away: #ffc107;
  --status-busy: #dc3545;

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

  /* Font Families */
  --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  --font-family-mono: 'Courier New', 'Monaco', 'Menlo', monospace;

  /* Font Sizes */
  --font-size-h1: 32px;
  --font-size-h2: 24px;
  --font-size-h3: 18px;
  --font-size-base: 16px;
  --font-size-small: 14px;
  --font-size-xs: 12px;

  /* Font Weights */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;

  /* ===== SPACING ===== */

  /* 8px Grid System */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 40px;
  --spacing-xxl: 48px;

  /* Component-specific spacing */
  --header-height: 64px;
  --sidebar-width: 320px;
  --control-bar-height: 56px;

  /* ===== SIZING ===== */

  /* Minimum touch targets (mobile-friendly) */
  --touch-target-min: 44px;

  /* Common component sizes */
  --button-height: 40px;
  --button-height-small: 32px;
  --button-height-large: 48px;

  --input-height: 40px;
  --avatar-size: 40px;
  --avatar-size-small: 32px;
  --avatar-size-large: 56px;

  /* ===== BORDER RADIUS ===== */

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* ===== SHADOWS ===== */

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.15);
  --shadow-2xl: 0 16px 32px rgba(0, 0, 0, 0.18);

  /* Component-specific shadows */
  --card-shadow: var(--shadow-sm);
  --card-shadow-hover: var(--shadow-md);
  --overlay-shadow: var(--shadow-xl);
  --dropdown-shadow: var(--shadow-lg);

  /* ===== TRANSITIONS ===== */

  --transition-fast: 0.15s;
  --transition-normal: 0.2s;
  --transition-slow: 0.3s;
  --transition-slower: 0.5s;

  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* ===== Z-INDEX LAYERS ===== */

  --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;

  /* ===== COMPONENT-SPECIFIC VARIABLES ===== */

  /* Ticket Card */
  --ticket-card-height: 96px;
  --ticket-card-padding: var(--spacing-sm);
  --ticket-card-border: 1px solid var(--divider);
  --ticket-card-radius: var(--radius-sm);

  /* Chat */
  --chat-bubble-radius: var(--radius-md);
  --chat-input-height: 52px;
  --chat-message-spacing: var(--spacing-sm);

  /* Meeting Controls */
  --control-button-size: 48px;
  --control-button-radius: var(--radius-full);

  /* Split Pane */
  --split-divider-width: 4px;
  --split-divider-hover-width: 8px;
  --split-min-width: 300px;
}

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

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background: var(--background);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Text utilities */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-inverse { color: var(--text-inverse); }

.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: --warning); }

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

/* Spacing utilities */
.m-0 { margin: 0; }
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }

.p-0 { padding: 0; }
.p-xs { padding: var(--spacing-xs); }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }

/* Display utilities */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

/* ===== ACCESSIBILITY ===== */

/* Focus ring for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--primary-start);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== CUSTOM SCROLLBAR ===== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: 4px;
}

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