/* Demo Lesson Modal - Matches Mobile App Design */

.demo-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.demo-container {
  background: linear-gradient(180deg, #1A1A2E 0%, #16213E 100%);
  border-radius: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease;
}

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

.demo-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.demo-content {
  padding: 60px 40px 40px;
}

/* Intro Screen */
.demo-intro {
  text-align: center;
  padding: 40px 0;
}

.demo-intro h2 {
  font-size: 32px;
  font-weight: 900;
  color: white;
  margin-bottom: 12px;
}

.demo-intro p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 40px;
}

.demo-start-btn {
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  color: white;
  border: none;
  padding: 20px 60px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  transition: all 0.3s;
}

.demo-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

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

/* Quiz Screen */
.demo-quiz {
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

/* Progress Bar */
.demo-progress {
  margin-bottom: 32px;
}

.demo-progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.demo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00D4FF 0%, #00FF88 100%);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.demo-progress-text {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}

/* Question */
.demo-question {
  margin-bottom: 32px;
  text-align: center;
}

.demo-prompt {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 24px;
  font-weight: 600;
}

.demo-word {
  font-size: 56px;
  font-weight: 900;
  color: white;
  margin-bottom: 16px;
  text-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
}

.demo-audio-btn {
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  border: none;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  transition: all 0.3s;
}

.demo-audio-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 28px rgba(102, 126, 234, 0.7);
}

.demo-audio-btn.playing {
  animation: pulse 0.8s ease infinite;
}

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

/* Options */
.demo-options {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.demo-option {
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 20px 24px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.demo-option:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: #667EEA;
  transform: translateY(-2px);
}

.demo-option:disabled {
  cursor: not-allowed;
}

.demo-option.correct {
  background: rgba(0, 255, 136, 0.2);
  border-color: #00FF88;
  animation: correctBounce 0.5s ease;
}

.demo-option.incorrect {
  background: rgba(255, 71, 87, 0.2);
  border-color: #FF4757;
  animation: shake 0.5s ease;
}

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

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

/* Feedback */
.demo-feedback {
  padding: 24px;
  border-radius: 16px;
  margin-top: 24px;
}

.demo-feedback.correct {
  background: rgba(0, 255, 136, 0.15);
  border: 2px solid #00FF88;
}

.demo-feedback.incorrect {
  background: rgba(255, 71, 87, 0.15);
  border: 2px solid #FF4757;
}

#demoFeedbackText {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.feedback-icon {
  font-size: 32px;
  font-weight: 900;
}

.demo-feedback.correct .feedback-icon {
  color: #00FF88;
}

.demo-feedback.incorrect .feedback-icon {
  color: #FF4757;
}

.feedback-message {
  flex: 1;
  text-align: left;
}

.feedback-message strong {
  font-size: 18px;
  font-weight: 800;
  color: white;
  display: block;
  margin-bottom: 4px;
}

.romanized {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.demo-next-btn {
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s;
}

.demo-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(102, 126, 234, 0.6);
}

/* Complete Screen */
.demo-complete {
  text-align: center;
  padding: 40px 0;
}

.demo-complete-icon {
  font-size: 80px;
  margin-bottom: 24px;
  animation: bounce 1s ease;
}

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

.demo-complete h2 {
  font-size: 32px;
  font-weight: 900;
  color: white;
  margin-bottom: 16px;
}

.demo-score {
  font-size: 24px;
  font-weight: 700;
  color: #00D4FF;
  margin-bottom: 12px;
}

.demo-score span {
  color: #00FF88;
  font-size: 32px;
}

.demo-complete p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 32px;
}

.demo-complete-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.demo-download-btn {
  background: linear-gradient(135deg, #00D4FF 0%, #00FF88 100%);
  color: #1A1A2E;
  border: none;
  padding: 18px 40px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
  transition: all 0.3s;
}

.demo-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 212, 255, 0.6);
}

.demo-restart-btn {
  background: transparent;
  color: white;
  border: 3px solid rgba(255, 255, 255, 0.3);
  padding: 18px 40px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s;
}

.demo-restart-btn:hover {
  border-color: #667EEA;
  background: rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .demo-content {
    padding: 60px 24px 24px;
  }

  .demo-intro h2 {
    font-size: 28px;
  }

  .demo-word {
    font-size: 48px;
  }

  .demo-option {
    padding: 18px 20px;
    font-size: 16px;
  }

  .demo-complete-actions {
    flex-direction: column;
  }

  .demo-download-btn,
  .demo-restart-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .demo-modal {
    padding: 0;
  }

  .demo-container {
    max-height: 100vh;
    border-radius: 0;
  }

  .demo-word {
    font-size: 40px;
  }
}
