/* Single-Page Application Styles */

/* Task 9 - Enhanced Results Display Styles */

/* Real-time generation progress */
.generation-progress-container {
  background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
  border-left: 4px solid #3182ce;
}

.generation-status-badge {
  animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  from {
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
  }
  to {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
  }
}

/* Enhanced result cards */
.result-card {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.result-card.completed {
  background: linear-gradient(135deg, #f0fff4 0%, #ecfdf5 100%);
  border-color: #10b981;
}

.result-card.generating {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
  border-color: #f59e0b;
}

/* Button action overlays */
.action-overlay {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.action-button {
  transition: all 0.2s ease;
  font-weight: 500;
}

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

.action-button.copy-button:hover {
  background-color: #2563eb;
}

.action-button.edit-button:hover {
  background-color: #374151;
}

.action-button.regenerate-button:hover {
  background-color: #7c3aed;
}

/* Tabs styling */
.style-tabs {
  border-bottom: 2px solid #e5e7eb;
  background: #fafafa;
}

.style-tab {
  transition: all 0.2s ease;
  position: relative;
}

.style-tab:hover {
  background-color: #f3f4f6;
}

.style-tab.active {
  background-color: #ffffff;
  border-bottom-color: #4f46e5;
}

.style-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

/* Content editing styles */
.edit-textarea {
  transition: all 0.2s ease;
  resize: vertical;
}

.edit-textarea:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background-color: #ffffff;
}

.edit-actions {
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Success/completion animations */
.completion-badge {
  animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Copy feedback animation */
.copy-success {
  animation: copyFeedback 1.5s ease-out;
}

@keyframes copyFeedback {
  0% {
    background-color: #3b82f6;
    transform: scale(1);
  }
  25% {
    background-color: #10b981;
    transform: scale(1.05);
  }
  100% {
    background-color: #3b82f6;
    transform: scale(1);
  }
}

/* Regeneration loading overlay */
.regeneration-overlay {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
}

.regeneration-spinner {
  animation: spin 1s linear infinite;
}

/* Analytics and interaction feedback */
.interaction-ripple {
  position: relative;
  overflow: hidden;
}

.interaction-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.interaction-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Comparison view styles (for future implementation) */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.comparison-card {
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.comparison-card:hover {
  border-color: #4f46e5;
  transform: scale(1.02);
}

/* Word count and metadata styling */
.metadata-text {
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  letter-spacing: 0.025em;
}

/* Progress indicators */
.progress-ring {
  animation: rotate 2s linear infinite;
}

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

/* Smooth transitions for step changes */
.step-content {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.step-content.hidden {
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
}

/* Enhanced drag and drop styling */
.drag-drop-zone {
  transition: all 0.2s ease-in-out;
}

.drag-drop-zone.drag-over {
  border-color: #4f46e5;
  background-color: #eef2ff;
  transform: scale(1.02);
}

/* Progress step animations */
.progress-step {
  transition: all 0.3s ease-in-out;
}

.progress-step.completed {
  transform: scale(1.1);
}

/* Image preview enhancements */
.image-preview {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.image-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Loading animations */
@keyframes pulse-subtle {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.loading-pulse {
  animation: pulse-subtle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Form field focus styles */
.form-field {
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-field:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Notification animations */
.spa-notification {
  animation: slideInRight 0.3s ease-out;
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
  .spa-container {
    padding: 1rem;
  }
  
  .spa-header {
    padding: 0.75rem 1rem;
  }
  
  .spa-content {
    padding: 1rem;
  }
  
  .spa-sidebar {
    order: -1;
    margin-bottom: 1.5rem;
  }
  
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

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

/* Focus indicators */
.focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .border-gray-300 {
    border-color: #000;
  }
  
  .text-gray-600 {
    color: #000;
  }
  
  .bg-gray-50 {
    background-color: #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .step-content,
  .progress-step,
  .image-preview,
  .spa-notification {
    transition: none;
    animation: none;
  }
}

/* Print styles */
@media print {
  .spa-header,
  .spa-sidebar,
  .navigation-footer {
    display: none;
  }
  
  .step-content {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  .spa-content {
    max-width: none;
    margin: 0;
    padding: 0;
  }
}