/* SkyQuote Design System */
/* Unified tokens and components for consistent theming */

/* ===== GLOBAL BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--color-background-primary);
  min-height: 100vh;
  min-height: 100dvh; /* Use dynamic viewport height for iOS Safari */
  /* iOS Safari safe area handling */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ===== FONTAWESOME PRO GLOBAL CONFIGURATION ===== */
/* Ensure all FontAwesome classes use Pro font family */
.fas, .far, .fab, .fal, .fat, .fad,
[class^="fa-"], [class*=" fa-"] {
  font-family: "Font Awesome 6 Pro" !important;
}

/* Specific weight overrides for different FontAwesome styles */
.fas::before { font-weight: 900; } /* Solid */
.far::before { font-weight: 400; } /* Regular */
.fal::before { font-weight: 300; } /* Light */
.fat::before { font-weight: 100; } /* Thin */
.fab::before { font-weight: 400; } /* Brands */
.fad::before { font-weight: 900; } /* Duotone */

/* ===== FOUNDATION TOKENS ===== */
:root {
  /* Gray Scale */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

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

  /* Blue Scale */
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;

  /* Green Scale */
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;

  /* Red Scale */
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;

  /* Yellow Scale */
  --yellow-400: #fbbf24;
  --yellow-500: #f59e0b;
  --yellow-600: #d97706;
  --yellow-700: #b45309;
  --yellow-800: #92400e;
}

/* ===== SEMANTIC TOKENS (DARK THEME DEFAULT) ===== */
:root {
  /* Background Colors */
  --color-background-primary: var(--gray-900);
  --color-background-secondary: var(--slate-800);
  --color-background-tertiary: var(--slate-700);
  --color-background-elevated: var(--slate-700);
  --color-background-overlay: rgba(255, 255, 255, 0.05);

  /* Text Colors */
  --color-text-primary: var(--slate-50);
  --color-text-secondary: var(--gray-300);
  --color-text-tertiary: var(--gray-400);
  --color-text-muted: var(--gray-500);

  /* Interactive Colors */
  --color-primary: var(--blue-600);
  --color-primary-hover: var(--blue-700);
  --color-secondary: var(--gray-600);
  --color-secondary-hover: var(--gray-700);

  /* Semantic Colors */
  --color-success: var(--green-600);
  --color-success-hover: var(--green-700);
  --color-success-text: var(--green-400);
  --color-success-bg: rgba(34, 197, 94, 0.1);
  --color-success-border: rgba(34, 197, 94, 0.2);

  --color-danger: var(--red-600);
  --color-danger-hover: var(--red-700);
  --color-danger-text: var(--red-400);
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-danger-border: rgba(239, 68, 68, 0.2);

  --color-warning: var(--yellow-600);
  --color-warning-hover: var(--yellow-700);
  --color-warning-text: var(--yellow-400);
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-warning-border: rgba(245, 158, 11, 0.2);

  --color-info: var(--blue-600);
  --color-info-hover: var(--blue-700);
  --color-info-text: var(--blue-400);
  --color-info-bg: rgba(59, 130, 246, 0.1);
  --color-info-border: rgba(59, 130, 246, 0.2);

  /* Generic Status Colors - Semantic approach for any status system */
  --status-new-bg: var(--color-info-bg);
  --status-new-border: var(--color-info-border);
  --status-new-text: var(--color-info-text);

  --status-active-bg: var(--color-success-bg);
  --status-active-border: var(--color-success-border);
  --status-active-text: var(--color-success-text);

  --status-complete-bg: var(--color-warning-bg);
  --status-complete-border: var(--color-warning-border);
  --status-complete-text: var(--color-warning-text);

  --status-inactive-bg: rgba(107, 114, 128, 0.10); /* gray-500 @10% */
  --status-inactive-border: rgba(107, 114, 128, 0.20);
  --status-inactive-text: var(--color-text-tertiary);

  --status-error-bg: var(--color-danger-bg);
  --status-error-border: var(--color-danger-border);
  --status-error-text: var(--color-danger-text);

  --status-special-bg: rgba(20, 184, 166, 0.10); /* teal-500 @10% */
  --status-special-border: rgba(20, 184, 166, 0.20);
  --status-special-text: rgb(94, 234, 212); /* teal-300 */

  /* Border Colors */
  --color-border: var(--gray-700);
  --color-border-light: var(--gray-600);
  --color-border-muted: var(--gray-800);
  --color-border-focus: var(--blue-500);
  
  /* Shadow and overlay utilities */
  --shadow-focus: 0 0 0 2px rgba(59, 130, 246, 0.25);
  --color-focus-ring: rgba(59, 130, 246, 0.25);
  --color-overlay-dark: rgba(0, 0, 0, 0.7);
  --color-spinner-track: rgba(243, 244, 246, 0.3);
  --color-spinner-track-alt: rgba(156, 163, 175, 0.3);

  /* Chart Colors - Theme-aware chart color system */
  --chart-primary: var(--blue-600);
  --chart-primary-light: rgba(37, 99, 235, 0.5);
  --chart-secondary: var(--green-500);
  --chart-secondary-light: rgba(34, 197, 94, 0.5);
  --chart-tertiary: var(--yellow-500);
  --chart-tertiary-light: rgba(245, 158, 11, 0.5);
  --chart-quaternary: var(--red-500);
  --chart-quaternary-light: rgba(239, 68, 68, 0.5);
  --chart-quinary: var(--purple-500);
  --chart-quinary-light: rgba(139, 92, 246, 0.5);
  --chart-senary: var(--orange-500);
  --chart-senary-light: rgba(249, 115, 22, 0.5);
  --chart-septenary: var(--gray-500);
  --chart-septenary-light: rgba(107, 114, 128, 0.5);
  --chart-octonary: var(--blue-400);
  --chart-octonary-light: rgba(96, 165, 250, 0.5);

  /* Chart Grid and Axis Colors */
  --chart-grid-color: rgba(75, 85, 99, 0.2);
  --chart-grid-border: rgba(75, 85, 99, 0.5);
  --chart-axis-text: var(--gray-400);
  --chart-legend-text: var(--color-text-secondary);

  /* Chart Tooltip Colors */
  --chart-tooltip-bg: rgba(17, 24, 39, 0.9);
  --chart-tooltip-border: rgba(75, 85, 99, 0.5);
  --chart-tooltip-text: var(--gray-300);

  /* Transitions */
  --transition-colors: color 200ms ease-in-out, background-color 200ms ease-in-out, border-color 200ms ease-in-out;
  --transition-transform: transform 200ms ease-in-out;
}

