/* Particle Quiz Specific Styles - FIXED VERSION */

/* FIXED: Proper container sizing and positioning */
.particle-quiz-container {
  padding: 0;
  width: 100%;
  display: block;
}

.particle-question-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 30px 20px;
  margin-bottom: 30px;
  border: 2px solid rgba(156, 39, 176, 0.2);
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
}

.particle-question-section.answered-correct {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.05);
}

.particle-question-section.answered-incorrect {
  border-color: #f44336;
  background: rgba(244, 67, 54, 0.05);
}

/* FIXED: Better sentence styling with proper blank representation */
.sentence-with-blank {
  font-size: 32px;
  line-height: 1.4;
  margin: 25px 0;
  font-family: 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  text-align: center;
  color: #1b5e20;
  word-spacing: 0.1em;
}

/* FIXED: Improved blank styling */
.particle-blank {
  display: inline-block;
  min-width: 60px;
  height: 45px;
  border: 3px dashed #9c27b0;
  border-radius: 8px;
  margin: 0 5px;
  position: relative;
  vertical-align: middle;
  background: rgba(156, 39, 176, 0.1);
  animation: pulse-blank 2s infinite;
  line-height: 45px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
}

/* FIXED: Updated animation to be less distracting */
@keyframes pulse-blank {
  0%, 100% { 
    border-color: #9c27b0;
    background: rgba(156, 39, 176, 0.1);
    transform: scale(1);
  }
  50% { 
    border-color: #7b1fa2;
    background: rgba(156, 39, 176, 0.15);
    transform: scale(1.02);
  }
}

.particle-blank.filled {
  border: 3px solid #4caf50;
  background: rgba(76, 175, 80, 0.2);
  animation: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #2e7d32;
  font-size: 20px;
}

/* FIXED: Better translation styling */
.sentence-translation {
  font-size: 16px;
  color: #666;
  font-style: italic;
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

/* FIXED: Improved particle options grid */
.particle-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 80px));
  gap: 12px;
  justify-content: center;
  margin: 25px auto;
  max-width: 350px;
}

/* FIXED: Better particle option buttons */
.particle-option {
  width: 70px;
  height: 70px;
  border: 3px solid #e0e0e0;
  border-radius: 12px;
  background: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.particle-option:hover {
  border-color: #9c27b0;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(156, 39, 176, 0.3);
}

.particle-option.selected {
  border-color: #2196f3;
  background: rgba(33, 150, 243, 0.1);
  transform: scale(1.1);
}

.particle-option.correct {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.2);
  animation: correct-bounce 0.6s ease;
}

.particle-option.incorrect {
  border-color: #f44336;
  background: rgba(244, 67, 54, 0.2);
  animation: incorrect-shake 0.6s ease;
}

.particle-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

@keyframes correct-bounce {
  0%, 100% { transform: scale(1.1); }
  50% { transform: scale(1.3); }
}

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

.particle-feedback {
  margin-top: 25px;
  padding: 20px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.particle-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

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

.particle-feedback.incorrect {
  background: rgba(244, 67, 54, 0.1);
  border: 2px solid #f44336;
  color: #c62828;
}

.particle-info {
  margin-top: 15px;
  padding: 15px;
  background: rgba(156, 39, 176, 0.05);
  border-radius: 8px;
  border-left: 4px solid #9c27b0;
}

.particle-reading {
  font-size: 18px;
  font-weight: bold;
  color: #7b1fa2;
  margin-bottom: 5px;
}

.particle-function {
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.particle-description {
  font-size: 16px;
  color: #333;
  line-height: 1.4;
}

.particle-progress-indicator {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: white;
}

.progress-new { background: #2196f3; }
.progress-learning { background: #ff9800; }
.progress-review { background: #9c27b0; }
.progress-mastered { background: #4caf50; }

/* Difficulty indicator */
.difficulty-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.difficulty-beginner {
  background: #e3f2fd;
  color: #1565c0;
}

.difficulty-intermediate {
  background: #fff3e0;
  color: #ef6c00;
}

.difficulty-advanced {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* FIXED: Responsive improvements */
@media (max-width: 480px) {
  .sentence-with-blank {
    font-size: 24px;
    margin: 20px 0;
  }
  
  .particle-options {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 200px;
  }
  
  .particle-option {
    width: 80px;
    height: 80px;
    font-size: 26px;
  }
  
  .particle-blank {
    min-width: 50px;
    height: 40px;
    margin: 0 3px;
    font-size: 16px;
  }
  
  .particle-question-section {
    padding: 20px 15px;
  }
}