/* style.css — Modernes UI-Design für den Vokabeltrainer */

/* ===========================
   Grundlayout & Farben
=========================== */
:root {
  --bg: #f7f9fc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.08);
  --radius: 12px;

  /* Dark Mode */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #f8fafc;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.4);
  }
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
  padding: 1rem;
}

/* ===========================
   Navigation
=========================== */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  box-shadow: 0 1px 4px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topnav a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 500;
  margin-right: 1rem;
  transition: color 0.2s;
}

.topnav a:hover {
  color: var(--accent-hover);
}

.topnav .muted {
  color: var(--text);
  opacity: 0.7;
  font-size: 0.9rem;
}

/* ===========================
   Überschriften & Sektionen
=========================== */
h1, h2, h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

section:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px var(--shadow);
}

/* ===========================
   Buttons
=========================== */
button, .btn, input[type="submit"] {
  background: var(--accent);
  border: none;
  color: white;
  font-weight: 500;
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button:hover, .btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

/* ===========================
   Formulare
=========================== */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  font-weight: 500;
  display: flex;
  flex-direction: column;
  color: var(--text);
}

input, select, textarea {
  margin-top: 0.3rem;
  padding: 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: border 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
}

/* ===========================
   Listen
=========================== */
ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

li:last-child {
  border-bottom: none;
}

/* ===========================
   Fehler- und Erfolgsmeldungen
=========================== */
.error, .success {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 500;
}

.error {
  background: #fee2e2;
  color: #b91c1c;
}

.success {
  background: #dcfce7;
  color: #166534;
}

/* ===========================
   Hausaufgaben & Pop-up
=========================== */
.hw {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hw a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.hw a:hover {
  color: var(--accent-hover);
}

/* ===========================
   Footer
=========================== */
footer {
  text-align: center;
  padding: 1rem;
  margin-top: auto;
  color: var(--text);
  opacity: 0.6;
  font-size: 0.85rem;
}

.list-dashboard {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-dashboard li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.list-dashboard li:last-child {
  border-bottom: none;
}

.list-actions a {
  text-decoration: none;
  color: var(--accent);
  margin-left: 0.5rem;
  font-weight: 500;
  transition: color 0.2s;
}

.list-actions a:hover {
  color: var(--accent-hover);
}

/* ===========================
   Responsive Design
=========================== */
@media (max-width: 600px) {
  .container {
    padding: 0.5rem;
  }

  .topnav {
    flex-direction: column;
    align-items: flex-start;
  }

  .topnav a {
    margin: 0.2rem 0;
  }

  section {
    padding: 1rem;
  }
}

/* Pop-Up Overlay */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(77, 77, 77, 0.2); /* helles Blau */
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 10px;
}

/* Pop-Up Container */
.modal-content {
  background: #4D4D4D;
  color: #fff;
  padding: 25px 30px;
  border-radius: 15px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  position: relative;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Close Button */
.close {
  position: absolute;
  top: 12px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
}

.close:hover {
  color: #f1c40f;
  transform: rotate(90deg);
}

/* Form Layout */
#editForm label {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  font-weight: 500;
  font-size: 1rem;
}

/* Inputs auf Pop-Up blau, Text sichtbar */
#editForm input[type="text"] {
  padding: 8px 12px;
  border: 1px solid #2980b9;
  border-radius: 8px;
  margin-top: 5px;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
  background: #2980b9; /* dunkleres Blau für Input */
  color: #fff;         /* Text sichtbar */
}

/* Inputs beim Fokus */
#editForm input[type="text"]:focus {
  outline: none;
  background: #3498db;
  border: 1px solid #fff;
}

/* Checkbox besser sichtbar */
#editForm input[type="checkbox"] {
  width: auto;
  margin-top: 10px;
  accent-color: #1abc9c;
}

/* Submit Button */
#editForm button[type="submit"] {
  background-color: #1abc9c;
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  width: 100%;
  margin-top: 10px;
  transition: all 0.3s;
}

#editForm button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* Slide Animation */
@keyframes slideDown {
  0% { transform: translateY(-50px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.feedback {
  padding: 10px 15px;
  border-radius: 10px;
  margin: 15px auto;
  max-width: 400px;
  font-weight: bold;
  text-align: center;
}
.feedback.right {
  background: #2ecc71;
  color: white;
}
.feedback.wrong {
  background: #e74c3c;
  color: white;
}


/* Added card styles for book/category detail views */
.container {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
}
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  padding: 20px;
  margin-bottom: 16px;
}
.card h1 { margin-top: 0; }
.card-actions { margin-top: 16px; display:flex; gap:8px; flex-wrap:wrap; }
.btn {
  display:inline-block;
  padding:8px 12px;
  border-radius:6px;
  text-decoration:none;
  border:1px solid #ccc;
  background:#f8f8f8;
}
.book-list { list-style:none; padding-left:0; }
.book-list li { padding:8px 0; border-bottom:1px solid #efefef; }
.book-list .meta { color:#666; font-size:0.9em; margin-left:8px; }
