:root {
  --bg-color: #0e0e0e;
  --text-color: #ffffff;
  --box-color: #1b1b1b;
  --button-color: #ff4757;
  --button-hover: #e84118;
}

body.light {
  --bg-color: #f4f4f4;
  --text-color: #111;
  --box-color: #fff;
  --button-color: #007bff;
  --button-hover: #0056b3;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 40px 20px;
  display: flex;
  justify-content: center;
}

.main {
  background: var(--box-color);
  padding: 30px;
  border-radius: 10px;
  max-width: 600px;
  width: 100%;
  position: relative;
  z-index: 1000;
}

h1 { color: var(--button-color); text-align: center; }

textarea {
  width: 100%;
  height: 140px;
  margin: 15px 0;
  padding: 10px;
  background: var(--box-color);
  color: var(--text-color);
  border: none;
  border-radius: 6px;
  resize: vertical;
  font-size: 14px;
}

button {
  width: 100%;
  padding: 12px;
  background-color: var(--button-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}
button:hover { background-color: var(--button-hover); }

pre { white-space: pre-wrap; font-size: 13px; margin-top: 15px; }

.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--box-color);
  color: var(--text-color);
  padding: 15px 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
  border-top: 2px solid var(--button-color);
}
.cookie-buttons { display: flex; gap: 10px; }
.cookie-buttons button {
  flex: 1;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}
#acceptEssential { background: #444; color: #fff; }
#acceptAll { background: var(--button-color); color: #fff; }

.hidden { display: none !important; }

/* Theme Toggle jetzt fest oben rechts */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
}
.switch { display:flex; align-items:center; gap:10px; cursor:pointer; position:relative; }
.switch input { display:none; }
.icon { font-size:18px; z-index:2; pointer-events:none; }
.slider {
  width:40px; height:20px;
  background:#666;
  border-radius:20px;
  position:relative;
  transition:background-color .3s;
}
.slider::before {
  content:"";
  position:absolute;
  top:2px;
  left:2px;
  width:16px;
  height:16px;
  background:#fff;
  border-radius:50%;
  transition: transform .3s;
}
#themeSwitcher:checked + .icon + .slider::before {
  transform: translateX(20px);
}
#themeSwitcher:checked + .icon + .slider {
  background:#333;
}

/* Sprach-Auswahl direkt unter Theme Toggle */
.language-select {
  position: fixed;
  top: 60px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 1100;
}
.lang-btn {
  font-size:20px;
  background:transparent;
  border:0;
  cursor:pointer;
  transition: transform .2s;
}
.lang-btn:hover { transform: scale(1.2); }

#debugPanel {
  position: fixed; bottom: 10px; right: 10px;
  background: rgba(30,30,30,.95);
  color: #fff;
  padding:15px;
  border-radius:10px;
  font-size:13px;
  max-width:320px;
  z-index: 9999;
  font-family: monospace;
  box-shadow: 0 0 10px #000;
}
#debugPanel h3 { margin-top:0; font-size:15px; }
#debugPanel button {
  margin-bottom:8px;
  margin-right:5px;
  padding:5px 10px;
  font-size:12px;
  cursor:pointer;
}

.format-section {
  background: rgba(255,255,255,.02);
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid var(--button-color);
}
.format-section label {
  display:block;
  margin:8px 0 4px;
  font-weight:700;
  font-size:14px;
}
.format-section select {
  width:100%;
  padding:8px;
  border-radius:6px;
  border:0;
  font-size:14px;
  background: var(--box-color);
  color: var(--text-color);
}
.format-section select:focus {
  outline: 2px solid var(--button-color);
}

/* ===== Ad Slots ===== */
.ad-rail {
  position: fixed;
  top: 22vh;
  height: 600px;
  width: 160px;
  background: var(--box-color);
  border: 1px solid rgba(255,255,255,0.08);
  z-index: 900;
  display: none;
  overflow: hidden;
  padding: 8px;
  box-shadow: 0 0 12px rgba(0,0,0,0.35);
  pointer-events: auto;
}
.ad-rail-left  { left: 0; }
.ad-rail-right { right: 0; }

.ad-bottom {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  min-height: 90px;
  background: var(--box-color);
  border-top: 2px solid var(--button-color);
  z-index: 900;
  display: none;
  padding: 8px 48px 12px 12px;
  box-shadow: 0 -6px 14px rgba(0,0,0,0.35);
  pointer-events: auto;
}

.ad-slot {
  width: 100%;
  height: 100%;
  position: relative;
  display: block;
  overflow: hidden;
}

.ad-slot:not([data-loaded="1"])::after {
  content: "Werbefläche";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #888;
  font-size: 12px;
  letter-spacing: .08em;
  border: 1px dashed rgba(255,255,255,0.15);
  pointer-events: none;
}

.ad-slot[data-loaded="1"] { pointer-events: auto; }

.ad-slot iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.ad-close {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 4px;
  background: #444;
  color: #fff;
  font-size:18px;
  line-height:28px;
  cursor: pointer;
  z-index:2;
}
.ad-close:hover {
  filter: brightness(1.15);
}

body.has-bottom-ad {
  padding-bottom: 120px;
}

@media (min-width: 1200px) {
  body.with-side-ads {
    padding-left: 170px;
    padding-right: 170px;
  }
  .ad-rail { display: block; }
}

@media (min-width: 720px) {
  .ad-bottom { display: block; }
}
