/* SPRKLS Design System - "Intelligent Luxury" */

:root {
  /* Primary Intelligence Colors */
  --intelligence-blue: #2563eb;
  --intelligence-dark: #1e40af;
  --intelligence-light: #dbeafe;
  --intelligence-lighter: #eff6ff;
  
  /* Luxury Accents (Use Sparingly) */
  --luxury-gold: #d4af37;
  --luxury-rose: #e8b4b8;
  
  /* Functional Colors */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --error: #ef4444;
  --error-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;
  
  /* Neutrals */
  --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;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-luxury: 'Playfair Display', serif;
  
  /* Spacing */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Border Radius */
  --radius-sm: 0.25rem;  /* 4px */
  --radius: 0.5rem;      /* 8px */
  --radius-md: 0.75rem;  /* 12px */
  --radius-lg: 1rem;     /* 16px */
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  outline: none;
  text-decoration: none;
}

.btn:focus {
  outline: 2px solid var(--intelligence-blue);
  outline-offset: 2px;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--intelligence-blue), var(--intelligence-dark));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--intelligence-dark), #1e3a8a);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
}

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

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

.btn-success:hover:not(:disabled) {
  background: #059669;
}

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

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-luxury {
  background: linear-gradient(135deg, var(--luxury-gold), #b8860b);
  color: white;
}

.btn-luxury:hover:not(:disabled) {
  background: linear-gradient(135deg, #b8860b, #9a7209);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

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

.btn-icon {
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
}

/* ===== FORMS ===== */

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.form-required {
  color: var(--error);
  margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gray-900);
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  transition: all var(--transition-base);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--intelligence-blue);
  box-shadow: 0 0 0 3px var(--intelligence-lighter);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background-color: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 3px var(--error-light);
}

.form-hint {
  margin-top: var(--space-1);
  font-size: 0.75rem;
  color: var(--gray-500);
}

.form-error {
  margin-top: var(--space-1);
  font-size: 0.75rem;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-error::before {
  content: '⚠';
  font-size: 0.875rem;
}

.form-success {
  margin-top: var(--space-1);
  font-size: 0.75rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-success::before {
  content: '✓';
  font-size: 0.875rem;
}

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

.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--gray-300);
}

.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--gray-200);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.card-body {
  color: var(--gray-600);
}

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

.status-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: var(--space-4);
}

.status-card.status-success {
  background-color: var(--success-light);
  border-color: var(--success);
  color: #065f46;
}

.status-card.status-error {
  background-color: var(--error-light);
  border-color: var(--error);
  color: #991b1b;
}

.status-card.status-warning {
  background-color: var(--warning-light);
  border-color: var(--warning);
  color: #92400e;
}

.status-card.status-info {
  background-color: var(--info-light);
  border-color: var(--info);
  color: #1e40af;
}

.status-card.status-processing {
  background-color: var(--intelligence-lighter);
  border-color: var(--intelligence-blue);
  color: var(--intelligence-dark);
}

.status-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-content {
  flex: 1;
}

.status-title {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.status-message {
  font-size: 0.875rem;
  opacity: 0.9;
}

.status-progress {
  margin-top: var(--space-2);
  height: 0.25rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--intelligence-blue), var(--intelligence-dark));
  transition: width var(--transition-slow);
  border-radius: var(--radius-full);
}

/* ===== WORKFLOW STEPS ===== */

.workflow-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  position: relative;
}

.workflow-steps::before {
  content: '';
  position: absolute;
  top: 1rem;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--gray-200);
  z-index: 0;
}

.workflow-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.step-number {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  background-color: var(--gray-200);
  color: var(--gray-600);
  transition: all var(--transition-base);
}

.step-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-500);
  text-align: center;
}

.step-check {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background-color: var(--success);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.workflow-step.step-complete .step-number {
  display: none;
}

.workflow-step.step-complete .step-check {
  display: flex;
}

.workflow-step.step-complete .step-label {
  color: var(--success);
  font-weight: 600;
}

.workflow-step.step-active .step-number {
  background: linear-gradient(135deg, var(--intelligence-blue), var(--intelligence-dark));
  color: white;
  box-shadow: 0 0 0 4px var(--intelligence-lighter);
}

.workflow-step.step-active .step-label {
  color: var(--intelligence-blue);
  font-weight: 600;
}

.workflow-step.step-pending .step-number {
  background-color: var(--gray-200);
  color: var(--gray-400);
}

.workflow-step.step-pending .step-label {
  color: var(--gray-400);
}

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

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius-md);
}

/* ===== NOTIFICATIONS ===== */

.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  max-width: 24rem;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-success {
  background-color: white;
  border-left: 4px solid var(--success);
}

.notification-error {
  background-color: white;
  border-left: 4px solid var(--error);
}

.notification-warning {
  background-color: white;
  border-left: 4px solid var(--warning);
}

.notification-info {
  background-color: white;
  border-left: 4px solid var(--info);
}

.notification-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.notification-message {
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.notification-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close:hover {
  color: var(--gray-600);
}

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

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

.text-intelligence {
  color: var(--intelligence-blue);
}

.bg-intelligence {
  background-color: var(--intelligence-blue);
}

.border-intelligence {
  border-color: var(--intelligence-blue);
}

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

@media (max-width: 640px) {
  .workflow-steps {
    flex-wrap: wrap;
    gap: var(--space-4);
  }
  
  .workflow-step {
    flex: 0 0 calc(50% - var(--space-2));
  }
  
  .notification {
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }
}