/* ===== LIGHT THEME OVERRIDES ===== */
.theme-light {
  /* Background Colors - High contrast for excellent readability */
  --color-background-primary: white;                /* Pure white for main background */
  --color-background-secondary: var(--gray-50);     /* Very light gray for cards */
  --color-background-tertiary: var(--gray-100);     /* Light gray for sections */
  --color-background-elevated: white;               /* White for elevated elements */
  --color-background-overlay: rgba(59, 130, 246, 0.1); /* Blue overlay for light theme */

  /* Text Colors - Maximum contrast for readability */
  --color-text-primary: var(--gray-900);    /* Dark text on light backgrounds */
  --color-text-secondary: var(--gray-800);  /* Slightly lighter but still very readable */
  --color-text-tertiary: var(--gray-700);   /* Medium gray but still high contrast */
  --color-text-muted: var(--gray-600);      /* Muted but still readable */

  /* Border Colors - Enhanced visibility using design tokens */
  --color-border: var(--slate-300);         /* Stronger borders for better definition */
  --color-border-light: var(--slate-200);   /* Light borders for subtle separation */
  --color-border-muted: var(--slate-100);   /* Very light borders for minimal separation */

  /* Interactive Colors - Maintain accessibility */
  --color-primary: var(--blue-600);         /* Maintains excellent contrast on soft off-white */
  --color-primary-hover: var(--blue-700);
  --color-secondary: var(--slate-500);      /* Neutral gray for secondary buttons */
  --color-secondary-hover: var(--slate-600);

  /* Semantic Colors - Optimized for light theme */
  --color-success-text: var(--green-800);   /* Improved contrast from green-700 */
  --color-success-bg: rgba(34, 197, 94, 0.08);  /* Lighter background for better text contrast */
  --color-success-border: rgba(34, 197, 94, 0.25);

  --color-danger-text: var(--red-800);      /* Improved contrast from red-700 */
  --color-danger-bg: rgba(239, 68, 68, 0.08);   /* Lighter background */
  --color-danger-border: rgba(239, 68, 68, 0.25);

  --color-warning-text: var(--yellow-800);  /* Improved contrast from yellow-700 */
  --color-warning-bg: rgba(245, 158, 11, 0.08); /* Lighter background */
  --color-warning-border: rgba(245, 158, 11, 0.25);

  --color-info-text: var(--blue-800);       /* Improved contrast from blue-700 */
  --color-info-bg: rgba(59, 130, 246, 0.08);    /* Lighter background */
  --color-info-border: rgba(59, 130, 246, 0.25);

  /* Generic Status Colors - Light Theme Overrides */
  --status-new-bg: var(--color-info-bg);
  --status-new-border: var(--color-info-border);
  --status-new-text: var(--color-info-text);

  --status-active-bg: var(--color-success-bg);
  --status-active-border: var(--color-success-border);
  --status-active-text: var(--color-success-text);

  --status-complete-bg: var(--color-warning-bg);
  --status-complete-border: var(--color-warning-border);
  --status-complete-text: var(--color-warning-text);

  --status-error-bg: var(--color-danger-bg);
  --status-error-border: var(--color-danger-border);
  --status-error-text: var(--color-danger-text);

  --status-special-bg: rgba(20, 184, 166, 0.08); /* teal with lighter background for light theme */
  --status-special-border: rgba(20, 184, 166, 0.25);
  --status-special-text: rgb(13, 148, 136); /* teal-600 for better contrast on light background */

  /* Chart Colors - Light Theme Overrides - Maximum Contrast */
  --chart-grid-color: rgba(71, 85, 105, 0.8);        /* Very dark grid lines for maximum visibility */
  --chart-grid-border: rgba(51, 65, 85, 0.9);        /* Darkest border for definition */
  --chart-axis-text: #000000;                        /* Pure black for maximum contrast */
  --chart-legend-text: #000000;                      /* Pure black for maximum contrast */

  /* Chart Tooltip for Light Theme */
  --chart-tooltip-bg: rgba(255, 255, 255, 0.95);     /* Light background with slight transparency */
  --chart-tooltip-border: rgba(148, 163, 184, 0.5);  /* Light border */
  --chart-tooltip-text: #000000;                     /* Pure black for maximum contrast */
}

