/**
 * Einstellungen-Seite (Newsletter/Benachrichtigungen)
 * Folgt dem Farbschema aus localStorage
 */

* { box-sizing: border-box; }

/* ========================================
   Farbschema-Variablen
   ======================================== */

/* Standard: spicy (lesbar, aber bunt) */
:root,
[data-color-scheme="spicy"] {
  --page-bg: #a7ffff;
  --page-color: #333333;
  --accent-hover: #555555;
  --button-text: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.15);
  --row-highlight: rgba(0, 0, 0, 0.05);
  --row-subtle: rgba(0, 0, 0, 0.02);
  --podcast-bg: #ffb1d5;
  --podcast-color: #000000;
  --podcast-hover-bg: #ff8fc4;
  --podcast-hover-color: #000000;
}

/* Eyecancer (Original Kaiserkeller-Farben) */
[data-color-scheme="eyecancer"] {
  --page-bg: #a7ffff;
  --page-color: #ffa7a7;
  --accent-hover: #ff8080;
  --button-text: #a7ffff;
  --border-subtle: rgba(255, 167, 167, 0.3);
  --row-highlight: rgba(255, 167, 167, 0.1);
  --row-subtle: rgba(255, 167, 167, 0.05);
  --podcast-bg: #ffb1d5;
  --podcast-color: #b1ffdb;
  --podcast-hover-bg: #b1ffdb;
  --podcast-hover-color: #ffb1d5;
}

/* Mild */
[data-color-scheme="mild"] {
  --page-bg: #d9ffff;
  --page-color: #555555;
  --accent-hover: #444444;
  --button-text: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.1);
  --row-highlight: rgba(0, 0, 0, 0.04);
  --row-subtle: rgba(0, 0, 0, 0.02);
  --podcast-bg: #ffddf0;
  --podcast-color: #333333;
  --podcast-hover-bg: #ffcce6;
  --podcast-hover-color: #333333;
}

/* ========================================
   Basis
   ======================================== */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  line-height: 1.5;
  background: var(--page-bg);
  color: var(--page-color);
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--page-color);
}

h2 {
  font-size: 1.1rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--page-color);
  padding-bottom: 0.3rem;
  color: var(--page-color);
}

a {
  color: var(--page-color);
}

/* ========================================
   Farbschema-Dropdown
   ======================================== */

.farbschema-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1rem 0;
}

.farbschema-wrapper label {
  font-weight: 500;
}

.farbschema-wrapper select {
  padding: 6px 12px;
  font-size: 1rem;
  border: 2px solid var(--page-color);
  border-radius: 4px;
  background: white;
  cursor: pointer;
}

.farbschema-wrapper select:focus {
  outline: none;
  border-color: var(--accent-hover);
}

/* ========================================
   Navigation
   ======================================== */

.back-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.back-links a {
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 500;
  border-radius: 4px;
  font-size: 0.95rem;
}

.back-konzert {
  justify-self: end;
  background: white;
  color: black;
  border: 1px solid black;
}

.back-konzert:hover {
  background: black;
  color: white;
}

.back-podcast {
  justify-self: start;
  background: var(--podcast-bg);
  color: var(--podcast-color);
}

.back-podcast:hover {
  background: var(--podcast-hover-bg);
  color: var(--podcast-hover-color);
}

/* ========================================
   Formulare
   ======================================== */

input[type="email"],
input[type="text"] {
  padding: 8px 12px;
  font-size: 1rem;
  border: 2px solid var(--page-color);
  border-radius: 4px;
  width: 100%;
  max-width: 300px;
  background: white;
}

input[type="email"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-hover);
}

button {
  padding: 8px 16px;
  font-size: 1rem;
  background: var(--page-color);
  color: var(--button-text);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 8px;
  font-weight: 500;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

button.delete {
  background: #ff6b6b;
  color: white;
  padding: 4px 8px;
  font-size: 0.85rem;
}

button.delete:hover {
  background: #ff4444;
}

input[type="checkbox"] {
  accent-color: var(--page-color);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ========================================
   Tabelle
   ======================================== */

.settings-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.settings-table th {
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 4px;
  text-align: center;
}

.settings-table th:first-child {
  text-align: left;
  width: 40%;
}

.settings-table td {
  padding: 8px 4px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.settings-table td:first-child {
  text-align: left;
}

.settings-table tr.header-row td {
  font-weight: 500;
  background: var(--row-highlight);
}

.settings-table tr.all-row td {
  background: var(--row-subtle);
}

.settings-table .label-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-table .delete-btn {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 1rem;
  margin: 0;
}

.settings-table .delete-btn:hover {
  color: #ff4444;
}

/* ========================================
   Neuer Suchstring
   ======================================== */

.add-subscription {
  display: flex;
  gap: 8px;
  margin-top: 1.5rem;
}

.add-subscription input {
  width: 40%;
  max-width: none;
}

.add-subscription button {
  margin-top: 0;
}

/* ========================================
   Status-Meldungen
   ======================================== */

.message {
  padding: 12px;
  border-radius: 4px;
  margin: 12px 0;
}

.message.success {
  background: white;
  color: #155724;
  border: 2px solid #155724;
}

.message.error {
  background: white;
  color: #721c24;
  border: 2px solid #721c24;
}

.message.info {
  background: white;
  color: #004085;
  border: 2px solid #004085;
}

/* ========================================
   Utilities
   ======================================== */

.hidden {
  display: none !important;
}

.loading {
  opacity: 0.7;
  font-style: italic;
}
