/* Component-specific styles */

/* Form groups */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

/* Timeline */
.timeline-item {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  transition: all 0.2s ease;
  touch-action: none;
  user-select: none;
}

.timeline-item.year-chip {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.timeline-item.year-chip.base-year {
  background: #e3f2fd;
  border-color: #90caf9;
}

.timeline-item.year-chip.correct {
  background: #e8f5e8;
  border-color: #4caf50;
  animation: correctPulse 0.6s ease-out;
}

.timeline-item.year-chip.wrong {
  background: #ffebee;
  border-color: #f44336;
}

.timeline-item.placeholder {
  background: #fff3cd;
  border-color: #ffc107;
  border-style: dashed;
  cursor: grab;
}

.timeline-item.placeholder.dragging {
  cursor: grabbing;
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.timeline-item.placeholder .year {
  font-weight: bold;
  color: #856404;
}

.timeline-item.placeholder.wrong .year {
  color: #d32f2f;
}

.timeline-item .year {
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
}

.timeline-item .position {
  font-size: 0.875rem;
  color: #666;
  margin-left: 0.5rem;
}

/* Playbar */
.playbar {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 16px;
  padding: 1rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.audio-progress {
  flex: 1;
  min-width: 0;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: #007aff;
  border-radius: 3px;
  transition: width 0.1s ease;
  width: 0%;
}

.time-display {
  font-size: 0.875rem;
  color: #666;
  text-align: center;
}

.song-info {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
} /* Game UI */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
}

.score {
  font-size: 1.25rem;
  font-weight: 600;
  color: #007aff;
}

.game-actions {
  margin: 1rem 0;
  margin-bottom: 0;
}

.pass-panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px solid #dee2e6;
  text-align: center;
}

/* Placement controls */
.placement-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.placement-controls button {
  background: #f0f0f0;
  border: 2px solid #ddd;
  border-radius: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: bold;
}

.placement-controls button:hover {
  background: #e0e0e0;
}

.placement-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.placement-info {
  font-size: 0.875rem;
  color: #666;
  /* text-align: center; */
  transition: color 0.2s ease;
  width: 33%;
}

.placement-info.success {
  color: #34c759;
  font-weight: 600;
}

.placement-info.error {
  color: #ff3b30;
  font-weight: 600;
}

/* Timeline container */
#timeline-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* padding: 0.5rem; */
  /* margin: 1rem 0; */
  border-radius: 12px;
  /* background: #fafafa; */
  min-height: 0; /* Important for flex child with overflow */
}

#timeline {
  flex: 1;
  min-height: 100px;
}

/* Error states */
.error-message {
  background: #ffebee;
  color: #d32f2f;
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid #ffcdd2;
  margin: 1rem 0;
  text-align: center;
  display: none;
}

/* Success states */
.success-message {
  background: #e8f5e8;
  color: #2e7d32;
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid #c8e6c9;
  margin: 1rem 0;
  text-align: center;
}

/* Touch feedback */
@media (hover: none) {
  .timeline-item:active {
    transform: scale(0.98);
  }

  .btn-primary:active,
  .btn-secondary:active {
    transform: scale(0.98);
  }
}

/* Winners Screen */
.winner-card {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  border: 3px solid #f39c12;
  border-radius: 16px;
  padding: 2rem;
  margin: 1.5rem 0;
  text-align: center;
  box-shadow: 0 8px 24px rgba(243, 156, 18, 0.3);
}

.winner-card h2 {
  margin: 0 0 1rem 0;
  color: #8b4513;
  font-size: 2rem;
}

.winner-score {
  font-size: 1.25rem;
  font-weight: bold;
  color: #8b4513;
  margin-bottom: 1rem;
}

.winner-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.timeline-year {
  background: white;
  border: 2px solid #f39c12;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-weight: bold;
  color: #8b4513;
}

.timeline-year.base-year {
  background: #e8f5e8;
  border-color: #4caf50;
  color: #2e7d32;
}

.celebration-text {
  font-size: 1.25rem;
  color: #8b4513;
  text-align: center;
  margin: 2rem 0;
}

.footer-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 1rem;
  border-top: 2px solid #ddd;
  display: flex;
  justify-content: center;
}