/* Light theme dropdown overrides */
.theme-light select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23374151' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* Fix hardcoded gray classes in light theme */
.theme-light .bg-gray-700,
.theme-light .bg-gray-800 {
  background-color: var(--color-background-secondary) !important;
}

.theme-light .text-gray-300,
.theme-light .text-gray-400 {
  color: var(--color-text-secondary) !important;
}

.theme-light .border-gray-700,
.theme-light .border-gray-600 {
  border-color: var(--color-border) !important;
}

.theme-light .dropdown-button {
  background-color: white;
  border: 1px solid var(--slate-300);
  color: var(--gray-900);
}

.theme-light .dropdown-button:hover {
  background-color: var(--gray-50);
  border-color: var(--slate-400);
}

.theme-light .dropdown-content {
  background-color: white;
  border: 1px solid var(--slate-300);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.theme-light .dropdown-item {
  color: var(--gray-900);
  border-bottom: 1px solid var(--gray-200);
}

.theme-light .dropdown-item:hover {
  background-color: var(--gray-50);
}

/* Light theme stat card enhancements */
.theme-light .stat-card {
  background-color: white;
  border: 1px solid var(--slate-200);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.theme-light .stat-card:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: var(--slate-300);
}

/* ===== APPOINTMENT STATUS BADGE TOKENS ===== */
:root {
  /* Map each appointment status to semantic colors */
  --appointment-status-pending-bg: var(--color-info-bg);
  --appointment-status-pending-border: var(--color-info-border);
  --appointment-status-pending-text: var(--color-info-text);

  --appointment-status-accepted-bg: var(--color-success-bg);
  --appointment-status-accepted-border: var(--color-success-border);
  --appointment-status-accepted-text: var(--color-success-text);

  --appointment-status-completed-bg: var(--color-warning-bg);
  --appointment-status-completed-border: var(--color-warning-border);
  --appointment-status-completed-text: var(--color-warning-text);

  --appointment-status-declined-bg: var(--color-danger-bg);
  --appointment-status-declined-border: var(--color-danger-border);
  --appointment-status-declined-text: var(--color-danger-text);

  /* These use brand tints not covered by semantic sets */
  --appointment-status-cancelled-bg: rgba(107, 114, 128, 0.10); /* gray-500 @10% */
  --appointment-status-cancelled-border: rgba(107, 114, 128, 0.20);
  --appointment-status-cancelled-text: var(--color-text-tertiary);

  --appointment-status-expired-bg: rgba(124, 58, 237, 0.10); /* purple-600 @10% */
  --appointment-status-expired-border: rgba(124, 58, 237, 0.20);
  --appointment-status-expired-text: #a78bfa; /* purple-400 */

  --appointment-status-noShow-bg: rgba(236, 72, 153, 0.10); /* pink-500 @10% */
  --appointment-status-noShow-border: rgba(236, 72, 153, 0.20);
  --appointment-status-noShow-text: #f472b6; /* pink-400 */

  /* Active variables used by the generic badge class */
  --appointment-status-bg: var(--appointment-status-pending-bg);
  --appointment-status-border: var(--appointment-status-pending-border);
  --appointment-status-text: var(--appointment-status-pending-text);
}

/* Appointment Status badge driven by variables */
.appointment-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  background-color: var(--appointment-status-bg);
  border: 1px solid var(--appointment-status-border);
  color: var(--appointment-status-text);
}

/* Status-specific variable setters */
.appointment-status-pending   { --appointment-status-bg: var(--appointment-status-pending-bg);   --appointment-status-border: var(--appointment-status-pending-border);   --appointment-status-text: var(--appointment-status-pending-text); }
.appointment-status-accepted  { --appointment-status-bg: var(--appointment-status-accepted-bg);  --appointment-status-border: var(--appointment-status-accepted-border);  --appointment-status-text: var(--appointment-status-accepted-text); }
.appointment-status-completed { --appointment-status-bg: var(--appointment-status-completed-bg); --appointment-status-border: var(--appointment-status-completed-border); --appointment-status-text: var(--appointment-status-completed-text); }
.appointment-status-declined  { --appointment-status-bg: var(--appointment-status-declined-bg);  --appointment-status-border: var(--appointment-status-declined-border);  --appointment-status-text: var(--appointment-status-declined-text); }
.appointment-status-cancelled { --appointment-status-bg: var(--appointment-status-cancelled-bg); --appointment-status-border: var(--appointment-status-cancelled-border); --appointment-status-text: var(--appointment-status-cancelled-text); }
.appointment-status-expired   { --appointment-status-bg: var(--appointment-status-expired-bg);   --appointment-status-border: var(--appointment-status-expired-border);   --appointment-status-text: var(--appointment-status-expired-text); }
.appointment-status-noShow    { --appointment-status-bg: var(--appointment-status-noShow-bg);    --appointment-status-border: var(--appointment-status-noShow-border);    --appointment-status-text: var(--appointment-status-noShow-text); }


