/* Book 3: Digraphs - Additional Styles */

/* Banner Section */
.banner-section {
  background: linear-gradient(135deg, rgba(107, 92, 255, 0.08), rgba(0, 180, 199, 0.08));
  border-radius: var(--radius);
  padding: 32px 24px;
  margin: 20px 0 30px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.banner-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 214, 107, 0.3), transparent);
  border-radius: 50%;
  pointer-events: none;
}

.banner-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(0, 180, 199, 0.2), transparent);
  border-radius: 50%;
  pointer-events: none;
}

.banner-content {
  position: relative;
  z-index: 1;
}

.banner-title {
  color: var(--navy);
  font-size: 32px;
  margin: 0 0 12px;
  font-weight: 800;
}

.banner-text {
  color: var(--navy);
  font-size: 18px;
  margin: 0 0 20px;
  line-height: 1.6;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.banner-text strong {
  color: var(--violet);
  font-weight: 700;
}

.banner-image-placeholder {
  margin-top: 20px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  border: 2px dashed rgba(107, 92, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.placeholder-icon {
  font-size: 48px;
  opacity: 0.6;
}

.placeholder-text {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* Intro Section */
.intro-section {
  text-align: center;
  margin: 20px 0 30px;
}

.intro-section h2 {
  color: var(--navy);
  font-size: 28px;
  margin: 0 0 10px;
  font-weight: 800;
}

.intro-text {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
  line-height: 1.6;
}

/* Digraphs Grid */
.digraphs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
  padding-bottom: 30px;
}

.digraph-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.digraph-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--coral), var(--violet));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.digraph-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(10, 20, 30, 0.12);
}

.digraph-card:hover::before {
  transform: scaleX(1);
}

.digraph-card.highlighted {
  background: linear-gradient(135deg, rgba(255, 111, 97, 0.08), rgba(107, 92, 255, 0.08));
  transform: scale(1.05);
  box-shadow: 0 16px 36px rgba(255, 111, 97, 0.2);
}

.digraph-card.highlighted::before {
  transform: scaleX(1);
}

.digraph-name {
  font-size: 42px;
  font-weight: 800;
  color: var(--coral);
  margin: 0 0 4px;
  line-height: 1;
}

.digraph-sound {
  font-size: 16px;
  color: var(--violet);
  font-weight: 600;
  margin: 0 0 12px;
}

.digraph-examples {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 8px;
}

/* Play button (matching Book 1 style) */
.digraph-card .play-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.digraph-card .play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, var(--coral), #ff4d47);
  color: #fff;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 111, 97, 0.3);
  transition: transform 0.14s ease;
  padding-left: 2px;
}

.digraph-card .play-btn:hover {
  transform: scale(1.05);
}

.digraph-card .play-btn.playing {
  animation: play-pulse 1200ms infinite;
}

.digraph-card .btn-label {
  font-size: 11px;
  color: var(--muted);
  min-height: 14px;
  text-align: center;
}

.digraph-card .play-btn:focus {
  outline: 4px solid rgba(0, 180, 199, 0.12);
}

.digraph-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--sun);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

/* Game Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 42, 74, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalFadeIn 0.3s ease;
}

.game-modal-content {
  max-width: 800px;
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 32px;
  color: var(--muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 111, 97, 0.1);
  color: var(--coral);
}

.modal-title {
  color: var(--navy);
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 20px;
}

/* Game Content */
.game-content {
  min-height: 300px;
}

.game-instruction {
  color: var(--navy);
  font-size: 18px;
  text-align: center;
  margin: 0 0 24px;
  line-height: 1.5;
}

.game-images-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.game-image-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 2px solid transparent;
}

.game-image-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.game-image-card.selected {
  border-color: var(--violet);
  background: rgba(107, 92, 255, 0.08);
}

.game-image-placeholder {
  width: 100%;
  height: 120px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border: 2px dashed rgba(107, 92, 255, 0.2);
}

.game-word-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}

.game-select-btn {
  background: none;
  border: 2px solid var(--violet);
  color: var(--violet);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s ease;
}

.game-select-btn:hover {
  background: var(--violet);
  color: white;
}

.game-image-card.selected .game-select-btn {
  background: var(--violet);
  color: white;
}

.game-score {
  text-align: center;
  margin: 20px 0;
  font-size: 16px;
  color: var(--navy);
  display: flex;
  justify-content: center;
  gap: 24px;
}

.game-score strong {
  color: var(--coral);
}

.game-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.game-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  background: var(--violet);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  font-family: inherit;
}

.game-btn:hover {
  background: #5a4ce6;
  transform: translateY(-2px);
}

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

.game-btn-secondary {
  background: var(--teal);
}

.game-btn-secondary:hover {
  background: #00a3ad;
}

.game-feedback {
  margin-top: 20px;
  padding: 16px;
  background: rgba(107, 92, 255, 0.08);
  border-radius: 10px;
  text-align: center;
}

