/* ===== Farbvariablen ===== */
:root {
  --bg-main: #f5f5f5;
  --bg-dark: #1e1e1e;
  --bg-mid: #2e2e2e;
  --bg-light: #3c3c3c;
  --bg-hover: #505050;
  --text-light: #ffffff;
  --text-dark: #121212;
  --error-bg: #ffcdd2;
  --error-text: #b71c1c;
}

/* ===== Reset & Grundlagen ===== */
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
}

a {
  color: var(--text-light);
  text-decoration: none;
}

h1, h2 {
  margin: 0.5em 0;
}

input[type="text"],
input[type="password"],
textarea,
select {
  padding: 0.3em;
  font-size: 1em;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: var(--text-dark);
  border: 1px solid #ccc;
}

input[type="checkbox"] {
  accent-color: var(--bg-mid);
}

/* ===== Header (FIXIERT) ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-dark);
  color: var(--text-light);
  display: flex;
  align-items: center;
  padding: 0.5em 1em;
  z-index: 1000;
  gap: 1em;
  width: 100%;
}

.header-inner {
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
  max-width: 1000px;
  width: 100%;
  z-index: 1000;
}

header span {
  font-weight: bold;
  flex-grow: 1;
}

.menu-toggle {
  font-size: 1.5em;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  display: block;
}

/* ===== Navigation ===== */
.main-nav {
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    background: var(--bg-mid);
    flex-wrap: nowrap;
    z-index: 10001;
    transform: translateY(-100%);
    transition: transform 0.3s ease-out, background-color 0.2s;
}

.main-nav a {
  padding: 0.7em 1em;
  display: block;
  color: var(--text-light);
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--bg-hover);
}

body.nav-open .main-nav {
    display: flex;
    transform: translateY(0);
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    overflow-y: auto;
    z-index: 10001;
}

.admin-nav a {
  padding: 0.7em 1em;
  display: block;
  color: #ccc;
  border-top: 1px solid #555;
}

/* ===== Layout-Container ===== */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1em 1em 1em;
}

.card {
  background: #fff;
  border-radius: 5px;
  padding: 0.6em 1em;
  margin: 0.5em 0;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  color: var(--text-dark);
  flex: 1 1 300px;
  min-width: 280px;
}

.card label {
  margin-bottom: 0.4em;
}

.cards-container {
  display: flex;
  flex-wrap: wrap;
  background: #fff;
  border-radius: 5px;
  padding: 0.6em 1em;
  margin: 0.5em 0;
  margin-bottom: 0.4em;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  color: var(--text-dark);
}

.card.dexcards {
  flex: 1 1 300px;
  max-width: 450px;
  margin-bottom: 0.8em;
}

.dexcards .flags,
.dexcards .variant-flags {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4em 1em;
  margin-bottom: 0.4em;
}

.dexcards label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

/* ===== Tabellen ===== */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: var(--text-dark);
}

th, td {
  border: 1px solid #ddd;
  padding: 0.5em;
  text-align: left;
}

th {
  background: #eee;
}

/* ===== Status & Hervorhebung ===== */
.saved {
  animation: flash 0.8s;
}

@keyframes flash {
  from { background: var(--bg-hover); }
  to { background: transparent; }
}

.highlight {
  animation: highlight-anim 1.5s ease-out;
}

@keyframes highlight-anim {
  0% {
  box-shadow: 0 0 15px 5px rgba(255, 223, 77, 0.9);
  outline: 3px solid #FFDF4D;
  }
  100% {
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  outline: none;
  }
}

/* ===== Buttons ===== */
button,
.button,
.btn,
.cbtn {
  background: var(--bg-mid);
  color: var(--text-light);
  border: none;
  padding: 0.3em 0.9em;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1em;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s ease-in-out;
}

button:hover,
.button:hover,
.btn:hover,
.cbtn:hover {
  background: var(--bg-hover);
}

.cbtn {
  margin: 1em auto;
  display: block;
  text-align: center;
}

/* ===== Formulare & Suche ===== */
label {
  display: block;
  margin-bottom: 1em;
}

.search-container {
  position: fixed;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-main);
  padding: 1em 1em;
  z-index: 999;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  max-width: 1000px;
  width: 100%;
  box-sizing: border-box;
}

form.search {
  display: flex;
  gap: 0.5em;
  margin-bottom: 0;
  align-items: center;
}

form.search input[type="text"] {
  padding: 0.2em 0.3em;
  font-size: 1em;
  height: 100%;
}

form.search button {
  padding: 0.1em 0.8em;
  font-size: 1em;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.5em;
}

.search-string {
  flex-grow: 1;
  padding: 0.4em;
  font-family: monospace;
}

.error {
  background: var(--error-bg);
  color: var(--error-text);
  padding: 1em;
  margin: 1em 0;
  border-radius: 3px;
}

.page-title {
  font-weight: bold;
  font-size: 1.2em;
}

/* ===== Wishlist / Wunschliste ===== */
.wishlist {
  list-style: none;
  padding-left: 0;
  margin-top: 1em;
}

.wishlist li {
  background: #fff;
  color: var(--text-dark);
  padding: 0.7em;
  margin-bottom: 0.5em;
  border-radius: 4px;
  box-shadow: 0 0 3px rgba(0,0,0,0.1);
}

.wishlist-form {
  display: flex;
  gap: 0.5em;
  margin-bottom: 1em;
}

.wishlist-form input[type="text"] {
  flex-grow: 1;
  background: #fff;
  color: var(--text-dark);
  border: 1px solid #ccc;
  padding: 0.4em;
  border-radius: 3px;
}

/* ===== Typen-Icons ===== */
.type-icons {
  display: inline-flex;
  vertical-align: middle;
  gap: 0.3em;
}

.type-icon {
  height: 20px;
  width: auto;
}

/* ===== Grundlayout für fixen Header ===== */

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
}

.main-content {
  padding-top: 100px;
  min-height: 100vh;
}

#toggleLockBtn.is-locked {
  background: var(--bg-dark);
  color: var(--text-light);
  border: 1px solid var(--text-light);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  transition: background-color 0.2s, box-shadow 0.2s;
}

#toggleLockBtn.is-locked:hover {
  background: var(--bg-dark);
  cursor: default;
}