/* ===== COMPONENT CLASSES ===== */

/* Layout Components */
/* Dashboard page container - for pages with sidebar layout */
.page-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Card Components */
.card-primary {
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border-muted);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: var(--transition-colors);
}

/* Enhanced card styling for light theme */
.theme-light .card-primary {
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border-light);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Enhanced background styling for light theme */
.theme-light .bg-tertiary {
  background-color: var(--color-background-tertiary) !important;
}

.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.5);
}

/* Stat Card Components - For Analytics Dashboard */
.stat-card {
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border-muted);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

/* Ensure hidden stat cards are properly hidden */
.stat-card.hidden {
  display: none !important;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: var(--color-border-light);
}

.stat-card-header {
  margin-bottom: 1rem;
}

.stat-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}

.stat-card-content {
  text-align: center;
  padding: 1.5rem;
}

.stat-card-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
}

.stat-card-description {
  font-size: 0.875rem;
  color: var(--color-text-tertiary);
  margin-top: 0.5rem;
}

.stat-card-trend {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.stat-card-trend.positive {
  color: var(--color-success-text);
}

.stat-card-trend.negative {
  color: var(--color-danger-text);
}

.stat-card-trend.neutral {
  color: var(--color-text-tertiary);
}

.stat-card-button {
  margin-top: 1rem;
  width: 100%;
  background-color: var(--color-primary);
  color: var(--color-text-primary);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: var(--transition-colors);
}

.stat-card-button:hover {
  background-color: var(--color-primary-hover);
}

/* Chart Container for Stat Cards */
.stat-card-chart {
  height: 16rem; /* 256px */
  margin-top: 1rem;
}

/* Dropdown Components */
.dropdown-container {
  position: relative;
  display: inline-block;
}

.dropdown-button {
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 150px;
  transition: var(--transition-colors);
}

.dropdown-button:hover {
  background-color: var(--color-background-tertiary);
  border-color: var(--color-border-light);
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 0.25rem;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: var(--transition-colors);
  border-bottom: 1px solid var(--color-border-muted);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: var(--color-background-tertiary);
}

.dropdown-item.selected {
  background-color: var(--color-primary);
  color: white;
}

/* Select Element Styling */
select {
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: var(--transition-colors);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

select option {
  background-color: var(--color-background-secondary);
  color: var(--color-text-primary);
}

/* Form Components */
.input-primary {
  background-color: var(--gray-700);
  border: 1px solid var(--gray-600);
  color: var(--color-text-primary);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  transition: var(--transition-colors);
}

.input-primary:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.input-primary::placeholder {
  color: var(--color-text-muted);
  opacity: 1; /* Ensure consistent placeholder opacity across browsers */
}

/* Input affix utilities (icons inside inputs) */
.input-affix { position: relative; }
.input-affix .input-primary { padding-left: 2.5rem; }
.input-affix .input-icon-left {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-text-tertiary);
}

/* Button Components */

/* Base Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-colors);
  cursor: pointer;
  font-family: inherit;
}

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

/* Button Variants - Standalone classes that include base styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-colors);
  cursor: pointer;
  font-family: inherit;
  background-color: var(--color-primary);
  color: white;
  padding: 0.5rem 1.5rem;
}

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

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-colors);
  cursor: pointer;
  font-family: inherit;
  background-color: var(--color-secondary);
  color: white;
  padding: 0.5rem 1.5rem;
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-secondary-hover);
}

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

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-colors);
  cursor: pointer;
  font-family: inherit;
  background-color: var(--color-danger);
  color: white;
  padding: 0.5rem 1.5rem;
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--color-danger-hover);
}

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

/* Automatic FontAwesome icon spacing for all button variants */
.btn-primary .fas,
.btn-secondary .fas,
.btn-danger .fas,
.btn-primary .far,
.btn-secondary .far,
.btn-danger .far,
.btn-primary .fab,
.btn-secondary .fab,
.btn-danger .fab,
.btn-primary .fal,
.btn-secondary .fal,
.btn-danger .fal {
  margin-right: 0.5rem !important;
}

/* Remove the :last-child rule since it conflicts with normal icon spacing */

/* Remove the :only-child rule since it conflicts with icons that have text */

/* Button Sizes */
.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
}

