/* Grundlayout */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #111827;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(120deg, #ffb347, #ffcc33);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #4b5563;
}

.badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* Hauptbereich */
.app-main {
  flex: 1;
  padding: 1rem 1.5rem 1.5rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.hidden {
  display: none;
}

/* Startseite */
.home-intro h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
}

.home-intro p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem;
}

.category-card {
  text-align: left;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.category-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-icon {
  font-size: 1.5rem;
}

.category-card h3 {
  margin: 0;
  font-size: 1rem;
}

.category-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #4b5563;
}

.category-meta {
  margin-top: 0.2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
}

/* Kategorie-Detailseite */
.back-button {
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 0.7rem;
  font-size: 0.85rem;
  color: #4b5563;
  cursor: pointer;
}

.back-button:hover {
  color: #111827;
}

.category-header h2 {
  margin: 0 0 0.15rem;
  font-size: 1.2rem;
}

.category-header p {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: #4b5563;
}

/* Modus-Schalter */
.mode-switch {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.15rem;
  background: #e5e7eb;
  margin-bottom: 0.8rem;
}

.mode-button {
  border: none;
  background: none;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  color: #4b5563;
}

.mode-button.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* Lernansicht */
.phrase-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.phrase-card {
  border-radius: 0.85rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 0.7rem 0.9rem;
  box-shadow: 0 1px 5px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.phrase-de {
  font-size: 0.95rem;
  font-weight: 600;
}

.phrase-th {
  font-size: 0.95rem;
  color: #b91c1c;
}

.phrase-phon {
  font-size: 0.8rem;
  font-style: italic;
  color: #4b5563;
}

.phrase-actions {
  margin-top: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.play-button {
  border: none;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  background: #fbbf24;
  color: #111827;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.play-button:hover {
  background: #f59e0b;
}

/* Quizansicht */
.quiz-view {
  margin-top: 0.5rem;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.quiz-question {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.quiz-answer-button {
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.quiz-answer-button:hover {
  background: #f3f4f6;
}

.quiz-answer-button.correct {
  background: #bbf7d0;
  border-color: #16a34a;
}

.quiz-answer-button.wrong {
  background: #fecaca;
  border-color: #dc2626;
}

.quiz-result {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.quiz-next-button {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  background: #3b82f6;
  color: #ffffff;
}

.quiz-next-button:hover {
  background: #2563eb;
}

/* Mobile-Optimierung */
@media (max-width: 768px) {
  .app-main {
    padding: 0.9rem;
  }

  .app-header {
    padding: 0.8rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .app-header h1 {
    font-size: 1.2rem;
  }

  .badge {
    align-self: flex-end;
  }

  .phrase-card {
    padding: 0.6rem 0.7rem;
  }

  .quiz-answer-button {
    font-size: 0.85rem;
  }
}
