:root {
  --bg: #121212;
  --bg-dark: #1a1a1a;
  --bg-darker: #0e0e0e;
  --text: #f0f0f0;
  --accent: #a362ea;
  --accent-glow: rgba(163, 98, 234, 0.6);
  --card: #1e1e1e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

header {
  padding: 1rem;
  text-align: center;
  background-color: var(--bg-dark);
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 5px var(--bg-darker);
}

header h1 {
  font-size: 1.6rem;
  color: var(--accent);
}

.level-display {
  font-size: 1.6rem;
  margin-top: 0.5rem;
  color: var(--accent);
  font-weight: bold;
}

.xp-bar {
  width: 90%;
  height: 20px;
  background-color: #2a2a2a;
  border-radius: 10px;
  margin: 0.5rem auto;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 10px var(--accent-glow);
}

.xp-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent), #7c3aed);
  width: 0%;
  border-radius: 10px;
  transition: width 0.8s ease-in-out; /* ✨ SMOOTH TRANSITION */
}

#xp-percent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #fff;
  pointer-events: none;
}

main {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background-color: var(--bg);
}

#quest-list li {
  background-color: var(--card);
  margin: 0.5rem 0;
  padding: 0.8rem;
  border-radius: 0.5rem;
  list-style: none;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.05);
}

footer {
  background-color: var(--bg-dark);
  border-top: 1px solid #333;
  box-shadow: 0 -2px 5px var(--bg-darker);
}

nav {
  display: flex;
  justify-content: space-around;
}

.tab {
  flex: 1;
  padding: 1.2rem 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.8rem; /* Größeres Emoji! */
  text-align: center;
  transition: background-color 0.2s;
}

.tab:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.tab.active {
  color: var(--accent);
  font-weight: bold;
}

.character-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.character-image {
  max-width: 80%;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Quest Modal Style */
.quest-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.quest-modal.hidden {
  display: none;
}

.quest-modal-content {
  background: #1a1a1a;
  border: 2px solid #7c3aed;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  color: #fff;
  box-shadow: 0 0 20px #7c3aed88;
  position: relative;
}

.quest-modal-content h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 20px;
}

.quest-modal-content input,
.quest-modal-content select {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #2a2a2a;
  color: #fff;
  font-size: 16px;
}

.quest-modal-content button {
  width: 100%;
  padding: 10px;
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.quest-modal-content button:hover {
  background: #a970ff;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 22px;
  color: #aaa;
  cursor: pointer;
}

.close-modal:hover {
  color: #fff;
}

.success-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #4caf50;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 0 10px #4caf50;
  z-index: 9999;
  animation: fadeInOut 3s forwards;
}

.error-message {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #e53935;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 0 10px #e53935;
  z-index: 9999;
  animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
  10% { opacity: 1; transform: translateX(-50%) translateY(0); }
  90% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

.add-quest-btn {
  display: block;
  margin: 20px auto;
  padding: 14px 28px;
  background-color: #2a2a2a;
  color: #b78cff;
  border: 2px solid #7c3aed;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-quest-btn:hover {
  background-color: #7c3aed;
  color: #fff;
  box-shadow: 0 0 10px #7c3aed;
}

.admin-reset-button {
  background-color: #2a2a2a;
  color: white;
  border: 2px solid #7c3aed;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 0 10px #7c3aed88;
  transition: background-color 0.3s;
}

.admin-reset-button:hover {
  background-color: #7c3aed;
  color: white;
}

.quest-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quest-item {
  background: #1a1a1a;
  border-radius: 10px;
  margin: 10px 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  transition: background 0.3s ease;
}

.quest-item.done {
  opacity: 0.5;
  text-decoration: line-through;
}

.quest-item label {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  cursor: pointer;
}

.quest-checkbox {
  margin-right: 12px; /* ← Abstand zur rechten Seite, also zum Text */
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #7c3aed;
  border-radius: 4px;
  background: transparent;
  position: relative;
  transition: all 0.3s ease;
}

.quest-checkbox:checked {
  background-color: #7c3aed;
  border-color: #7c3aed;
}

.quest-checkbox:checked::after {
  content: '✓';
  color: white;
  font-weight: bold;
  position: absolute;
  top: 0;
  left: 4px;
}

.quest-text {
  flex: 1;
  font-size: 1rem;
  color: #fff;
}

.pulse-message {
  animation: pulseFade 0.5s ease-in-out;
}

@keyframes pulseFade {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}

.xp-boost-animation {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  font-size: 3rem;
  font-weight: bold;
  color: #a362ea;
  text-shadow: 0 0 10px #a362ea, 0 0 20px #fff, 0 0 30px #a362ea;
  animation: flyUpFade 1.4s ease-out forwards;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
}

@keyframes flyUpFade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -55%) rotate(5deg) scale(1.1);
  }
  60% {
    transform: translate(-50%, -70%) rotate(-5deg) scale(1);
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -90%) rotate(10deg) scale(0.9);
  }
}

.level-up-animation {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5rem;
  font-weight: bold;
  color: #ffe600;
  text-shadow: 0 0 10px #ffe600, 0 0 20px #ffbb00, 0 0 30px #fff;
  animation: popFade 2s ease-out forwards;
  z-index: 10001;
  pointer-events: none;
}

@keyframes popFade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  50% {
    transform: translate(-50%, -60%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -90%) scale(0.8);
  }
}

.level-up-glow {
  background: linear-gradient(to right, gold, orange, gold);
  box-shadow: 0 0 15px gold, 0 0 30px orange;
  transition: background 0.5s, box-shadow 0.5s;
}

