/* Theme variables */
:root {
  --primary-color: #4CAF50;
  --secondary-color: #2196F3;
  --background-color: #f0f8ff;
  --text-color: #333;
  --correct-color: #4CAF50;
  --wrong-color: #f44336;
  --card-bg: white;
  --input-bg: white;
  --input-border: #ddd;
}

/* Dark theme */
[data-theme="dark"] {
  --background-color: #1a1a1a;
  --text-color: #ffffff;
  --card-bg: #2d2d2d;
  --input-bg: #3d3d3d;
  --input-border: #4d4d4d;
}

/* Main styles */
body {
  font-family: 'Comic Sans MS', 'Arial', sans-serif;
  background-color: var(--background-color);
  text-align: center;
  padding: 15px;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

h1 {
  color: var(--primary-color);
  font-size: 1.8rem;
  margin: 15px 0;
}

.question {
  background-color: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  margin: 15px auto;
  max-width: 90%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  margin-top: 100px;
}

.picture {
  width: 80%;
  max-width: 300px;
  height: auto;
  object-fit: contain;
  margin: 15px auto;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.question-text {
  font-size: 1.2rem;
  margin: 15px 0;
  color: var(--text-color);
}

.choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

.choices button {
  flex: 1;
  min-width: 80px;
  max-width: 150px;
  padding: 12px 20px;
  font-size: 1.1rem;
  border-radius: 25px;
  border: none;
  background-color: var(--secondary-color);
  color: white;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  font-family: inherit;
  text-transform: uppercase;
  font-weight: bold;
  position: relative;
  overflow: hidden;
}

.choices button.selected {
  background-color: #673AB7;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.choices button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.choices button:disabled.selected {
  opacity: 1;
}

.choices button:hover {
  transform: scale(1.05);
  background-color: #1976D2;
}

.choices button:active {
  transform: scale(0.95);
}

#result {
  font-size: 1.5rem;
  margin: 20px 0;
  font-weight: bold;
  min-height: 40px;
  animation: fadeIn 0.5s;
}

.progress-bar {
  width: 90%;
  max-width: 400px;
  height: 10px;
  background-color: rgba(221, 221, 221, 0.2);
  border-radius: 5px;
  margin: 15px auto;
  overflow: hidden;
  }

.progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 5px;
}

.score {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin: 10px 0;
}

.feedback {
  font-size: 1.1rem;
  margin: 10px 0;
  color: #666;
  background-color: var(--card-bg);
  border-radius: 10px;
  padding: 15px;
  margin: 15px auto;
  max-width: 90%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-left: 4px solid var(--primary-color);
  text-align: left;
}

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

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

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

.correct-answer {
  animation: bounce 0.5s;
  color: var(--correct-color);
}

.wrong-answer {
  color: var(--wrong-color);
}

.correct-pulse {
  animation: pulse 0.5s;
  background-color: var(--correct-color) !important;
  color: white !important;
}

.wrong-pulse {
  animation: pulse 0.5s;
  background-color: var(--wrong-color) !important;
  color: white !important;
}

.blank {
  display: inline-block;
  min-width: 80px;
  border-bottom: 2px dashed var(--primary-color);
  margin: 0 5px;
  padding: 0 5px;
  position: relative;
  transition: all 0.3s ease;
}

.blank.filled {
  border-bottom-style: solid;
  background-color: rgba(76, 175, 80, 0.1);
  border-radius: 4px;
}

.blank.correct {
  color: var(--correct-color);
  border-bottom-color: var(--correct-color);
}

.blank.wrong {
  color: var(--wrong-color);
  border-bottom-color: var(--wrong-color);
  animation: shake 0.5s;
}

.blank-group span {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text-color);
  opacity: 0.8;
}

/* Mobile optimizations */
@media (max-width: 600px) {
  h1 {
    font-size: 1.5rem;
  }

  .question {
    padding: 15px;
  }

  .choices button {
    padding: 10px 15px;
    font-size: 1rem;
  }

  .picture {
    width: 90%;
  }
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  color: var(--text-color);
}

/* Landing page styles */
.landing-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.welcome-card {
  background-color: var(--card-bg);
  border-radius: 15px;
  padding: 30px;
  margin: 20px auto;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: background-color 0.3s;
}

.input-group {
  margin: 15px 0;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--text-color);
}

.input-field {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--input-border);
  border-radius: 8px;
  font-size: 16px;
  background-color: var(--input-bg);
  color: var(--text-color);
  transition: border-color 0.3s;
}

.input-field:focus {
  border-color: var(--primary-color);
  outline: none;
}

.difficulty-buttons {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.difficulty-btn {
  flex: 1;
  min-width: 120px;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  font-family: inherit;
}

.difficulty-btn.easy {
  background-color: #4CAF50;
  color: white;
}

.difficulty-btn.medium {
  background-color: #FF9800;
  color: white;
}

.difficulty-btn.hard {
  background-color: #f44336;
  color: white;
}

.difficulty-btn.very-hard {
  background-color: #9C27B0;
  color: white;
}

.difficulty-btn:hover {
  transform: scale(1.05);
}

.start-btn {
  background-color: var(--primary-color);
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 25px;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s;
  margin-top: 20px;
}

.start-btn:hover {
  transform: scale(1.05);
}

/* Game page styles */
.game-container {
  display: none;
}

.timer-container {
  font-size: 1.2rem;
  color: var(--text-color);
  margin: 10px 0;
  display: none;
}

.next-question-btn {
  background-color: var(--primary-color);
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s;
  margin: 15px 0;
  display: none;
}

.next-question-btn:hover {
  transform: scale(1.05);
}

