/**
 * ===========================================
 * Apple-Inspired Design Tokens for Rapitek CRM
 * Premium design system with SF Pro typography, Apple colors, and modern aesthetics
 * Single source of truth - do NOT duplicate these variables
 * ===========================================
 */

:root {
  /* ========================================
     TYPOGRAPHY - SF Pro / System Fonts
     ======================================== */
  --font-family-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
                      'Helvetica Neue', 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;

  /* Font Sizes - Apple's type scale */
  --text-xs: 0.6875rem;    /* 11px */
  --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.75rem;     /* 28px */
  --text-4xl: 2.125rem;    /* 34px */
  --text-5xl: 2.75rem;     /* 44px */

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

  /* Line Heights */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Letter Spacing */
  --tracking-tight: -0.022em;
  --tracking-normal: 0;
  --tracking-wide: 0.012em;

  /* ========================================
     COLORS - Apple Color Palette
     ======================================== */

  /* Primary Blues */
  --color-blue-50: #f0f7ff;
  --color-blue-100: #e0efff;
  --color-blue-200: #b8daff;
  --color-blue-300: #7ab8ff;
  --color-blue-400: #3d8eff;
  --color-blue-500: #007AFF;  /* Apple Blue */
  --color-blue-600: #0066d6;
  --color-blue-700: #0052ad;
  --color-blue-800: #003d82;
  --color-blue-900: #002957;

  /* Grays - Apple's refined gray scale */
  --color-gray-50: #fafafa;
  --color-gray-100: #f5f5f7;  /* Apple Light Background */
  --color-gray-150: #ebebed;
  --color-gray-200: #e8e8ed;
  --color-gray-300: #d2d2d7;
  --color-gray-400: #aeaeb2;
  --color-gray-500: #8e8e93;  /* Apple Secondary Text */
  --color-gray-600: #636366;
  --color-gray-700: #48484a;
  --color-gray-800: #3a3a3c;
  --color-gray-900: #1d1d1f;  /* Apple Primary Text */

  /* Semantic Colors - Apple System Colors */
  --color-green: #34C759;
  --color-green-light: #30d158;
  --color-green-50: #e8f9ed;
  --color-yellow: #FFCC00;
  --color-yellow-light: #ffd60a;
  --color-orange: #FF9500;
  --color-orange-light: #ff9f0a;
  --color-red: #FF3B30;
  --color-red-light: #ff453a;
  --color-red-50: #fef2f2;
  --color-pink: #FF2D55;
  --color-purple: #AF52DE;
  --color-purple-light: #bf5af2;
  --color-indigo: #5856D6;
  --color-indigo-light: #5e5ce6;
  --color-teal: #5AC8FA;
  --color-cyan: #32ADE6;

  /* Legacy color aliases (backward compatibility) */
  --color-primary: var(--tenant-primary, #007AFF);
  --color-primary-hover: var(--color-blue-600);
  --color-primary-active: var(--color-blue-700);
  --color-primary-light: rgba(0, 122, 255, 0.1);
  --color-success: var(--color-green);
  --color-success-hover: #28a745;
  --color-danger: var(--color-red);
  --color-danger-hover: #dc2626;
  --color-warning: var(--color-orange);
  --color-info: var(--color-cyan);

  /* Apple-style color aliases */
  --apple-blue: #007AFF;
  --apple-blue-hover: #0056CC;
  --apple-green: #34C759;
  --apple-orange: #FF9500;
  --apple-red: #FF3B30;
  --apple-purple: #AF52DE;
  --apple-gray: #8E8E93;
  --apple-gray-light: #F2F2F7;

  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #e8e8ed;
  --bg-elevated: #ffffff;
  --bg-grouped: #f2f2f7;
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #fafafa;
  --color-bg-tertiary: #f5f5f7;
  --color-bg-page: #F5F5F7;
  --color-bg-card: #FFFFFF;

  /* Text Colors */
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-placeholder: #a1a1a6;
  --text-inverse: #ffffff;
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #4b5563;
  --color-text-muted: #595959;
  --color-text-placeholder: #595959;

  /* Border Colors */
  --border-default: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.04);
  --border-medium: rgba(0, 0, 0, 0.12);
  --border-focus: var(--color-blue-500);
  --color-border: #d1d1d6;
  --color-border-light: #e8e8ed;
  --color-border-hover: #B8B8BD;

  /* ========================================
     SPACING - 8px Grid System
     ======================================== */
  --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 - Apple's Rounded Corners
     ======================================== */
  --radius-none: 0;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-3xl: 24px;
  --radius-full: 9999px;

  /* ========================================
     SHADOWS - Apple's Layered Shadows
     ======================================== */

  /* Subtle shadow for cards */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04),
               0 1px 2px rgba(0, 0, 0, 0.02);

  /* Default card shadow */
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04),
               0 4px 16px rgba(0, 0, 0, 0.04);

  /* Elevated cards and modals */
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.05),
               0 8px 32px rgba(0, 0, 0, 0.08);

  /* Floating elements, dropdowns */
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.08),
               0 16px 48px rgba(0, 0, 0, 0.12);

  /* Modal overlays */
  --shadow-2xl: 0 12px 40px rgba(0, 0, 0, 0.12),
                0 24px 80px rgba(0, 0, 0, 0.16);

  /* Colored shadows for buttons */
  --shadow-blue: 0 4px 14px rgba(0, 122, 255, 0.25);
  --shadow-green: 0 4px 14px rgba(52, 199, 89, 0.25);
  --shadow-red: 0 4px 14px rgba(255, 59, 48, 0.25);

  /* Inner shadow for inputs */
  --shadow-inner: inset 0 1px 2px rgba(0, 0, 0, 0.06);

  /* Focus ring */
  --shadow-focus: 0 0 0 4px rgba(0, 122, 255, 0.25);
  --focus-ring: 0 0 0 3px var(--color-primary-light);
  --focus-ring-danger: 0 0 0 3px rgba(255, 59, 48, 0.2);

  /* ========================================
     TRANSITIONS - Spring-like Animations
     ======================================== */
  --duration-instant: 0ms;
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;
  --duration-slowest: 700ms;

  /* Apple-style easing curves */
  --ease-default: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-in: cubic-bezier(0.42, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.58, 1);
  --ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);
  --ease-spring-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Legacy transition helpers */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* ========================================
     Z-INDEX Scale
     ======================================== */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-sidebar: 350;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;
  --z-command-palette: 900;

  /* ========================================
     COMPONENT TOKENS
     ======================================== */

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 72px;
  --sidebar-bg: linear-gradient(180deg, #f8f8fa 0%, #f2f2f5 100%);
  --sidebar-border: rgba(0, 0, 0, 0.06);

  /* Navbar */
  --navbar-height: 56px;
  --navbar-bg: rgba(255, 255, 255, 0.72);
  --navbar-blur: 20px;
  --navbar-border: rgba(0, 0, 0, 0.06);

  /* Cards */
  --card-bg: #ffffff;
  --card-border: var(--border-light);
  --card-radius: var(--radius-xl);
  --card-padding: var(--space-5);
  --card-shadow: var(--shadow-md);

  /* Inputs */
  --input-height: 44px;
  --input-height-sm: 36px;
  --input-height-lg: 52px;
  --input-bg: #ffffff;
  --input-border: var(--color-border);
  --input-border-focus: var(--color-blue-500);
  --input-radius: var(--radius-lg);
  --input-focus-ring: var(--shadow-focus);

  /* Buttons */
  --btn-height: 44px;
  --btn-height-sm: 34px;
  --btn-height-lg: 52px;
  --btn-radius: var(--radius-lg);
  --btn-font-weight: var(--font-semibold);

  /* Tables */
  --table-header-bg: var(--bg-secondary);
  --table-row-hover: rgba(0, 122, 255, 0.04);
  --table-border: var(--border-light);
  --table-radius: var(--radius-xl);

  /* Modals */
  --modal-bg: #ffffff;
  --modal-radius: var(--radius-2xl);
  --modal-shadow: var(--shadow-2xl);
  --modal-backdrop: rgba(0, 0, 0, 0.4);
  --modal-backdrop-blur: 8px;

  /* Status Badge Colors */
  --badge-success-bg: #e8f9ed;
  --badge-success-text: #1a7f37;
  --badge-warning-bg: #fff8e6;
  --badge-warning-text: #9a6700;
  --badge-danger-bg: #fef2f2;
  --badge-danger-text: #cf1124;
  --badge-info-bg: #e8f4fd;
  --badge-info-text: #0969da;
  --badge-neutral-bg: #f3f4f6;
  --badge-neutral-text: #4b5563;
}

