/* Progressive Enhancement Styles */
/* These styles enhance UX but are not essential for functionality */

/* Fade-in animation for new elements */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-in-out;
}

/* Smooth transitions for interactive elements */
.enhanced-transition {
  transition: all 0.2s ease-in-out;
}

/* Loading state enhancements */
.loading-overlay {
  position: relative;
}

.loading-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Form field enhancements */
.form-field-enhanced {
  position: relative;
}

.form-field-enhanced .field-status {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.form-field-enhanced.valid .field-status {
  opacity: 1;
  color: #10b981;
}

.form-field-enhanced.invalid .field-status {
  opacity: 1;
  color: #ef4444;
}

/* Auto-save indicator */
.auto-save-indicator {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: #10b981;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  z-index: 50;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease-in-out;
}

.auto-save-indicator.show {
  opacity: 1;
  transform: translateY(0);
}

/* Hover enhancements for interactive elements */
.enhanced-hover {
  transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
}

.enhanced-hover:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Focus enhancements */
.enhanced-focus:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Chart loading states */
.chart-container {
  position: relative;
  min-height: 300px;
}

.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 10;
}

/* Smooth modal transitions */
.modal-enhanced {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.modal-enhanced.entering {
  opacity: 0;
  transform: scale(0.95);
}

.modal-enhanced.active {
  opacity: 1;
  transform: scale(1);
}

.modal-enhanced.leaving {
  opacity: 0;
  transform: scale(1.05);
}

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

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.3s ease-in-out;
}

/* Notification enhancements */
.notification {
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

.notification.show {
  transform: translateX(0);
}

/* Accessibility enhancements */
@media (prefers-reduced-motion: reduce) {
  .animate-fadeIn,
  .enhanced-transition,
  .enhanced-hover,
  .modal-enhanced,
  .progress-bar-fill,
  .notification {
    animation: none !important;
    transition: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .auto-save-indicator {
    border: 2px solid currentColor;
  }
  
  .enhanced-focus:focus {
    outline-width: 3px;
  }
}