/* Custom styles for the Think & Feel Scriptwriter App */

/* Smooth transitions for interactive elements */
* {
  transition: all 0.2s ease;
}

/* Custom focus styles */
input:focus, textarea:focus, button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Enhanced tab styling */
.tab-button.active {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Script content styling for performance-optimized reading */
#script-content {
  line-height: 1.6;
  font-size: 1.125rem;
  font-family: 'Lora', serif;
  color: #333333;
  background-color: #fafafa;
  padding: 2rem;
  border-radius: 12px;
  max-width: none;
}

/* Pauses (...) - Subtle grey with wider spacing */
#script-content .pause {
  color: #9ca3af;
  font-weight: 300;
  letter-spacing: 0.2em;
  margin: 0 0.1em;
}

/* Performance Direction Pills - Color-coded by type */
#script-content .cue-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin: 0 0.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  vertical-align: baseline;
}

/* Timing & Pacing Cues - Calming Light Blue */
#script-content .cue-timing {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Energy & Volume Cues - Vibrant Orange */
#script-content .cue-energy {
  background-color: #fed7aa;
  color: #c2410c;
  border: 1px solid #fdba74;
}

/* Connection & Interaction Cues - Friendly Light Green */
#script-content .cue-connection {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Softer/Intimate Asides - Italicized darker grey */
#script-content .aside {
  color: #666666;
  font-style: italic;
  font-weight: 400;
  opacity: 0.85;
}

/* Vocal Emphasis - Bold deep purple */
#script-content .emphasis {
  font-weight: 700;
  color: #7c2d12;
  text-shadow: 0 1px 2px rgba(124, 45, 18, 0.1);
}

/* Script Container Enhancements */
#script-container {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Performance Cue Legend */
.cue-legend {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cue-legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.cue-legend-item:last-child {
  margin-bottom: 0;
}

/* Enhanced Toolbar */
.script-toolbar {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.script-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.script-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.action-btn.primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.action-btn.primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

/* Reading Progress Indicator */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #e5e7eb;
  z-index: 50;
}

.reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  width: 0%;
  transition: width 0.3s ease;
}

/* Print-specific optimizations for script performance */
@media print {
  #script-content {
    background: white !important;
    color: #000 !important;
    font-size: 14pt !important;
    line-height: 1.6 !important;
  }
  
  .cue-pill {
    border: 2px solid #666 !important;
    background: white !important;
    color: #000 !important;
    font-weight: bold !important;
  }
  
  .aside {
    color: #444 !important;
    font-style: italic !important;
  }
  
  .emphasis {
    color: #000 !important;
    font-weight: bold !important;
    text-decoration: underline !important;
  }
  
  .pause {
    color: #666 !important;
  }
}

/* Kenyan earth tone accents */
.kenyan-accent {
  background: linear-gradient(135deg, #f28c32, #ed6f0a);
  color: white;
}

.kenyan-accent:hover {
  background: linear-gradient(135deg, #de5505, #b84008);
}

/* Animation for form submission */
.loading-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

/* Talking points container styling */
.talking-point {
  position: relative;
  transition: all 0.3s ease;
}

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

/* Export menu styling */
#export-menu {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

/* Professional gradient backgrounds */
.gradient-bg {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Card hover effects */
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button loading state */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Custom scrollbar for script content */
#script-content {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

#script-content::-webkit-scrollbar {
  width: 6px;
}

#script-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#script-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#script-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  #script-content {
    font-size: 1rem;
    line-height: 1.7;
    padding: 1rem;
  }
  
  .talking-point {
    padding: 1rem;
  }
}

/* Print styles for script output */
@media print {
  body {
    background: white !important;
  }
  
  .no-print {
    display: none !important;
  }
  
  #script-content {
    font-size: 12pt;
    line-height: 1.6;
    color: black;
  }
  
  .performance-cue {
    background: #e5e7eb !important;
    color: #374151 !important;
    box-shadow: none !important;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  input, textarea, button {
    border-width: 2px;
    border-color: #000;
  }
  
  .performance-cue {
    background: #000 !important;
    color: #fff !important;
  }
}

/* Focus visible for keyboard navigation */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Loading animation for script generation */
.script-loading {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 2s infinite;
}

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