.header-flex {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* linksbündig bleibt */
  padding: 15px 20px;
  background-color: var(--bg-dark);
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 5px var(--bg-darker);
}

.logo {
  max-width: 100px; /* größer als vorher */
  height: auto;
}

.level-xp-container {
  flex: 1;
  margin-left: 20px;
}

.level-display {
  font-size: 1.6rem; /* größer! */
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 8px; /* minimal mehr Abstand zur XP-Bar */
}

.xp-bar {
  width: 100%;
  height: 22px; /* etwas höher! */
  background-color: #2a2a2a;
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 8px var(--accent-glow);
}

#xp-percent {
  font-size: 0.9rem; /* Prozentzahl leicht größer */
}

.quest-tab-nav {
  position: relative;
  display: flex;
  justify-content: space-around;
  margin: 1rem 0 0.5rem 0;
  padding-bottom: 0.4rem;
}

.quest-tab {
  flex: 1;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text);
  padding: 0.8rem 0 0.4rem 0;
  cursor: pointer;
  position: relative;
}
.quest-tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 25%;
  width: 0%;
  height: 3px;
  background-color: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.quest-tab.active::after {
  width: 50%;
}

footer nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem 0;
  background-color: var(--bg-dark);
  border-top: 1px solid #333;
  box-shadow: 0 -2px 5px var(--bg-darker);
}

.tab {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  padding: 0.6rem 0;
  cursor: pointer;
  position: relative;
}

.tab::before {
  content: "";
  position: absolute;
  top: 0; /* Balken ganz oben im Button */
  left: 25%;
  width: 0%;
  height: 3px;
  background-color: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.tab.active::before {
  width: 50%;
}

.tab-icon {
  width: 45px;
  height: 45px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tab:hover .tab-icon {
  opacity: 1;
  transform: scale(1.1);
}

.tab.active .tab-icon {
  opacity: 1;
  filter: drop-shadow(0 0 6px var(--accent));
}

.quest-tab-label {
  font-size: 1.4rem;
  font-weight: bold;
  color: #ccc;
  display: inline-block;
  transition: transform 0.2s ease;
}

.quest-tab.active .quest-tab-label {
  color: var(--accent);
  transform: scale(1.2);
}

.quest-tab-label {
  font-size: 1.6rem;
  font-weight: bold;
  color: #ccc;
  display: inline-block;
  transition: transform 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
}

.quest-tab.active .quest-tab-label {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent), 0 0 12px var(--accent-glow);
  transform: scale(1.15);
}

.quest-text.done {
  text-decoration: line-through;
  opacity: 0.5;
}

.quest-category-title {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: var(--accent);
}

.delete-category-btn,
.confirm-delete-category {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #888;
  cursor: pointer;
  margin-left: 10px;
}

.confirm-delete-category {
  background-color: #e53935;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.delete-category-btn {
  margin-right: 16px; /* oder 10px, je nach Optik */
}

.drag-over {
  background-color: #222;
  transition: background-color 0.2s ease;
}

.dragging {
  opacity: 0.5;
}

/* Fortschritt Bereich */
.tracker-container {
  background: #121212;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.3);
  margin-bottom: 2rem;
}

.tracker-container h3 {
  font-size: 1.5rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
}

.tracker-container input,
.tracker-container select {
  background: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 10px;
  width: 100%;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.tracker-container input::placeholder {
  color: #888;
}

.tracker-container button {
  background: #7c3aed;
  color: white;
  padding: 12px;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.tracker-container button:hover {
  background: #9d4edd;
}

.tracker-delete-all {
  background: #e53935;
  margin-top: 0.5rem;
}

.tracker-delete-all:hover {
  background: #ff4d4d;
}

#tracker-category-filter {
  margin-top: 1rem;
}

#tracker-chart {
  margin-top: 1rem;
  background: #1e1e1e;
  border-radius: 10px;
  padding: 10px;
}

/* Dunkle Inputfelder */
#tracker-date,
#tracker-category,
#tracker-value,
#tracker-category-filter {
  background-color: #1f1f1f;
  color: #f0f0f0;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px;
  font-size: 1rem;
  transition: background-color 0.3s, border-color 0.3s;
}

/* Fokus-Effekt */
#tracker-date:focus,
#tracker-category:focus,
#tracker-value:focus,
#tracker-category-filter:focus {
  outline: none;
  border-color: #7c3aed;
  background-color: #2a2a2a;
}

/* Select-Dropdown – Pfeil anpassen */
#tracker-category-filter {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}

#consent-banner .quest-modal-content p {
  margin-bottom: 20px; /* Abstand vom Text nach unten erhöhen */
}

#consent-banner #consent-accept {
  margin-bottom: 15px; /* Abstand zwischen Zustimmen-Button und Ablehnen-Button */
}

#consent-banner #consent-decline {
  margin-top: 10px; /* zusätzlicher Abstand zum oberen Button */
}

.accordion-container {
  max-width: 600px;
  margin: 1rem auto;
}

.accordion {
  background-color: #1e1e1e;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.accordion-header {
  background-color: #7c3aed;
  color: white;
  cursor: pointer;
  padding: 12px;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.accordion-header:hover {
  background-color: #a970ff;
}

.accordion-header.active {
  background-color: #9d4edd;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 12px;
  background-color: #2a2a2a;
}

.accordion-content p {
  padding: 10px 0;
  margin: 0;
  color: #fff;
}