.btn-md {
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* Copy Button - Consistent icon button for copy actions */
.copy-btn {
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-left: 0.5rem;
}

.copy-btn:hover {
  color: var(--color-text-primary);
}

.btn-xl {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
}

/* Mobile responsive button sizes */
@media (max-width: 768px) {
  .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  .btn-md {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }

  .btn-xl {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}

/* Button with Icon Support */
.btn i {
  margin-right: 1rem !important;
  display: inline-block !important;
}

.btn i:last-child {
  margin-right: 0 !important;
  margin-left: 1rem !important;
  display: inline-block !important;
}

.btn i:only-child {
  margin: 0 !important;
  display: inline-block !important;
}

/* FontAwesome icon spacing using :after pseudo-element */
.btn .fas:after,
.btn .far:after,
.btn .fab:after,
.btn .fal:after {
  content: '' !important;
  display: inline-block !important;
  width: 0.75rem !important;
}

.btn .fas:last-child:after,
.btn .far:last-child:after,
.btn .fab:last-child:after,
.btn .fal:last-child:after {
  width: 0 !important;
  margin-left: 0.75rem !important;
}

.btn .fas:only-child:after,
.btn .far:only-child:after,
.btn .fab:only-child:after,
.btn .fal:only-child:after {
  width: 0 !important;
  margin: 0 !important;
}

/* Ensure FontAwesome icons in buttons have proper spacing */
.btn .fas,
.btn .far,
.btn .fab,
.btn .fal {
  margin-right: 1rem !important;
  display: inline-block !important;
}

.btn .fas:last-child,
.btn .far:last-child,
.btn .fab:last-child,
.btn .fal:last-child {
  margin-right: 0 !important;
  margin-left: 1rem !important;
  display: inline-block !important;
}

.btn .fas:only-child,
.btn .far:only-child,
.btn .fab:only-child,
.btn .fal:only-child {
  margin: 0 !important;
  display: inline-block !important;
}

/* FontAwesome class-specific pseudo-element spacing */
.btn .fas:before,
.btn .far:before,
.btn .fab:before,
.btn .fal:before {
  padding-right: 0.5rem !important;
}

.btn .fas:last-child:before,
.btn .far:last-child:before,
.btn .fab:last-child:before,
.btn .fal:last-child:before {
  padding-right: 0 !important;
  padding-left: 0.5rem !important;
}

.btn .fas:only-child:before,
.btn .far:only-child:before,
.btn .fab:only-child:before,
.btn .fal:only-child:before {
  padding: 0 !important;
}

/* Override any Tailwind spacing classes for button icons */
.btn [class*="mr-"],
.btn [class*="ml-"] {
  margin-left: 0 !important;
  margin-right: 1rem !important;
}

.btn [class*="mr-"]:last-child,
.btn [class*="ml-"]:last-child {
  margin-right: 0 !important;
  margin-left: 1rem !important;
}

.btn [class*="mr-"]:only-child,
.btn [class*="ml-"]:only-child {
  margin: 0 !important;
}

/* Ultra-specific rules to ensure icon spacing works */
button.btn i.fas,
button.btn i.far,
button.btn i.fab,
button.btn i.fal {
  margin-right: 1rem !important;
  margin-left: 0 !important;
  display: inline-block !important;
}

button.btn i.fas:last-child,
button.btn i.far:last-child,
button.btn i.fab:last-child,
button.btn i.fal:last-child {
  margin-right: 0 !important;
  margin-left: 1rem !important;
  display: inline-block !important;
}

button.btn i.fas:only-child,
button.btn i.far:only-child,
button.btn i.fab:only-child,
button.btn i.fal:only-child {
  margin: 0 !important;
  display: inline-block !important;
}

/* Ultra-specific pseudo-element rules */
button.btn i.fas:before,
button.btn i.far:before,
button.btn i.fab:before,
button.btn i.fal:before {
  padding-right: 0.5rem !important;
}

button.btn i.fas:last-child:before,
button.btn i.far:last-child:before,
button.btn i.fab:last-child:before,
button.btn i.fal:last-child:before {
  padding-right: 0 !important;
  padding-left: 0.5rem !important;
}

button.btn i.fas:only-child:before,
button.btn i.far:only-child:before,
button.btn i.fab:only-child:before,
button.btn i.fal:only-child:before {
  padding: 0 !important;
}

/* Status Components */
.status-success {
  background-color: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success-text);
  border-radius: 0.5rem;
  padding: 1rem;
}

.status-danger {
  background-color: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger-text);
  border-radius: 0.5rem;
  padding: 1rem;
}

.status-warning {
  background-color: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning-text);
  border-radius: 0.5rem;
  padding: 1rem;
}

.status-info {
  background-color: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  color: var(--color-info-text);
  border-radius: 0.5rem;
  padding: 1rem;
}

/* Status Badge Variants (for smaller status indicators) */
.status-badge-success {
  background-color: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success-text);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.status-badge-danger {
  background-color: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger-text);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.status-badge-warning {
  background-color: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning-text);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.status-badge-info {
  background-color: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  color: var(--color-info-text);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

/* ===== UNIVERSAL STATUS BADGE SYSTEM ===== */
/* Generic status badge base class and semantic modifiers */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  transition: all 0.2s;
  border: 1px solid transparent;
}

/* Semantic status modifiers - can be used by any status system */
.status-new {
  background-color: var(--status-new-bg);
  border-color: var(--status-new-border);
  color: var(--status-new-text);
}

.status-active {
  background-color: var(--status-active-bg);
  border-color: var(--status-active-border);
  color: var(--status-active-text);
}

.status-complete {
  background-color: var(--status-complete-bg);
  border-color: var(--status-complete-border);
  color: var(--status-complete-text);
}

