/* Design System - Colors, Gradients, Shadows, Blur Effects */

:root {
  --primary-color: #007AFF;
  --primary-dark: #0051D5;
  --urgent-color: #FF3B30;
  --ready-color: #34C759;
  --warning-color: #FF9500;
  --background-color: #F5F7FA;
  --card-background: #FFFFFF;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-medium: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.15);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* Shadows */
.shadow-subtle {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.shadow-medium {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.shadow-prominent {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

/* Blur Effects */
.blur-light {
  backdrop-filter: blur(10px) brightness(1.05);
  -webkit-backdrop-filter: blur(10px) brightness(1.05);
  background-color: rgba(255, 255, 255, 0.75);
}

.blur-medium {
  backdrop-filter: blur(20px) brightness(1.08);
  -webkit-backdrop-filter: blur(20px) brightness(1.08);
  background-color: rgba(255, 255, 255, 0.85);
}

.blur-heavy {
  backdrop-filter: blur(30px) brightness(1.1);
  -webkit-backdrop-filter: blur(30px) brightness(1.1);
  background-color: rgba(255, 255, 255, 0.9);
}

/* Button Blur Overlay */
.blur-button {
  backdrop-filter: blur(8px) contrast(1.1);
  -webkit-backdrop-filter: blur(8px) contrast(1.1);
  background: rgba(255, 255, 255, 0.05);
}

/* Gradients - Enhanced with multiple stops */
.gradient-primary {
  background: linear-gradient(135deg, #0090FF 0%, #0070E8 50%, #004FBF 100%);
}

.gradient-urgent {
  background: linear-gradient(135deg, #FF4B45 0%, #E63C2B 50%, #CC0000 100%);
}

.gradient-ready {
  background: linear-gradient(135deg, #34C759 0%, #30B24A 50%, #2A9F3D 100%);
}

.gradient-warning {
  background: linear-gradient(135deg, #FFA500 0%, #FF9500 50%, #FF7A00 100%);
}

/* Border Styles */
.border-subtle {
  border: 1px solid var(--border-subtle);
}

.border-medium {
  border: 1px solid var(--border-medium);
}

.border-strong {
  border: 1px solid var(--border-strong);
}

/* Border Radius */
.rounded-sm {
  border-radius: 8px;
}

.rounded-md {
  border-radius: 12px;
}

.rounded-lg {
  border-radius: 16px;
}

.rounded-xl {
  border-radius: 20px;
}

/* Cards & Panels */
.card {
  background: var(--card-background);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-elevated {
  background: var(--card-background);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-subtle);
}

.card-highlighted {
  background: var(--card-background);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-subtle);
}

.panel {
  background: var(--card-background);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Buttons - Sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  min-height: 36px;
  border-radius: var(--radius-md);
  line-height: 1.2;
}

.btn-md {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  min-height: 44px;
  border-radius: var(--radius-md);
  line-height: 1.3;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
  min-height: 52px;
  border-radius: var(--radius-lg);
  line-height: 1.4;
}

/* Buttons - Primary */
.btn-primary {
  background: linear-gradient(135deg, #0090FF 0%, #0070E8 50%, #004FBF 100%);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 112, 232, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(0, 112, 232, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 112, 232, 0.3), inset 0 1px 0 rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 112, 232, 0.15), inset 0 0 0 1px rgba(0, 112, 232, 0.3);
  filter: saturate(0.7);
}

/* Buttons - Secondary */
.btn-secondary {
  background: var(--card-background);
  color: #0070E8;
  border: 2px solid #0070E8;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 112, 232, 0.08);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, rgba(0, 144, 255, 0.08), rgba(0, 112, 232, 0.08));
  box-shadow: 0 6px 16px rgba(0, 112, 232, 0.2);
  transform: translateY(-2px);
}

.btn-secondary:active {
  background: linear-gradient(135deg, rgba(0, 144, 255, 0.12), rgba(0, 112, 232, 0.12));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 112, 232, 0.15);
}

.btn-secondary:disabled {
  cursor: not-allowed;
  filter: saturate(0.7);
  opacity: 0.75;
}

/* Buttons - Secondary Soft (White transparent) */
.btn-secondary-soft {
  background: rgba(255, 255, 255, 0.6);
  color: #0070E8;
  border: 1px solid rgba(0, 112, 232, 0.2);
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn-secondary-soft:hover {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(0, 112, 232, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.btn-secondary-soft:active {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(0px);
  box-shadow: 0 2px 6px rgba(0, 112, 232, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

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

/* Buttons - Urgent */
.btn-urgent {
  background: linear-gradient(135deg, #FF4B45 0%, #E63C2B 50%, #CC0000 100%);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(230, 60, 43, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-urgent:hover {
  box-shadow: 0 12px 32px rgba(230, 60, 43, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
}

.btn-urgent:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(230, 60, 43, 0.35), inset 0 1px 0 rgba(0, 0, 0, 0.1);
}

.btn-urgent:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(230, 60, 43, 0.15), inset 0 0 0 1px rgba(230, 60, 43, 0.3);
  filter: saturate(0.7);
}

/* Buttons - Ready */
.btn-ready {
  background: linear-gradient(135deg, #34C759 0%, #30B24A 50%, #2A9F3D 100%);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ready:hover {
  box-shadow: 0 12px 32px rgba(52, 199, 89, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.btn-ready:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(52, 199, 89, 0.3), inset 0 1px 0 rgba(0, 0, 0, 0.1);
}

.btn-ready:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(52, 199, 89, 0.15), inset 0 0 0 1px rgba(52, 199, 89, 0.3);
  filter: saturate(0.7);
}

/* Buttons - Warning */
.btn-warning {
  background: linear-gradient(135deg, #FFA500 0%, #FF9500 50%, #FF7A00 100%);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 149, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-warning:hover {
  box-shadow: 0 12px 32px rgba(255, 149, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.btn-warning:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 149, 0, 0.3), inset 0 1px 0 rgba(0, 0, 0, 0.1);
}

.btn-warning:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.15), inset 0 0 0 1px rgba(255, 149, 0, 0.3);
  filter: saturate(0.7);
}

/* Buttons - Text */
.btn-text {
  background: transparent;
  color: #0070E8;
  border: none;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.btn-text:hover {
  color: #004FBF;
  background: rgba(0, 112, 232, 0.06);
}

.btn-text:active {
  color: #004FBF;
  background: rgba(0, 112, 232, 0.12);
}

.btn-text:disabled {
  cursor: not-allowed;
  filter: saturate(0.7);
  opacity: 0.75;
}

/* Input Fields - Default Style */
input[type='text'],
input[type='password'],
input[type='email'],
input[type='number'],
input[type='search'],
select,
textarea {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--card-background);
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Input Fields - Pill Style */
input.input-pill,
select.input-pill,
textarea.input-pill {
  border-radius: 50px;
}

/* Input Fields - Rounded Style */
input.input-rounded,
select.input-rounded,
textarea.input-rounded {
  border-radius: var(--radius-lg);
}

/* Input Fields - Square Style */
input.input-square,
select.input-square,
textarea.input-square {
  border-radius: 4px;
}

/* Input Fields - Outline Style */
input.input-outline,
select.input-outline,
textarea.input-outline {
  border: 2px solid var(--border-medium);
  background: transparent;
}

/* Input Fields - Underline Style */
input.input-underline,
select.input-underline,
textarea.input-underline {
  border: none;
  border-bottom: 2px solid var(--border-medium);
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
  background: transparent;
}

/* Search Bar - Default */
input.search-bar {
  padding: 10px 16px;
  background: var(--background-color);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
}

/* Search Bar - Pill */
input.search-bar-pill {
  padding: 10px 20px;
  background: var(--background-color);
  border: 1px solid var(--border-medium);
  border-radius: 50px;
}

/* Search Bar - Minimal */
input.search-bar-minimal {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--primary-color);
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}

input[type='text']::placeholder,
input[type='password']::placeholder,
input[type='email']::placeholder,
input[type='number']::placeholder,
input[type='search']::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

input[type='text']:focus,
input[type='password']:focus,
input[type='email']:focus,
input[type='number']:focus,
input[type='search']:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

input[type='text']:disabled,
input[type='password']:disabled,
input[type='email']:disabled,
input[type='number']:disabled,
select:disabled,
textarea:disabled {
  background: #F5F5F5;
  color: var(--text-tertiary);
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Form Groups */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-label-secondary {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.form-error {
  color: var(--urgent-color);
  font-size: 12px;
  margin-top: var(--spacing-xs);
}

.form-help {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: var(--spacing-xs);
}

/* Typography */
.font-weight-700 {
  font-weight: 700;
}

.font-weight-600 {
  font-weight: 600;
}

.font-weight-500 {
  font-weight: 500;
}

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

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

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

h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

p {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: var(--spacing-md);
}

.text-sm {
  font-size: 12px;
}

.text-xs {
  font-size: 11px;
}

/* Modals & Overlays */
.modal-overlay {
  backdrop-filter: blur(4px);
  background-color: rgba(0, 0, 0, 0.4);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--card-background);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
  max-width: 600px;
  width: 90%;
  animation: modalSlideUp 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --spacing-lg: 12px;
    --spacing-xl: 16px;
  }

  .card {
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
  }

  .btn-sm,
  .btn-md,
  .btn-lg {
    width: 100%;
    min-height: 44px;
    padding: 12px 20px;
  }

  .modal {
    width: 95%;
    padding: 20px;
  }

  input[type='text'],
  input[type='password'],
  input[type='email'],
  input[type='number'],
  select,
  textarea {
    min-height: 44px;
    padding: 12px 16px;
  }
}

/* Accessibility */
.focus-ring:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading & Animations */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  border: 3px solid var(--border-subtle);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

/* Appointments Rail - Search Styling */
.appointments-rail .appointment-search-head {
  display: none;
}

.appointments-rail .appointment-intake-search {
  padding: 12px 0;
  margin: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.appointments-rail .search-bar-pill {
  font-size: 13px;
  padding: 8px 12px;
  min-height: 36px;
}

.manual-vehicle-inline-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Confirm & Search Buttons - Soft White Pill with Blur, Blue on Press */
.btn-soft-blur {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px) brightness(1.1);
  -webkit-backdrop-filter: blur(12px) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #666666;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  transition: all 0.25s ease-out;
}

.btn-soft-blur:hover {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(12px) brightness(1.15);
  -webkit-backdrop-filter: blur(12px) brightness(1.15);
}

.btn-soft-blur:active,
.btn-soft-blur.is-active {
  background: linear-gradient(135deg, #0090FF 0%, #0070E8 50%, #004FBF 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 112, 232, 0.3);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateY(-1px);
}

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

/* Voice Recording Buttons - Soft White Rounded, Dynamic States */
.btn-voice-record {
  background: rgba(255, 255, 255, 0.9);
  color: #666666;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
}

.btn-voice-record:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-voice-record:active {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

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

.btn-voice-record.is-recording {
  background: linear-gradient(135deg, #34C759 0%, #30B24A 50%, #2A9F3D 100%);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

.btn-voice-record.is-recording:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(52, 199, 89, 0.4);
}

.btn-voice-record.is-stopping {
  background: linear-gradient(135deg, #FF6B6B 0%, #E63C2B 50%, #CC0000 100%);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-voice-record.is-stopping:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

/* Spacing Utilities */
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

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

.m-xs { margin: var(--spacing-xs); }
.m-sm { margin: var(--spacing-sm); }
.m-md { margin: var(--spacing-md); }
.m-lg { margin: var(--spacing-lg); }
.m-xl { margin: var(--spacing-xl); }