.feedback-message {
  color: var(--navy);
  font-size: 16px;
  margin: 0;
}

/* Quiz Section */
.quiz-section {
  margin-top: 40px;
  padding: 30px 0;
  border-top: 2px solid rgba(107, 92, 255, 0.1);
}

.quiz-header {
  text-align: center;
  margin-bottom: 30px;
}

.section-title {
  color: var(--navy);
  font-size: 32px;
  margin: 0 0 10px;
  font-weight: 800;
}

.section-subtitle {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

/* Progress Bar */
.progress-container {
  max-width: 600px;
  margin: 0 auto 30px;
}

.progress-bar {
  height: 12px;
  background: rgba(107, 92, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--violet));
  border-radius: 10px;
  transition: width 0.5s ease;
}

.progress-text {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* Quiz Questions */
.quiz-questions-container {
  max-width: 700px;
  margin: 0 auto;
}

.quiz-question {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.question-text {
  color: var(--navy);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px;
  text-align: center;
}

.quiz-options {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.quiz-option {
  background: var(--bg);
  border: 3px solid transparent;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: inherit;
  font-size: 16px;
}

.quiz-option:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.quiz-option.selected {
  border-color: var(--violet);
  background: rgba(107, 92, 255, 0.08);
}

.quiz-option.correct {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
}

.quiz-option.incorrect {
  border-color: var(--coral);
  background: rgba(255, 111, 97, 0.08);
}

.option-letter {
  width: 40px;
  height: 40px;
  background: var(--violet);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.quiz-option.correct .option-letter {
  background: #4caf50;
}

.quiz-option.incorrect .option-letter {
  background: var(--coral);
}

.option-text {
  flex: 1;
  color: var(--navy);
  font-weight: 600;
}

.option-image-placeholder {
  font-size: 32px;
  flex-shrink: 0;
}

.quiz-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.quiz-btn {
  padding: 14px 32px;
  border: none;
  border-radius: 10px;
  background: var(--coral);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  font-family: inherit;
}

.quiz-btn:hover {
  background: #ff4d47;
  transform: translateY(-2px);
}

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

.quiz-btn-next {
  background: var(--violet);
}

.quiz-btn-next:hover {
  background: #5a4ce6;
}

.quiz-btn-secondary {
  background: var(--teal);
}

.quiz-btn-secondary:hover {
  background: #00a3ad;
}

.quiz-feedback {
  margin-top: 20px;
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

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

.quiz-feedback.correct-feedback {
  background: rgba(76, 175, 80, 0.1);
  border: 2px solid #4caf50;
}

.quiz-feedback.incorrect-feedback {
  background: rgba(255, 111, 97, 0.1);
  border: 2px solid var(--coral);
}

.feedback-text {
  color: var(--navy);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

/* Quiz Results */
.quiz-results {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

.results-title {
  color: var(--navy);
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 30px;
}

.results-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stat-number {
  font-size: 48px;
  font-weight: 800;
  color: var(--violet);
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Accessibility */
.digraph-card:focus {
  outline: 4px solid rgba(255, 111, 97, 0.3);
  outline-offset: 2px;
}

.game-btn:focus,
.quiz-btn:focus {
  outline: 4px solid rgba(107, 92, 255, 0.3);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 640px) {
  .banner-section {
    padding: 24px 16px;
  }

  .banner-title {
    font-size: 24px;
  }

  .banner-text {
    font-size: 16px;
  }

  .digraphs-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
  }

  .digraph-card {
    padding: 20px 12px;
    min-height: 140px;
  }

  .digraph-name {
    font-size: 36px;
  }

  .digraph-examples {
    font-size: 12px;
  }

  .digraph-card .play-btn {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .game-images-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 24px 20px;
  }

  .modal-title {
    font-size: 24px;
  }

  .quiz-question {
    padding: 20px;
  }

  .question-text {
    font-size: 20px;
  }

  .quiz-option {
    padding: 12px 16px;
    gap: 12px;
  }

  .option-letter {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .option-image-placeholder {
    font-size: 24px;
  }

  .results-stats {
    gap: 24px;
  }

  .stat-number {
    font-size: 40px;
  }

  .game-controls,
  .quiz-controls,
  .results-actions {
    flex-direction: column;
    width: 100%;
  }

  .game-btn,
  .quiz-btn {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .digraphs-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .game-images-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .digraphs-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Comments for future asset integration */
/*
Future Integration Notes:
- Replace .banner-image-placeholder with actual hero image (assets/images/book3/hero.jpg)
- Replace .game-image-placeholder with actual word images (assets/images/book3/words/)
- Add audio files for digraph sounds (assets/audio/digraphs/ch.mp3, sh.mp3, etc.)
- Replace emoji placeholders in quiz with actual images (assets/images/book3/quiz/)
- Add sound effects for correct/incorrect answers (assets/audio/effects/)
- Consider adding background music option (assets/audio/music/book3-bg.mp3)
*/