.status-inactive {
  background-color: var(--status-inactive-bg);
  border-color: var(--status-inactive-border);
  color: var(--status-inactive-text);
}

.status-error {
  background-color: var(--status-error-bg);
  border-color: var(--status-error-border);
  color: var(--status-error-text);
}

.status-special {
  background-color: var(--status-special-bg);
  border-color: var(--status-special-border);
  color: var(--status-special-text);
}

/* Alert/Info Components */
.alert-info {
  background-color: var(--color-background-secondary);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.alert-info i {
  margin-right: 0.5rem;
}

.callout-info {
  background-color: var(--color-info-bg);
  border-left: 4px solid var(--color-primary);
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

.feature-item {
  display: flex;
  align-items: center;
  margin: 0.5rem 0;
  padding: 0.5rem;
  background-color: var(--color-background-overlay);
  border-radius: 0.375rem;
}

.feature-item i {
  color: var(--color-success);
  margin-right: 0.75rem;
  font-size: 1.1em;
}

/* Feature list component for consistent checkmark bullets */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  margin: 0.5rem 0;
}

.feature-list .fa-check {
  color: var(--color-success-text);
  margin-right: 0.5rem;
  flex-shrink: 0;
  font-size: 0.875rem;
}

/* Light theme overrides for alert components */
.theme-light .alert-info {
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border-light);
}

.theme-light .callout-info {
  background-color: var(--color-info-bg);
  border-left: 4px solid var(--color-primary);
}

.theme-light .feature-item {
  background-color: var(--color-background-overlay);
}

/* Custom Container (for pages that use this pattern) */
.custom-container {
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border-muted);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: var(--transition-colors);
}

/* Modal Components */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background-color: var(--slate-800);
  color: var(--color-text-primary);
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}


/* Form Validation States */
.input-error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 2px var(--color-danger-border);
}

.input-success {
  border-color: var(--color-success);
  box-shadow: 0 0 0 2px var(--color-success-border);
}

/* Utility Classes for Theme Compatibility */
.bg-primary {
  background-color: var(--color-background-primary) !important;
}

.bg-secondary {
  background-color: var(--color-background-secondary) !important;
}

.bg-tertiary {
  background-color: var(--color-background-tertiary) !important;
}

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

.text-secondary {
  color: var(--color-text-secondary) !important;
}

.text-tertiary {
  color: var(--color-text-tertiary) !important;
}

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

/* Analytics Page Specific Utilities */
.analytics-page {
  background-color: var(--color-background-primary);
  color: var(--color-text-primary);
  min-height: 100vh;
}

.analytics-header {
  background-color: var(--color-background-secondary);
  border-bottom: 1px solid var(--color-border-muted);
  padding: 1.5rem;
}

.analytics-title {
  color: var(--color-text-primary);
  font-size: 1.875rem;
  font-weight: 700;
}

.analytics-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.text-tertiary {
  color: var(--color-text-tertiary) !important;
}

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

.text-info-text {
  color: var(--color-info-text) !important;
}

.text-danger-text {
  color: var(--color-danger-text) !important;
}

.text-success-text {
  color: var(--color-success-text) !important;
}

.text-warning-text {
  color: var(--color-warning-text) !important;
}

.text-required-text {
  color: var(--color-danger-text) !important;
}

.border-default {
  border-color: var(--color-border) !important;
}

.border-light {
  border-color: var(--color-border-light) !important;
}

.border-muted {
  border-color: var(--color-border-muted) !important;
}

.border-focus {
  border-color: var(--color-border-focus) !important;
}

.focus\:border-focus:focus {
  border-color: var(--color-border-focus) !important;
}

.focus\:ring-2:focus {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}

.hover\:text-primary:hover {
  color: var(--color-text-primary) !important;
}

.hover\:text-secondary:hover {
  color: var(--color-text-secondary) !important;
}

.hover\:text-info-text:hover {
  color: var(--color-info-text) !important;
}

/* Light theme overrides for modal and inputs */
.theme-light .modal-content {
  background-color: var(--color-background-secondary);
}

.theme-light .input-primary {
  background-color: var(--color-background-secondary);
  border: 1px solid var(--slate-300);
}

/* Override common Tailwind patterns that conflict with theming */
.bg-gray-900 {
  background-color: var(--color-background-primary) !important;
}

.bg-slate-800 {
  background-color: var(--color-background-secondary) !important;
}

.bg-gray-800 {
  background-color: var(--color-background-tertiary) !important;
}

.text-gray-100 {
  color: var(--color-text-primary) !important;
}

.text-gray-300 {
  color: var(--color-text-secondary) !important;
}

.text-gray-400 {
  color: var(--color-text-tertiary) !important;
}

.border-gray-700 {
  border-color: var(--color-border) !important;
}

.border-gray-600 {
  border-color: var(--color-border-light) !important;
}

/* ===== TOOLTIP COMPONENTS ===== */
/* Reusable tooltip system matching appnav style */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  position: fixed;
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  visibility: hidden;
}

.tooltip-text.show {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
}

.tooltip-text::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -4px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 4px solid var(--color-background-secondary);
}

.tooltip-icon {
  color: var(--color-text-tertiary);
  cursor: help;
  transition: color 0.2s ease;
}

