/* ===================================
   DRIVING COACH STYLES
   =================================== */

.coach-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: calc(100vh - 200px);
}

.hero-section {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.hero-section h1 {
  font-size: 2.5rem;
  color: #1e293b;
  margin-bottom: 1rem;
}

.hero-section p {
  font-size: 1.2rem;
  color: #64748b;
}

/* State Selector */
.state-selector {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.selector-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 500px;
}

.selector-card h2 {
  margin-bottom: 1.5rem;
  color: #1e293b;
  font-size: 1.5rem;
}

.selector-card label {
  display: block;
  margin-bottom: 0.5rem;
  color: #475569;
  font-weight: 500;
}

.selector-card select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  background: white;
  cursor: pointer;
}

.selector-card select:focus {
  outline: none;
  border-color: #1e40af;
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  background-color: #1e40af;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #1e3a8a;
}

/* Quiz Area */
.quiz-area {
  animation: fadeIn 0.3s ease-in;
}

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

.quiz-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

#questionNumber {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.question-card {
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  border: 2px solid #f1f5f9;
}

#questionText {
  color: #1e293b;
  margin-bottom: 2rem;
  font-size: 1.4rem;
  line-height: 1.8;
  font-weight: 600;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quiz-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.quiz-card h2 {
  color: #1e293b;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  line-height: 1.6;
}

.quiz-progress {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Option Buttons */
.option-btn,
.opt-btn {
  display: block;
  width: 100%;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  text-align: left;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #334155;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.option-btn:before,
.opt-btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  transition: width 0.3s ease;
  z-index: 0;
}

.option-btn:hover:before,
.opt-btn:hover:before {
  width: 100%;
}

.option-btn:hover,
.opt-btn:hover {
  border-color: #667eea;
  transform: translateX(8px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.option-btn:active,
.opt-btn:active {
  transform: translateX(8px) scale(0.98);
}

.option-btn.correct {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  color: white;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.option-btn.incorrect {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #ef4444;
  color: white;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Explanation Styles */
.explanation {
  margin-top: 2rem;
  animation: slideDown 0.4s ease-out;
}

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

.correct-answer,
.incorrect-answer {
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.correct-answer {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
  border-left: 4px solid #10b981;
}

.incorrect-answer {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
  border-left: 4px solid #ef4444;
}

.correct-answer strong {
  color: #059669;
  font-size: 1.1rem;
}

.incorrect-answer strong {
  color: #dc2626;
  font-size: 1.1rem;
}

.explanation p {
  margin: 0.75rem 0;
  color: #475569;
  line-height: 1.8;
  font-size: 1rem;
}

/* Next Button */
.next-btn {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  margin-top: 1.5rem;
}

.next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.next-btn:active {
  transform: translateY(0);
}

.explanation-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.explanation-card.correct {
  border-left: 5px solid #10b981;
}

.explanation-card.incorrect {
  border-left: 5px solid #ef4444;
}

.explanation-card h2 {
  margin-bottom: 1rem;
}

.explanation-card h2.correct {
  color: #10b981;
}

.explanation-card h2.incorrect {
  color: #ef4444;
}

.explanation-text {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  color: #475569;
  line-height: 1.6;
}

.btn-next {
  padding: 0.75rem 2rem;
  background-color: #1e40af;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-next:hover {
  background-color: #1e3a8a;
}

/* Results Card */
.results {
  text-align: center;
  background: white;
  padding: 3rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.results.passed {
  border-top: 5px solid #10b981;
}

.results.failed {
  border-top: 5px solid #f59e0b;
}

.results h2 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  color: #1e293b;
}

.score-display {
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 16px;
}

.score-circle {
  display: inline-block;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.score-number {
  font-size: 3.5rem;
  font-weight: 800;
  color: white;
}

.score-details {
  font-size: 1.3rem;
  color: #475569;
  margin: 1.5rem 0;
  font-weight: 500;
}

.results p {
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 1rem 0;
}

.results-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.primary-btn,
.secondary-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.primary-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.secondary-btn {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.secondary-btn:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

.results-card {
  text-align: center;
  background: white;
  padding: 3rem 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.results-card h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #1e293b;
}

.score-display {
  font-size: 3rem;
  font-weight: bold;
  color: #1e40af;
  margin: 1.5rem 0;
}

.score-message {
  font-size: 1.2rem;
  color: #64748b;
  margin-bottom: 2rem;
}

.btn-retry {
  padding: 1rem 2rem;
  background-color: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  margin: 0.5rem;
}

.btn-retry:hover {
  background-color: #059669;
}

/* Utility */
.hidden {
  display: none;
}

/* ===================================
   ANIMATED COACH CHARACTER
   =================================== */

.coach-character {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  animation: slideInUp 0.5s ease-out;
}

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

.coach-avatar {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
  animation: float 3s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.coach-avatar:hover {
  transform: scale(1.1);
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.avatar-face {
  position: relative;
  width: 70px;
  height: 70px;
}

.avatar-eyes {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  animation: blink 4s infinite;
}

@keyframes blink {
  0%, 98%, 100% {
    transform: scaleY(1);
  }
  99% {
    transform: scaleY(0.1);
  }
}

.eye {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  position: relative;
}

.eye::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: #1e293b;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  animation: look 5s infinite;
}

@keyframes look {
  0%, 20%, 100% {
    transform: translateX(0);
  }
  10% {
    transform: translateX(-2px);
  }
  30%, 50% {
    transform: translateX(2px);
  }
}

.avatar-mouth {
  width: 30px;
  height: 15px;
  border: 3px solid white;
  border-top: none;
  border-radius: 0 0 30px 30px;
  margin: 10px auto 0;
  animation: talk 2s ease-in-out infinite;
}

@keyframes talk {
  0%, 100% {
    height: 15px;
  }
  50% {
    height: 8px;
  }
}

.coach-speech-bubble {
  position: absolute;
  bottom: 120px;
  right: 0;
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 280px;
  animation: fadeIn 0.5s ease-out 0.3s both;
}

.coach-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 30px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid white;
}

.coach-speech-bubble p {
  margin: 0;
  font-size: 0.95rem;
  color: #1e293b;
  line-height: 1.5;
}

/* Different expressions for coach based on answer correctness */
.coach-character.correct .avatar-mouth {
  border-radius: 0 0 40px 40px;
  height: 20px;
  animation: smile 0.5s ease-out;
}

@keyframes smile {
  0% { height: 15px; }
  50% { height: 25px; }
  100% { height: 20px; }
}

.coach-character.incorrect .avatar-mouth {
  border-radius: 40px 40px 0 0;
  border-top: 3px solid white;
  border-bottom: none;
  height: 12px;
  margin-top: 15px;
  animation: frown 0.5s ease-out;
}

@keyframes frown {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.2); }
}

.coach-character.thinking .avatar-eyes {
  animation: thinkBlink 0.5s ease-in-out infinite;
}

@keyframes thinkBlink {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-3px); }
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .selector-card,
  .quiz-card {
    padding: 1.5rem;
  }
  
  .score-display {
    font-size: 2.5rem;
  }
  
  .coach-character {
    bottom: 20px;
    right: 20px;
  }
  
  .coach-avatar {
    width: 80px;
    height: 80px;
  }
  
  .coach-speech-bubble {
    max-width: 220px;
    font-size: 0.85rem;
    bottom: 100px;
  }
}
