/**
 * AI Forecasting Simulator - Custom Styles
 */

/* Enhanced form controls */
.form-control {
  @apply px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent;
}

/* Custom buttons */
.btn-primary {
  @apply px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200;
}

.btn-secondary {
  @apply px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition-colors duration-200;
}

.btn-success {
  @apply px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 transition-colors duration-200;
}

.btn-warning {
  @apply px-4 py-2 bg-yellow-600 text-white rounded hover:bg-yellow-700 focus:outline-none focus:ring-2 focus:ring-yellow-500 focus:ring-offset-2 transition-colors duration-200;
}

.btn-danger {
  @apply px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition-colors duration-200;
}

/* Model selection cards */
.model-card {
  @apply transition-all duration-200 ease-in-out;
}

.model-card:hover {
  @apply shadow-md transform translate-y-[-1px];
}

.model-card.selected {
  @apply bg-blue-50 border-blue-300 shadow-md;
}

/* Chart container */
.chart-container {
  position: relative;
  height: 400px;
  width: 100%;
}

/* Results panels */
.results-panel {
  @apply bg-white rounded-lg shadow-lg p-6;
}

.metric-card {
  @apply text-center p-4 bg-gray-50 rounded-lg;
}

.metric-value {
  @apply text-2xl font-bold text-gray-800;
}

.metric-label {
  @apply text-sm text-gray-600 uppercase tracking-wide;
}

/* Status indicators */
.status-excellent {
  @apply bg-green-100 text-green-800;
}

.status-good {
  @apply bg-blue-100 text-blue-800;
}

.status-fair {
  @apply bg-yellow-100 text-yellow-800;
}

.status-poor {
  @apply bg-red-100 text-red-800;
}

/* Trend indicators */
.trend-up {
  @apply text-green-600;
}

.trend-down {
  @apply text-red-600;
}

.trend-stable {
  @apply text-gray-600;
}

/* Loading animations */
.loading-spinner {
  @apply inline-block animate-spin rounded-full h-4 w-4 border-b-2 border-current;
}

.pulse-animation {
  @apply animate-pulse;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    @apply px-2;
  }
  
  .grid-responsive {
    @apply grid-cols-1;
  }
  
  .text-responsive {
    @apply text-sm;
  }
  
  .chart-container {
    height: 300px;
  }
}

/* Custom scrollbar for better UX */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #CBD5E0 #F7FAFC;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #F7FAFC;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #CBD5E0;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #A0AEC0;
}

/* Accessibility improvements */
.sr-only {
  @apply absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0;
}

/* Focus states for better keyboard navigation */
.focusable:focus {
  @apply outline-none ring-2 ring-blue-500 ring-offset-2;
}

/* Animation keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Gradient backgrounds */
.gradient-blue {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-green {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-purple {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* Data table styles */
.data-table {
  @apply min-w-full divide-y divide-gray-200;
}

.data-table th {
  @apply px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
}

.data-table td {
  @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900;
}

/* Notification styles */
.notification {
  @apply fixed top-4 right-4 z-50 p-4 rounded-lg shadow-lg max-w-sm;
}

.notification-success {
  @apply bg-green-500 text-white;
}

.notification-error {
  @apply bg-red-500 text-white;
}

.notification-warning {
  @apply bg-yellow-500 text-white;
}

.notification-info {
  @apply bg-blue-500 text-white;
}

/* Intro.js Tour Customization */
.ai-forecasting-tooltip {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: none;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.ai-forecasting-tooltip-wide {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: none;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-width: 400px;
  max-width: 500px;
}

.ai-forecasting-highlight {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5), 0 0 0 8px rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.introjs-tooltip {
  font-size: 14px;
  line-height: 1.5;
}

.introjs-tooltip .introjs-tooltiptext {
  padding: 20px;
}

.introjs-tooltip .introjs-arrow {
  border-color: transparent;
}

.introjs-tooltip.introjs-top .introjs-arrow {
  border-top-color: #667eea;
}

.introjs-tooltip.introjs-bottom .introjs-arrow {
  border-bottom-color: #667eea;
}

.introjs-tooltip.introjs-left .introjs-arrow {
  border-left-color: #667eea;
}

.introjs-tooltip.introjs-right .introjs-arrow {
  border-right-color: #667eea;
}

.introjs-button {
  background: rgba(255, 255, 255, 0.9);
  color: #4c1d95;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  margin: 5px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
}

.introjs-button:hover {
  background: white;
  transform: translateY(-1px);
}

.introjs-skipbutton {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.introjs-skipbutton:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.introjs-progressbar {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  height: 6px;
}

.introjs-progress {
  background: white;
  border-radius: 4px;
  height: 6px;
}

.introjs-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

/* Help menu styles */
#help-menu {
  z-index: 1000;
}

#help-dropdown {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Interactive Parameter Slider Styles */
.slider {
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #E5E7EB 0%, #3B82F6 50%, #10B981 100%);
  outline: none;
  transition: all 0.3s ease;
}

.slider:hover {
  background: linear-gradient(90deg, #D1D5DB 0%, #2563EB 50%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.slider::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Real-time Chart Styles */
.forecast-tooltip {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
}

#d3-chart-container {
  transition: opacity 0.3s ease-in-out;
}

/* Real-time indicator animations */
@keyframes pulse-green {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

.animate-pulse-green {
  animation: pulse-green 2s infinite;
}

/* Parameter section enhancements */
.parameter-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.parameter-section:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Chart overlay styles */
.d3-chart-overlay {
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
}

.d3-chart-overlay.active {
  pointer-events: all;
}

/* Interactive elements */
.tooltip-circle {
  transition: all 0.2s ease;
}

.confidence-band {
  transition: d 0.5s ease-in-out;
}

.forecast-line {
  transition: d 0.5s ease-in-out;
}