/* color-quiz.css */

/* --- Quiz Menu --- */
.quiz-menu {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fdfbf7;
  min-height: 100vh;
}

.quiz-menu-hero {
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
  color: white;
  width: 100%;
  padding: 3rem 1rem 4rem;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  text-align: center;
  margin-bottom: -2rem;
  box-shadow: 0 10px 20px rgba(58, 123, 213, 0.2);
  position: relative;
  overflow: hidden;
}

.quiz-menu-hero::before {
  content: '✨';
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 2rem;
  opacity: 0.8;
  animation: pulse 2s infinite alternate;
}

.quiz-menu-hero::after {
  content: '🚀';
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 2.5rem;
  opacity: 0.8;
  animation: bounceIn 3s infinite;
}

.quiz-menu-title {
  font-size: 2rem;
  font-weight: 900;
  margin: 0 0 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.quiz-menu-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  opacity: 0.9;
}

.quiz-categories {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
  max-width: 700px;
  padding: 0 20px 40px;
  position: relative;
  z-index: 10;
}

.category-card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  border-top: 6px solid #ccc;
  animation: fadeInUp 0.5s ease backwards;
}

.category-card:nth-child(1) { animation-delay: 0.1s; border-top-color: #ff6b6b; }
.category-card:nth-child(2) { animation-delay: 0.2s; border-top-color: #48dbfb; }
.category-card:nth-child(3) { animation-delay: 0.3s; border-top-color: #1dd1a1; }
.category-card:nth-child(4) { animation-delay: 0.4s; border-top-color: #feca57; }
.category-card:nth-child(5) { animation-delay: 0.5s; border-top-color: #ff9ff3; }

.category-card:hover, .category-card:active {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.category-icon {
  font-size: 64px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.category-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #333;
  margin: 0 0 4px;
}

.category-meta {
  font-size: 0.9rem;
  color: #888;
  font-weight: 600;
  background: #f1f2f6;
  padding: 4px 12px;
  border-radius: 20px;
}

/* --- Quiz Play Area --- */
.quiz-play {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f8f9fa;
}

.qp-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px 20px;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  gap: 16px;
  z-index: 10;
}

.quiz-progress-bar {
  flex: 1;
  height: 16px;
  background: #e9ecef;
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1dd1a1, #0abde3);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.1);
}

.quiz-score-display {
  font-weight: 800;
  font-size: 1.4rem;
  color: #feca57;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
  min-width: 60px;
  text-align: right;
  transition: transform 0.3s;
}

.quiz-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Question Types Styles */
.question-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  animation: slideInRight 0.4s ease forwards;
}

.question-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
  background: white;
  padding: 24px 32px;
  border-radius: 30px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  border: 4px solid #fff;
}

/* Color Circle */
.color-circle {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-symbol {
  font-size: 2rem;
  font-weight: 900;
  color: #555;
  margin: 0 4px;
}

/* Answers Area */
.answers-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.answer-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 5px solid white;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  position: relative;
}

.answer-btn:active {
  transform: scale(0.9);
}

.answer-btn.correct {
  animation: correctAnswer 0.5s forwards;
}

.answer-btn.correct::after {
  content: '✅';
  position: absolute;
  font-size: 3rem;
  animation: bounceIn 0.5s;
  text-shadow: none;
}

.answer-btn.wrong {
  animation: shake 0.5s forwards;
  opacity: 0.7;
}

.answer-btn.wrong::after {
  content: '❌';
  position: absolute;
  font-size: 3rem;
  animation: bounceIn 0.3s;
  text-shadow: none;
}

/* Specific prompt types */
.emoji-prompt {
  font-size: 80px;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
  animation: float 3s ease-in-out infinite;
}

.grid-prompt {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
  gap: 15px;
  justify-items: center;
  align-items: center;
  width: 100%;
  max-width: 400px;
}

/* Pattern prompt specific */
.pattern-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.pattern-question-mark {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #f1f2f6;
  border: 4px dashed #ced6e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #a4b0be;
}

/* --- Quiz Result --- */
.quiz-result {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #a8ff78 0%, #78ffd6 100%);
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 20;
}

.quiz-result-content {
  background: white;
  padding: 40px;
  border-radius: 30px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  max-width: 90%;
  width: 400px;
  animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-emoji {
  font-size: 100px;
  margin-bottom: 20px;
  display: inline-block;
  animation: float 2s infinite ease-in-out;
}

.result-title {
  font-size: 2rem;
  font-weight: 900;
  color: #333;
  margin-bottom: 10px;
}

.result-stars {
  font-size: 2.5rem;
  letter-spacing: 5px;
  margin-bottom: 20px;
  color: #feca57;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-score-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: #666;
  margin-bottom: 30px;
}

.result-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-result {
  border: none;
  padding: 16px 24px;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.btn-result:active {
  transform: scale(0.95);
}

.btn-retry {
  background: linear-gradient(90deg, #ff9ff3, #feca57);
}

.btn-menu {
  background: linear-gradient(90deg, #48dbfb, #1dd1a1);
}


/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

@keyframes correctAnswer {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(46, 204, 113, 0); }
  50% { transform: scale(1.1); box-shadow: 0 0 30px rgba(46, 204, 113, 0.8); border-color: #2ecc71; }
  100% { transform: scale(1); box-shadow: 0 0 15px rgba(46, 204, 113, 0.6); border-color: #2ecc71; }
}

@keyframes starEarn {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.5) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}
.star-animate {
  animation: starEarn 0.5s ease-in-out;
}

/* Confetti Canvas */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

/* Media Queries for iPad / larger screens */
@media (min-width: 768px) {
  .quiz-categories {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  
  .color-circle {
    width: 70px;
    height: 70px;
  }
  
  .answer-btn {
    width: 100px;
    height: 100px;
  }

  .pattern-question-mark {
    width: 70px;
    height: 70px;
  }

  .quiz-menu-hero {
    padding: 4rem 2rem 5rem;
    font-size: 1.2rem;
  }
  
  .quiz-menu-title {
    font-size: 2.8rem;
  }
}