/* ========================================
   DARK MODE TOKENS (legacy stub removed)
   See comprehensive dark mode at end of file
   ======================================== */

/* ========================================
   ANIMATIONS & KEYFRAMES
   ======================================== */

/* Toast / Message dismiss animation */
@keyframes slideUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-10px);
    opacity: 0;
  }
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fade in up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Spring scale animation */
@keyframes springScale {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pulse animation for loading states */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Shimmer animation for skeleton loading */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Shake animation for errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Bounce animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(-8px);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* Spin animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

/* Typography utilities */
.text-display {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.text-headline {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

.text-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
}

.text-body {
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
}

.text-caption {
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  color: var(--text-secondary);
}

.text-footnote {
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  color: var(--text-tertiary);
}

/* Animation utilities */
.animate-fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.animate-fade-in-up {
  animation: fadeInUp var(--duration-normal) var(--ease-out);
}

.animate-scale-in {
  animation: scaleIn var(--duration-normal) var(--ease-spring);
}

.animate-spring-scale {
  animation: springScale var(--duration-slow) var(--ease-spring);
}

.animate-pulse {
  animation: pulse 2s var(--ease-in-out) infinite;
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-gray-100) 25%,
    var(--color-gray-200) 50%,
    var(--color-gray-100) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.animate-shake {
  animation: shake 0.5s var(--ease-out);
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ===========================================
   APPLE-INSPIRED CARD COMPONENT
   =========================================== */

.apple-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  padding: var(--card-padding);
  transition: box-shadow var(--duration-normal) var(--ease-default),
              transform var(--duration-normal) var(--ease-default);
}

.apple-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.apple-card-interactive {
  cursor: pointer;
}

.apple-card-interactive:active {
  transform: scale(0.98);
}

/* Glass effect (for navbars, overlays) */
.glass {
  background: var(--navbar-bg);
  backdrop-filter: blur(var(--navbar-blur));
  -webkit-backdrop-filter: blur(var(--navbar-blur));
}

/* ===========================================
   STANDARDIZED BUTTON CLASSES
   =========================================== */

/* Base button styles */
.btn,
.btn-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: var(--btn-height);
  font-size: var(--text-base);
  font-weight: var(--btn-font-weight);
  border-radius: var(--btn-radius);
  transition: all var(--duration-fast) var(--ease-default);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled,
.btn-base:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Primary button - Blue with gradient */
.btn-primary-tw {
  background: linear-gradient(180deg, #0a84ff 0%, #007AFF 100%);
  color: white !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary-tw:hover:not(:disabled) {
  background: linear-gradient(180deg, #1a8fff 0%, #0066d6 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-blue);
}

.btn-primary-tw:active:not(:disabled) {
  transform: translateY(0);
  background: linear-gradient(180deg, #0066d6 0%, #0052ad 100%);
}

/* Secondary button - Light gray */
.btn-secondary-tw {
  background: var(--color-gray-100);
  color: var(--text-primary) !important;
  border: 1px solid var(--border-medium);
}

.btn-secondary-tw:hover:not(:disabled) {
  background: var(--color-gray-200);
  border-color: var(--border-default);
}

/* Danger button - Red */
.btn-danger-tw {
  background: linear-gradient(180deg, #ff453a 0%, #FF3B30 100%);
  color: white !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-danger-tw:hover:not(:disabled) {
  background: linear-gradient(180deg, #ff5c52 0%, #e6352b 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-red);
}

/* Success button - Green */
.btn-success-tw {
  background: linear-gradient(180deg, #30d158 0%, #34C759 100%);
  color: white !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-success-tw:hover:not(:disabled) {
  background: linear-gradient(180deg, #40db68 0%, #2fb350 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-green);
}

/* Outline button variants */
.btn-outline-primary {
  background: transparent;
  border: 1.5px solid var(--color-blue-500);
  color: var(--color-blue-500);
}

.btn-outline-primary:hover:not(:disabled) {
  background: var(--color-blue-50);
}

/* Ghost button (no background) */
.btn-ghost {
  background: transparent;
  color: var(--color-blue-500);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-blue-50);
}

/* Button sizes */
.btn-sm {
  height: var(--btn-height-sm);
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.btn-lg {
  height: var(--btn-height-lg);
  padding: 0 var(--space-6);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

/* Icon button (square, for icon-only buttons) */
.btn-icon {
  padding: 0;
  width: var(--btn-height);
  height: var(--btn-height);
}

.btn-icon-sm {
  width: var(--btn-height-sm);
  height: var(--btn-height-sm);
}

/* Button with loading state */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ===========================================
   PREMIUM INPUT STYLES
   =========================================== */

.input-premium {
  display: block;
  width: 100%;
  height: var(--input-height);
  padding: 0 var(--space-4);
  font-size: var(--text-base);
  font-family: var(--font-family-sans);
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  transition: border-color var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
}

.input-premium:hover {
  border-color: var(--color-gray-400);
}

.input-premium:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: var(--input-focus-ring);
}

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

.input-premium:disabled {
  background: var(--bg-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Input with error state */
.input-premium.input-error {
  border-color: var(--color-red);
}

.input-premium.input-error:focus {
  box-shadow: var(--focus-ring-danger);
}

/* Textarea premium */
textarea.input-premium {
  height: auto;
  min-height: 100px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
}

/* ===========================================
   STATUS BADGES
   =========================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success {
  background: var(--badge-success-bg);
  color: var(--badge-success-text);
}

.badge-success .badge-dot {
  background: var(--color-green);
}

.badge-warning {
  background: var(--badge-warning-bg);
  color: var(--badge-warning-text);
}

.badge-warning .badge-dot {
  background: var(--color-orange);
}

.badge-danger {
  background: var(--badge-danger-bg);
  color: var(--badge-danger-text);
}

.badge-danger .badge-dot {
  background: var(--color-red);
}

.badge-info {
  background: var(--badge-info-bg);
  color: var(--badge-info-text);
}

.badge-info .badge-dot {
  background: var(--color-blue-500);
}

.badge-neutral {
  background: var(--badge-neutral-bg);
  color: var(--badge-neutral-text);
}

.badge-neutral .badge-dot {
  background: var(--color-gray-500);
}

/* ===========================================
   EMPTY STATE COMPONENT
   =========================================== */

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  margin-bottom: var(--space-4);
}

.empty-state-icon i {
  font-size: 28px;
  color: var(--text-tertiary);
}

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

.empty-state-description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 360px;
  margin: 0 auto var(--space-4);
}

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

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-100) 25%,
    var(--color-gray-150) 50%,
    var(--color-gray-100) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-text:last-child {
  width: 70%;
}

.skeleton-heading {
  height: 24px;
  width: 60%;
  margin-bottom: 16px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-button {
  height: var(--btn-height);
  width: 120px;
}

/* ===========================================
   GLOBAL ACCESSIBILITY STYLES
   =========================================== */

/* Global focus visible styles */
*:focus-visible {
  outline: 2px solid var(--color-blue-500);
  outline-offset: 2px;
}

/* Remove default focus only when focus-visible is supported */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure interactive elements have visible focus */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-blue-500);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

/* Screen reader only utility */
.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;
}

/* Skip link styling */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-blue-500);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: 10000;
  transition: top var(--duration-fast) var(--ease-default);
  text-decoration: none;
  font-weight: var(--font-medium);
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  top: 0;
}

/* Ensure minimum touch target size (44x44px) */
@media (pointer: coarse) {
  button,
  a,
  input[type="checkbox"],
  input[type="radio"],
  select {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background-color: rgba(0, 122, 255, 0.2);
  color: inherit;
}

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

/* Dark mode removed — not needed at this time */
