/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Handle Rails field_with_errors wrapper */
.field_with_errors {
  display: contents;
}

/* Hide scrollbar while maintaining scroll functionality */
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Chrome, Safari and Opera */
}

/* Display font for headings */
.font-display {
  font-family: var(--font-display, "Bricolage Grotesque", system-ui, -apple-system, sans-serif);
}

/* Card hover effect - subtle shadow only */
.card-hover {
  transition: box-shadow 150ms ease;
}
.card-hover:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* Button lift effect */
.button-lift {
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.button-lift:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: 8px 16px;
  background: #ea580c;
  color: white;
  text-decoration: none;
  font-weight: 600;
  z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* Enhanced focus states */
.focus-ring {
  outline: none;
}
.focus-ring:focus-visible {
  outline: 3px solid #ea580c;
  outline-offset: 2px;
}

/* Form input focus enhancement */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #ea580c, 0 0 0 4px rgba(234, 88, 12, 0.2);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .animate-pulse,
  .animate-spin,
  .animate-bounce {
    animation: none !important;
  }
  .transition-all,
  .transition-colors,
  .transition-transform {
    transition: none !important;
  }
  .card-hover:hover,
  .button-lift:hover {
    transform: none !important;
  }
}

/* ===== FORM VALIDATION STYLES ===== */

/* Required field indicator */
.field-required::after {
  content: " *";
  color: #dc2626;
}

/* Input states */
.input-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px #dc2626 !important;
}

.input-success {
  border-color: #16a34a !important;
}

/* Inline error message */
.field-error-message {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.875rem;
  color: #dc2626;
}

/* Loading button state */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== DEPLOYMENT PROGRESS STYLES ===== */

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.step-indicator::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 32px;
  right: 32px;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  background: #e5e7eb;
  color: #6b7280;
  transition: all 0.3s ease;
}

.step.completed .step-circle {
  background: #16a34a;
  color: white;
}

.step.active .step-circle {
  background: #ea580c;
  color: white;
  animation: pulse-ring 1.5s ease-out infinite;
}

.step.failed .step-circle {
  background: #dc2626;
  color: white;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(234, 88, 12, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}

.step-label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  text-align: center;
  max-width: 80px;
}

.step.completed .step-label,
.step.active .step-label {
  color: #111827;
}

/* Progress bar */
.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ea580c, #f97316);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-bar-fill.animated {
  background-size: 200% 100%;
  animation: progress-shimmer 2s linear infinite;
}

@keyframes progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== WARM BACKGROUND GRADIENT ===== */

.bg-warm-gradient {
  background: linear-gradient(135deg, #fafafa 0%, #fff 50%, #fff7ed 100%);
}

/* Brand accent border */
.border-brand-accent {
  border-left: 4px solid #ea580c;
}

/* ===== EMPTY STATE STYLES ===== */

.empty-state-illustration {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== MOBILE TOUCH TARGETS ===== */

@media (max-width: 640px) {
  /* Ensure minimum touch target size of 44px */
  button,
  [role="button"],
  a.inline-flex {
    min-height: 44px;
  }

  /* Larger form inputs on mobile */
  input,
  select,
  textarea {
    min-height: 48px;
    font-size: 16px; /* Prevents iOS zoom */
  }
}
