/**
 * GCS Carbon Calculator - Minimal CSS
 * Most styling is now done with Tailwind CSS v4
 * This file contains only essential styles that can't be easily done with utility classes
 */

/* Step fade-in animation for multi-step forms */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-fade-in {
  animation: fadeIn 0.3s ease-in;
}

/* Alpine.js cloak - hide elements until Alpine is initialized */
[x-cloak] {
  display: none !important;
}

/* Sortable.js drag states */
.sortable-ghost {
  opacity: 0.4;
}

.sortable-drag {
  opacity: 0.8;
}

/* Loading overlay for AJAX emission items fetch (Phase 3) */
.calculator-loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  min-height: 200px;
}

.calculator-loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid #e5e7eb;
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.calculator-loading-text {
  margin-top: 1rem;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Dark mode loading styles */
@media (prefers-color-scheme: dark) {
  .calculator-loading-spinner {
    border-color: #374151;
    border-top-color: #818cf8;
  }

  .calculator-loading-text {
    color: #9ca3af;
  }
}

/* Error state for loading failures */
.calculator-load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: #dc2626;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

@media (prefers-color-scheme: dark) {
  .calculator-load-error {
    color: #f87171;
    background-color: rgba(127, 29, 29, 0.2);
    border-color: rgba(248, 113, 113, 0.3);
  }
}

/* Incomplete field indicator — red outline */
.field-incomplete {
  outline-style: solid !important;
  outline-color: #ef4444 !important;  /* red-500 */
  outline-width: 2px !important;
  outline-offset: -1px;
  border-color: #ef4444 !important;
}

.dark .field-incomplete {
  outline-color: #f87171 !important;  /* red-400 */
  border-color: #f87171 !important;
}

/* Incomplete badge on item header */
.item-incomplete-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #b45309;  /* amber-700 */
  background: #fffbeb;  /* amber-50 */
  white-space: nowrap;
}

.dark .item-incomplete-badge {
  color: #fbbf24;  /* amber-400 */
  background: rgba(120, 53, 15, 0.25);  /* amber-900/25 */
}