.tooltip-icon:hover {
  color: var(--color-primary);
}

/* Light theme overrides for tooltips */
.theme-light .tooltip-text {
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-light .tooltip-text::before {
  border-right-color: var(--color-background-secondary);
}

/* ===== ADDRESS DROPDOWN COMPONENTS ===== */
/* Standardized dropdown for Google Places and custom address autocomplete */

/* Main dropdown container */
.address-dropdown {
  position: fixed;
  background-color: var(--color-background-secondary) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4) !important;
  z-index: 50000;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  min-width: 200px;
  margin-top: 0.25rem !important;
}

.address-dropdown.show {
  display: block;
}

/* Note: Google Places Autocomplete (.pac-*) styles are now handled by the address-autocomplete web component */
/* This ensures the component works on all pages, regardless of whether design-system.css is loaded */

/* ===== TOAST NOTIFICATION COMPONENTS ===== */
/* Toast notification system using design system tokens */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999999999999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  background-color: var(--color-background-secondary);
  color: var(--color-text-primary);
  padding: 12px 20px;
  border-radius: 5px;
  margin-bottom: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 200px;
  font-family: inherit;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  pointer-events: auto;
  border: 1px solid var(--color-border);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background-color: var(--color-success);
  color: white;
  border-color: var(--color-success-border);
}

.toast.warning {
  background-color: var(--color-warning);
  color: white;
  border-color: var(--color-warning-border);
}

.toast.info {
  background-color: var(--color-info);
  color: white;
  border-color: var(--color-info-border);
}

.toast.error {
  background-color: var(--color-danger);
  color: white;
  border-color: var(--color-danger-border);
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-size: 20px;
  cursor: pointer;
  padding: 0 0 0 10px;
  opacity: 0.7;
}

.toast-close:hover {
  opacity: 1;
}

/* Light theme overrides for toasts */
.theme-light .toast {
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}
/* Ensure error toasts keep their red background and white text in light theme */
.theme-light .toast.error {
  background-color: var(--color-danger) !important;
  color: white !important;
  border-color: var(--color-danger-border);
}
.theme-light .toast.success {
  background-color: var(--color-success) !important;
  color: white !important;
  border-color: var(--color-success-border);
}
.theme-light .toast.warning {
  background-color: var(--color-warning) !important;
  color: white !important;
  border-color: var(--color-warning-border);
}
.theme-light .toast.info {
  background-color: var(--color-info) !important;
  color: white !important;
  border-color: var(--color-info-border);
}

/* ===== TOAST-POPUP MODAL DIALOG COMPONENTS ===== */
/* Modal dialogs for confirmPopup, showAlert, and showPopup functions */

.toast-popup-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483646;
}

.toast-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.toast-popup-content {
  background: var(--color-background-secondary);
  width: 100%;
  max-width: 28rem;
  margin: 0 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  position: relative;
  z-index: 2147483647;
  border: 1px solid var(--color-border);
}

.toast-popup-title {
  padding: 1rem;
  margin: 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: 1.125rem;
  font-weight: 600;
}

.toast-popup-message {
  padding: 1rem;
  margin: 0;
  color: var(--color-text-primary);
  line-height: 1.5;
  white-space: pre-line;
}

.toast-popup-actions {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.toast-popup-actions button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 14px;
  transition: background-color 0.2s;
  border: none;
  color: white;
  cursor: pointer;
}

.toast-popup-actions button.secondary {
  background-color: var(--color-secondary);
}

.toast-popup-actions button.secondary:hover {
  background-color: var(--color-secondary-hover);
}

.toast-popup-actions button.primary {
  background-color: var(--color-primary);
}

.toast-popup-actions button.primary:hover {
  background-color: var(--color-primary-hover);
}

/* Light theme overrides for toast-popup modals */
.theme-light .toast-popup-content {
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.03);
}

.theme-light .toast-popup-title {
  border-bottom: 1px solid var(--color-border);
}

.theme-light .toast-popup-actions {
  border-top: 1px solid var(--color-border);
}

/* ===== STATUS COMPONENTS (FROM SHARED-LEAD.CSS) ===== */
/* Reusable status buttons and badges for lead/client management */

/* Status button base styles */
.status-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
  font-size: 0.9375rem;
  border: none;
  cursor: pointer;
}

/* Status button variants */
.status-button-not-contacted {
  background-color: var(--status-new-bg);
  color: var(--status-new-text);
}

.status-button-not-contacted:hover {
  background-color: var(--status-new-border);
}

.status-button-contacted {
  background-color: var(--status-active-bg);
  color: var(--status-active-text);
}

.status-button-contacted:hover {
  background-color: var(--status-active-border);
}

.status-button-lost {
  background-color: var(--status-inactive-bg);
  color: var(--status-inactive-text);
}

.status-button-lost:hover {
  background-color: var(--status-inactive-border);
}

.status-button-spam {
  background-color: var(--status-error-bg);
  color: var(--status-error-text);
}

.status-button-spam:hover {
  background-color: var(--status-error-border);
}

.status-button-sold {
  background-color: var(--status-complete-bg);
  color: var(--status-complete-text);
}

.status-button-sold:hover {
  background-color: var(--status-complete-border);
}

.status-button-completed {
  background-color: var(--status-special-bg);
  color: var(--status-special-text);
}

.status-button-completed:hover {
  background-color: var(--status-special-border);
}

/* Status badge variants */
.status-badge-not-contacted {
  background-color: var(--status-new-bg);
  border: 1px solid var(--status-new-border);
  color: var(--status-new-text);
}

.status-badge-contacted {
  background-color: var(--status-active-bg);
  border: 1px solid var(--status-active-border);
  color: var(--status-active-text);
}

.status-badge-sold {
  background-color: var(--status-complete-bg);
  border: 1px solid var(--status-complete-border);
  color: var(--status-complete-text);
}

.status-badge-completed {
  background-color: var(--status-special-bg);
  border: 1px solid var(--status-special-border);
  color: var(--status-special-text);
}

.status-badge-lost {
  background-color: var(--status-inactive-bg);
  border: 1px solid var(--status-inactive-border);
  color: var(--status-inactive-text);
}

.status-badge-spam {
  background-color: var(--status-error-bg);
  border: 1px solid var(--status-error-border);
  color: var(--status-error-text);
}

/* ===== UTILITY COMPONENTS ===== */

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.5);
}

/* Copy tooltip */
.copied-tooltip {
  position: fixed;
  background-color: #10b981;
  color: black;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Light theme override for copy tooltip */
.theme-light .copied-tooltip {
  background-color: #10b981;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ===== EXPANDABLE SECTIONS COMPONENTS ===== */
/* Reusable expand/collapse sections with design system integration */

.expandable-section {
  border: 1px solid var(--color-info-border);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  background-color: var(--color-background-secondary);
}

.expandable-header {
  padding: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-background-overlay);
  border-radius: 0.75rem 0.75rem 0 0;
  transition: all 0.2s ease;
}

.expandable-header:hover {
  background-color: var(--color-background-elevated);
}

.expandable-content.collapsed {
  display: none;
}

.expandable-content.expanded {
  display: block;
  padding: 1rem;
  background-color: var(--color-background-secondary);
  border-radius: 0 0 0.75rem 0.75rem;
}

.expandable-arrow {
  transition: transform 0.3s ease;
}

.expandable-header.active .expandable-arrow {
  transform: rotate(180deg);
}

/* ===== ACTION BUTTON COMPONENTS ===== */
/* Reusable action button groups and individual buttons */

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  min-width: fit-content;
}

.action-button {
  min-width: 90px;
  flex-shrink: 0;
  white-space: nowrap;
  text-align: center;
}

/* ===== DIVIDER COMPONENTS ===== */
/* Reusable horizontal dividers with theme support */

.divider {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1.5rem 0;
}

/* Light theme override for divider */
.theme-light .divider {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* ===== URL TEXT COMPONENTS ===== */
/* Reusable URL text styling with proper word-breaking */

.link-url {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  margin-right: 1rem;
}

/* ===== LOADING SPINNER COMPONENTS ===== */
/* Reusable loading spinner for buttons and content areas */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

/* Light theme override for loading spinner */
.theme-light .loading-spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--color-text-primary);
}

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

/* ===== SCROLLBAR COMPONENTS ===== */
/* Consistent scrollbar styling across all components */

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

::-webkit-scrollbar-track {
  background: var(--color-background-tertiary);
  border-radius: 4px;
}

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

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

/* Light theme scrollbar overrides */
.theme-light ::-webkit-scrollbar-track {
  background: var(--gray-100);
}

.theme-light ::-webkit-scrollbar-thumb {
  background: var(--gray-400);
}

.theme-light ::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* ===== TOGGLE SWITCH COMPONENTS ===== */
/* Reusable toggle switch component using design system tokens */

.toggle-switch {
  width: 2.25rem; /* w-9 */
  height: 1.25rem; /* h-5 */
  background-color: var(--color-background-tertiary);
  border-radius: 9999px;
  position: relative;
  transition: background-color 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem; /* 4 */
  height: 1rem; /* 4 */
  background-color: white;
  border-radius: 9999px;
  transition: transform 0.2s;
  border: 1px solid #d1d5db;
}

.toggle-switch.checked {
  background-color: var(--color-primary);
}

.toggle-switch.checked::after {
  transform: translateX(100%);
  border-color: white;
}

.toggle-switch.success {
  background-color: var(--color-success);
}

/* Focus ring for toggle */
.toggle-switch:focus-within {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-border-focus);
}

/* Light theme overrides for toggle switch */
.theme-light .toggle-switch {
  background-color: var(--gray-300);
}

.theme-light .toggle-switch::after {
  border: 1px solid var(--gray-400);
}

.theme-light .toggle-switch.checked {
  background-color: var(--color-primary);
}

.theme-light .toggle-switch.checked::after {
  border-color: white;
}

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

/* Slide in animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out forwards;
}

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

.loading-skeleton {
  background: linear-gradient(90deg, var(--slate-800) 25%, var(--slate-700) 50%, var(--slate-800) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

/* Light theme override for loading skeleton */
.theme-light .loading-skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
}
