:root {
  /* LIGHT MODE (Deine bisherigen Farben) */
  --primary: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.2);
  --primary-dark: #0f172a;
  --dark: #0f172a;
  --glass: rgba(244, 244, 244, 0.8);
  --glass-dropdown: rgba(255, 255, 255, 0.95);
  --card-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --danger: #ff6363;
  --bg: #fbfbfb;
  --card: #ffffff;
  --text: #64748b;
  --border: #f2f2f2;
}

[data-theme="dark"] {
  /* DARK MODE */
  --primary: #10b981; /* Das Grün bleibt als Akzent! */
  --primary-glow: rgba(16, 185, 129, 0.15);
  --primary-dark: #f8fafc;
  --dark: #f8fafc; /* Überschriften werden hell */
  --glass: rgba(30, 41, 59, 0.8);
  --glass-dropdown: rgba(30, 41, 59, 0.95);
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --bg: #0f172a; /* Tiefes Schiefergrau für den Hintergrund */
  --card: #1e293b; /* Etwas helleres Grau für die Karten */
  --text: #94a3b8; /* Gedämpftes helles Grau für Texte */
  --border: #334155; /* Dunkle Rahmen */
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  padding: 2rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

/* Header & Nav */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

/* LOGO */
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 12px;
}

.logo {
  height: 80px; /* Feste Höhe, Breite skaliert automatisch */
  width: auto;
}

.logo-login {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
}

/* Karten */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.05),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Dashboard spezifische Layout-Klassen */

.table-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.table-title {
  margin: 0;
  font-size: 1.5rem;
}

.table-h1 {
  padding-bottom: 10px;
}

/* Hilfsklasse für die Ausrichtung der Spalten */
.text-right {
  text-align: right;
}

/* Falls noch nicht drin: Status Badge Grundstyling */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

/* Content Tabelle  */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #64748b;
  padding: 1rem;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary);
  transform: translateY(-1px);
  color: white;
}

.btn-outline {
  color: var(--text);
  background: var(--card); /* FIX: Vorher 'white' */
  transform: translateY(-1px); /* Besser als translate: y(-1px) */
  border: 1px solid var(--border);
}
.btn-outline:hover {
  background: var(--bg);
}

/* Editor Layout */
.editor-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.input-group {
  margin-bottom: 1.5rem;
}
.input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
/* style.css | Vereinheitlichtes Modernes Formular-Styling */

/* 1. Grundstyling für alle Eingabefelder (Inputs, Selects, Textareas) */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.8rem 1rem; /* Großzügigeres Padding */
  border: 1px solid var(--border); /* Sauberer Rahmen */
  border-radius: 10px; /* Schön abgerundete Ecken */
  font-size: 1rem;
  color: var(--dark) !important;
  background-color: var(--card); /* Gleiche Hintergrundfarbe wie Karten */
  box-sizing: border-box; /* WICHTIG: Padding wird nicht auf die Breite addiert */
  transition: all 0.2s ease-in-out; /* Weiche Übergänge für Hover/Focus */
  font-family: inherit; /* Nutzt die Schriftart des Projekts */
}

/* 2. Hover-Zustand */
input[type="text"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
select:hover,
textarea:hover {
  border-color: #cbd5e1; /* Ein etwas dunkleres Grau beim Hover */
}

/* 3. Focus-Zustand (Das wichtigste moderne Feature!) */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none; /* Entfernt den hässlichen Standard-Blau-Rahmen der Browser */
  border-color: var(--primary); /* Emerald-Grüner Rahmen */
  /* Ein subtiler Emerald-Glow Effekt (Nutzt die --primary-glow Variable) */
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Platzhalter-Text etwas dezenter, aber lesbar */
::placeholder {
  color: var(--text);
  opacity: 0.7;
}

/* 4. Styling für die Labels (Überschriften der Felder) */
.input-group label,
label {
  display: block;
  font-weight: 700; /* Bolder Labels für klare Hierarchie */
  color: var(--dark);
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

/* style.css | Modernes Select Element (KI-Modell Auswahl) */
select {
  appearance: none; /* Versteckt den hässlichen Standard-Pfeil */
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Ein sauberer, grauer SVG-Pfeil (als Data-URI, kein Smiley/Emoji!) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 2.5rem; /* Platz für den Pfeil schaffen */
  cursor: pointer;
}

/* 5. Spezifische Textarea-Anpassungen */
textarea {
  resize: vertical; /* Erlaubt nur vertikale Größenänderung */
  line-height: 1.6;
}

.wysiwyg-preview {
  min-height: 400px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  background: #fff;
}

/* Editor Header Styling */
.editor-title {
  font-size: 1.2rem;
  margin: 0;
}

.highlight {
  color: var(--primary);
}

/* Sidebar & Buttons */
.sidebar h3 {
  margin-top: 0;
}

.sidebar h3,
.product-title {
  color: var(--dark) !important; /* Voller Kontrast für Überschriften */
}

.sidebar-info {
  font-size: 0.8rem;
  color: #64748b;
}

/* Hilfsklassen für Buttons */
.btn-full {
  width: 100%;
}

.mb-1 {
  margin-bottom: 1rem;
}

/* Spezielle Gefahr-Optik für den Verwerfen-Button */
.btn-danger-style {
  color: var(--danger) !important;
  border: 1px solid var(--danger) !important;
  background-color: transparent !important; /* Kein dunkler Glas-Hintergrund mehr */
}

.btn-danger-style:hover {
  background-color: rgba(
    255,
    99,
    99,
    0.1
  ) !important; /* Subtiles rotes Leuchten beim Hover */
}

/* Produkt Empfehlungen */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0;
}

ul.product-list {
  padding: 0 0 0 0;
}

.product-item {
  display: flex !important; /* Immer als Flexbox rendern */
  align-items: center;
  gap: 12px;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.product-item:last-child {
  border-bottom: none;
}

/* Das Thumbnail (Vorschaubild) */
.product-image {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg);
}

/* Container für Name und SKU */
.product-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-sku {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.main-header {
  position: sticky;
  top: 1rem;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--glass); /* FIX: Vorher festes Weiß */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); /* FIX: Vorher festes Weiß */
  border-radius: 100px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  margin-bottom: 3rem;
  transition: all 0.3s ease;
}

.main-header .logo {
  height: 40px;
  transition: transform 0.2s ease;
}

.main-header .logo-link:hover .logo {
  transform: scale(1.05); /* Leichter Zoom beim Hover */
}

.main-header .editor-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.header-nav {
  position: relative;
}

/* Modernisierter Burger-Button */
.burger-btn {
  padding: 0.5rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: var(--card); /* FIX: Vorher festes 'white' */
  border: 1px solid var(--border);
  border-radius: 50px;
  font-weight: 600;
  color: var(--dark); /* Text wird im Darkmode hell */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.burger-btn:hover {
  background: var(--bg);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

/* Modernes Dropdown Menü */

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 55px;
  background: var(--glass-dropdown); /* FIX: Vorher festes Weiß */
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  width: 220px;
  z-index: 100;
  overflow: hidden;
  padding: 0.5rem 0;
}

.dropdown-menu.hidden {
  display: none;
}

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

.dropdown-item {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  color: var(--text); /* FIX: Vorher festes Dunkelgrau */
  font-weight: 500;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--primary-glow);
  color: var(--primary-dark);
  padding-left: 24px; /* Cooler Einrück-Effekt beim Hovern */
}

.text-danger {
  color: var(--danger);
}

/* Sidebar Produkte */
.product-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* WICHTIG: Überschreibt Flexbox und blendet das Element aus */
.product-item.hidden {
  display: none !important;
}

.product-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

/* style.css | Force Visibility Fix */

/* Produkt Empfehlungen */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

ul.product-list {
  padding: 0 0 0 0;
}

.product-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.product-item:last-child {
  border-bottom: none;
}

/* WICHTIG: Überschreibt Flexbox und blendet das Element aus */
.product-item.hidden {
  display: none !important;
}

.product-title {
  font-weight: 500;
  font-size: 0.95rem;
}

.product-price {
  font-size: 0.8rem;
  color: var(--text);
}

.product-price,
.sidebar-info {
  color: var(--text); /* Etwas weicheres Grau für Details */
}

/* Sidebar Bildvorschau */
.post-image-preview {
  max-width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.post-image-preview:hover {
  transform: scale(1.02);
}

/* Modal fuer die Bild-Vollansicht */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
}

.image-modal.show {
  display: flex;
}

.image-modal-content {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #ccc;
}

/* Leseansicht (article.php) Alt-Klassen Fixes */

.blog-container {
  max-width: 800px;
  margin: 40px auto;
  background: var(--card); /* FIX: Vorher #fff */
  padding: 40px;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}

.blog-header-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: var(--card-shadow);
}

.blog-title {
  font-size: 2.5rem;
  color: var(--dark); /* FIX: Vorher #2c3e50 */
  margin-bottom: 20px;
}

.blog-meta {
  color: var(--text); /* FIX: Vorher #7f8c8d */
  font-size: 0.9rem;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

/* Ueberschreiben des Quill-Rahmens fuer die reine Leseansicht */
.blog-content.ql-editor {
  padding: 0;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text); /* FIX: Vorher #34495e */
}

.navigation-area {
  margin-bottom: 20px;
}

.header-image-wrapper {
  width: 100%;
  margin-bottom: 30px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 1rem; /* Leicht reduziert, da Padding dazu kommt */
  padding: 1rem;
}

.blog-card {
  background: var(--glass);
  backdrop-filter: blur(10px); /* Der Glassmorphism-Effekt */
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px; /* Rundere Ecken wirken moderner */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.card-image {
  height: 240px;
  width: 100%;
  object-fit: cover;
  border-bottom: 3px solid var(--primary); /* Farblicher Akzent */
}

.card-content {
  padding: 1.5rem;
  flex-grow: 1;
}

.card-date {
  font-size: 0.8rem;
  color: #95a5a6;
  display: block;
  margin-bottom: 10px;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0.5rem 0 1rem;
  color: var(--dark);
}

/* --- MODERN BLOG FEATURES --- */

/* 1. Hero Banner Styling */
.blog-hero {
  background: linear-gradient(135deg, var(--dark) 0%, #1e293b 100%);
  color: white;
  padding: 4rem 2rem;
  border-radius: 20px;
  text-align: center;
  margin-bottom: 3rem;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hero-content h1 {
  font-size: 2.5rem;
  margin: 1.5rem 0 1rem;
  letter-spacing: -0.025em;
}

.hero-content p {
  font-size: 1.1rem;
  color: #e7e7e7;
  max-width: 600px;
}

.badge {
  background: rgba(16, 185, 129, 0.824);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--glass);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* 2. Meta-Daten in den Karten (Datum & Lesezeit) */
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.card-date {
  margin: 0; /* Setzt alte Margins zurueck */
}

/* Button am unteren Rand der Karte fixieren */
.card-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Nimmt den restlichen Platz in der Karte ein */
}

.btn-read-more {
  margin-top: auto; /* Schiebt den Button magisch ganz nach unten */
  align-self: flex-start; /* Verhindert, dass der Button ueber die volle Breite geht */
}

.btn-read-more:hover {
  margin-top: auto; /* Schiebt den Button magisch ganz nach unten */
  align-self: flex-start; /* Verhindert, dass der Button ueber die volle Breite geht */
}

/* Settings Layout */
.settings-layout {
  max-width: 800px;
  margin: 20px auto 0;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.05),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.settings-description {
  margin-bottom: 20px;
  color: #666;
  line-height: 1.5;
}

/* Form-Elemente Spezifikationen */
.textarea-field.monospace {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
  /* Die feste Hintergrundfarbe wurde entfernt, damit sich das Feld dem Darkmode anpasst */
}

/* Benachrichtigungen */
.alert {
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.card-excerpt {
  color: var(--text); /* FIX: Vorher festes #475569 */
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Max 3 Zeilen */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Versteckt kaputte Bild-Icons, wenn die Quelle leer ist */
img[src=""] {
  display: none;
}

/* Verhindert den Umbruch im Tabellen-Header */
.table-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap; /* Erzwingt eine Zeile */
  gap: 15px; /* Abstand zwischen Text und Button */
}

.table-title {
  white-space: nowrap; /* Text darf nicht umbrechen */
  overflow: hidden; /* Versteckt alles, was uebersteht */
  text-overflow: ellipsis; /* Fuegt "..." am Ende ein */
  flex-shrink: 1; /* Der Titel darf schrumpfen, damit der Button Platz hat */
}

/* Der Button soll seine Groesse behalten */
#btn-refresh-trends {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Erzwingt Einzeiligkeit für die Themen in der Tabelle */
.table-topic-cell {
  max-width: 400px; /* Oder ein passender Wert für dein Layout */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Optional: Damit die Tabelle sich nicht unendlich dehnt */
table {
  table-layout: fixed;
  width: 100%;
}

th:nth-child(1),
td:nth-child(1) {
  width: 50%;
} /* Thema */
th:nth-child(2),
td:nth-child(2) {
  width: 10%;
} /* KI-Score */
th:nth-child(3),
td:nth-child(3) {
  width: 15%;
} /* Status */
th:nth-child(4),
td:nth-child(4) {
  width: 25%;
} /* Aktion */ /* Aktion */

/* --- SINGLE POST (article.php) --- */

.article-container {
  max-width: 850px; /* Schmalere Breite fuer optimale Lesbarkeit */
  margin: 2rem auto 5rem;
}

.back-btn {
  margin-bottom: 2rem;
  border-radius: 50px; /* Runder Button wirkt moderner */
  padding: 0.5rem 1.2rem;
}

/* Header Bereich */
.post-header {
  display: block;
  text-align: center;
  margin-bottom: 3rem;
}

.post-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.read-time-badge {
  background: transparent;
  border: 1px solid var(--border);
  color: #64748b;
}

.post-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--dark);
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

/* Meta-Daten (Autor & Datum) */
.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.meta-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.author-name {
  font-weight: 700;
  color: var(--dark);
  font-size: 1rem;
}

.publish-date {
  color: #64748b;
  font-size: 0.85rem;
}

/* Hero Image im Artikel */
.post-hero-image {
  margin: 0 0 3rem 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.post-hero-image img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 500px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-hero-image:hover img {
  transform: scale(1.02); /* Leichter Zoom-Effekt beim Hovern */
}

/* Content & Typografie (Überschreibt Quill Defaults) */
.post-content.ql-editor {
  padding: 0;
  font-family: inherit;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text); /* FIX: Vorher #334155 */
}

.post-content h2 {
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-footer {
  margin-top: 4rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

.post-footer hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin-bottom: 1.5rem;
}

/* --- HERO SLIDER (CSS Scroll Snap) --- */

.hero-slider-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1.5rem;
  padding-bottom: 1.5rem; /* Platz fuer die Scrollbar */
  margin-bottom: 3rem;
  -webkit-overflow-scrolling: touch; /* Weiches Wischen auf Handys */
  scroll-behavior: smooth;
}

/* Wir stylen die Scrollbar, damit Desktop-Nutzer sie sehen und nutzen koennen */
.hero-slider-container::-webkit-scrollbar {
  height: 8px;
}
.hero-slider-container::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 10px;
}
.hero-slider-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.slide-item {
  flex: 0 0 92%;
  scroll-snap-align: center;
  position: relative;
  border-radius: 24px;
  overflow: hidden; /* Wichtig, damit das Bild nicht aus den runden Ecken ragt */
  min-height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Text rutscht elegant nach unten */
  padding: 3rem;
}

/* Echtes Bild statt Inline-CSS */
.slide-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Dunkler Farbverlauf (von unten nach oben) fuer Lesbarkeit */
.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(15, 23, 42, 0.1) 100%
  );
  z-index: 2;
}

/* Content muss ueber Bild und Overlay liegen */
.hero-content {
  position: relative;
  z-index: 3;
  color: white;
  max-width: 750px;
}

.slide-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin: 1rem 0;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* Leichter Schatten fuer Kontrast */
}

.slide-text {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}

/* --- SLIDER WRAPPER & NAVIGATION --- */

.slider-wrapper {
  position: relative;
  margin-bottom: 3rem;
}

.hero-slider-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1.5rem;

  /* FIX: Großzügiges Padding, damit der Schatten nicht geclippt wird! */
  padding: 1rem 0.5rem 1rem 0.5rem; /* Oben 1rem, Rechts 0.5rem, Unten 3rem, Links 0.5rem */

  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  cursor: grab;
}

.hero-content {
  position: relative;
  z-index: 3;
  color: white;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  padding-left: 50px;
  align-items: flex-start; /* Zwingt alle Elemente (Badge, Titel, Button) strikt nach links */
}

.badge-wrapper {
  margin-bottom: 1.5rem;
}

/* Styling der Pfeil-Buttons */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--card); /* FIX: Passt sich jetzt sauber an Hell/Dunkel an */
  color: var(--dark); /* FIX: Ist jetzt immer im perfekten Kontrast */
  border: 1px solid var(--border); /* FIX: Feiner Rahmen für Kontur */
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-btn:hover {
  background: var(--bg);
  color: var(--primary); /* Pfeil wird beim Hovern Emerald-Grün */
  transform: translateY(-50%) scale(1.1);
}

.prev-btn {
  left: 1.5rem;
}

.next-btn {
  right: 1.5rem;
}

/* --- MOBILE OPTIMIERUNG (Zusammengefasst & Repariert) --- */

@media (max-width: 768px) {
  /* 1. Basis-Einstellungen */
  html {
    font-size: 15px;
  }

  body {
    padding: 0.5rem;
  }

  /* 2. Header kompakter */
  .main-header {
    top: 0;
    border-radius: 0 0 20px 20px;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
  }

  .logo-text {
    display: none;
  }

  /* 3. Slider komplett repariert */
  .slider-btn {
    display: none; /* Pfeile weg */
  }

  .hero-slider-container {
    padding: 1rem 0; /* Weniger Abstand an den Seiten auf Mobile */
  }

  .slide-item {
    flex: 0 0 92%;
    min-height: auto; /* Passt sich dem Inhalt an */
    padding: 2rem 1.5rem;
  }

  .hero-content {
    padding-left: 0; /* WICHTIG: Entfernt die 50px vom Desktop-Pfeil! */
    max-width: 100%;
  }

  .slide-title {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.75rem;
  }

  .slide-text {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Maximal 2 Zeilen */
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1rem;
    color: #e2e8f0;
    margin-bottom: 1.5rem;
    line-height: 1.4;
  }

  /* 4. Blog-Grid & Karten (Jetzt richtig in der Media-Query) */
  .blog-grid {
    grid-template-columns: 1fr; /* Einspaltig */
    gap: 1.5rem;
    padding: 0.5rem;
  }

  .card-image {
    height: 180px;
  }

  .card-title {
    font-size: 1.3rem;
  }

  /* 5. Artikel-Ansicht (article.php) */
  .article-container {
    margin-top: 1rem;
    padding: 0 0.5rem;
  }

  .post-title {
    font-size: 1.8rem;
    line-height: 1.2;
    text-align: left;
  }

  .post-hero-image {
    border-radius: 12px;
  }

  .post-content.ql-editor {
    font-size: 1.1rem;
  }

  .hero-content h1 {
    font-size: 2rem;
    margin: 1rem 0 1rem;
    letter-spacing: -0.025em;
  }
}

/* Spezifische Status-Farben */

.status-offen {
  background-color: #fef3c7; /* Leichtes Gelb/Orange */
  color: #b45309; /* Dunkler Text fuer Kontrast */
  border-color: #fde68a;
}

.status-published {
  background-color: #dcfce7; /* Leichtes Gruen */
  color: #15803d; /* Dunkelgruener Text */
  border-color: #bbf7d0;
}

/* Falls du spaeter noch "In Bearbeitung" oder aehnliches hinzufuegst: */
.status-draft {
  background-color: var(--bg);
  color: #475569;
  border-color: #cbd5e1;
}

.status-verworfen {
  background-color: var(--danger);
  color: var(--bg);
  border-color: #ffffff;
}

/* --- LOGIN SEITE --- */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 1rem;
}

.login-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
}

.text-center {
  text-align: center;
}

.justify-center {
  justify-content: center;
}

.alert-danger {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.mt-15 {
  margin-top: 1.5rem;
}

/* --- SHARE BUTTON STYLING --- */

.share-container {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}

#btn-share {
  border-radius: 50px;
  padding: 0.6rem 1.5rem;
  display: inline-flex;
  align-items: center;
  background: var(--card); /* FIX: Vorher festes Weiß */
  color: var(--text); /* Passt die Schriftfarbe an den Modus an */
  border: 1px solid var(--border); /* Gibt dem Button eine saubere Kontur */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

#btn-share:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary); /* Lässt den Text beim Hovern Emerald-Grün leuchten */
  transform: translateY(-2px);
}

/* --- STATISTICS GRID (USING DESIGN SYSTEM) --- */
.stats-grid {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 200px;
  background: var(--card);
  padding: 25px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Linksbündig für einen moderneren Look */
  border: 1px solid var(--border);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark);
}

/* Spezial-Style für die "Heute"-Kachel (Highlight mit deinem Primary) */
.highlight-card {
  background: var(--primary);
  border: none;
}

.highlight-card .stat-label {
  color: rgba(255, 255, 255, 0.9);
}

.highlight-card .stat-value {
  color: #ffffff;
}

/* Responsive Anpassung */
@media (max-width: 768px) {
  .stat-card {
    min-width: calc(50% - 10px);
  }
}

.related-products {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--border);
}
.section-title {
  color: var(--dark);
  margin-bottom: 25px;
  font-size: 1.5rem;
}

.products-grid-frontend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card-frontend {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.product-card-frontend:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow);
}
.product-img-wrapper {
  height: 180px;
  background: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
}
.product-img-wrapper img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.product-info {
  padding: 15px;
}
.product-sku {
  font-size: 0.7rem;
  color: var(--text);
  text-transform: uppercase;
}
.product-info h4 {
  font-size: 1rem;
  color: var(--dark);
  margin: 5px 0 15px 0;
  min-height: 2.4em;
}

.product-footer-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.price-tag {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.1rem;
}

/* --- UNIVERSAL BUTTON SPINNER --- */

/* Der Container im Button, der Text und Spinner hält */
.btn-content-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 100%;
}

/* Der Text-Teil (wird ausgeblendet beim Laden) */
.btn-text {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  opacity: 1;
}

/* Der Spinner-Teil (initial unsichtbar) */
.btn-spinner {
  position: absolute;
  opacity: 0;
  width: 18px; /* Etwas größer für bessere Sichtbarkeit */
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff !important; /* Immer Weißer Dreh-Teil */
  animation: spin 0.8s linear infinite;
  transition: opacity 0.2s ease;
  left: 50%;
  top: 50%;
  margin-left: -9px; /* Zentrierung */
  margin-top: -9px;
}

/* Animation definieren */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- LADE-ZUSTAND (wird per JS aktiviert) --- */
.btn.is-loading {
  position: relative;
  color: transparent !important; /* Versteckt den Text sicher, ohne Platz zu verlieren */
  pointer-events: none;
}

/* Text verstecken */
.btn.is-loading .btn-text {
  opacity: 0;
}

/* Spinner zeigen */
.btn.is-loading .btn-spinner {
  opacity: 1;
}

/* Spezialfall: Spinner-Farbe für btn-outline (da ist der Hintergrund weiss) */
.btn-outline.is-loading .btn-spinner {
  border: 2px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(
    --primary
  ) !important; /* Grüner Spinner auf weißem Grund */
}

/* --- MOBILE OPTIMIERUNG EDITOR & DASHBOARD --- */

/* Der Haupt-Container für das Layout */
.editor-layout {
  display: flex;
  flex-direction: column; /* Standard: Alles untereinander (Mobile First) */
  gap: 20px;
  margin-top: 20px;
}

/* Ab Desktop-Breite (992px) nebeneinander anzeigen */
@media (min-width: 992px) {
  .editor-layout {
    flex-direction: row; /* Nebeneinander */
    align-items: flex-start;
  }

  .main-content {
    flex: 2; /* Editor bekommt 2/3 des Platzes */
  }

  .sidebar {
    flex: 1; /* Sidebar bekommt 1/3 */
    position: sticky; /* Sidebar bleibt beim Scrollen oben */
    top: 20px;
  }
}

/* Spezifische Mobile-Fixes (Handy & Tablet) */
@media (max-width: 991px) {
  .container {
    padding: 10px;
  }

  .card {
    padding: 15px;
    margin-bottom: 15px;
  }

  /* Quill Editor Höhe reduzieren für bessere Übersicht auf dem Handy */
  #quill-editor {
    height: 250px !important;
  }

  /* Alle Buttons auf volle Breite für Daumen-Bedienung */
  .btn {
    width: 100% !important;
    display: block;
    margin-bottom: 10px;
  }

  /* Verhindert Zoom-In bei iPhone-Inputs */
  input[type="text"],
  textarea,
  .form-control {
    font-size: 16px !important;
  }

  /* Produktliste Bilder etwas vergrößern für Touch */
  .product-image {
    width: 60px;
    height: 60px;
  }
}

/* --- DASHBOARD MOBILE OPTIMIERUNG --- */

/* 1. Stats-Grid: Von 4 Spalten auf 2 oder 1 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 Spalten auf Tablet/Handy */
  gap: 15px;
  margin-bottom: 30px;
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr; /* 1 Spalte auf sehr kleinen Handys */
  }
}

/* 2. Responsive Tabelle */
@media (max-width: 768px) {
  /* Header der Tabelle verstecken */
  table thead {
    display: none;
  }

  table,
  table tbody,
  table tr,
  table td {
    display: block;
    width: 100%;
  }

  table tr {
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: var(--card); /* FIX: Vorher #fff */
  }

  table td {
    text-align: left !important;
    padding: 8px 5px;
    border: none;
  }

  /* "Thema" Zelle hervorheben */
  .table-topic-cell {
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border) !important; /* FIX: Vorher #eee */
    margin-bottom: 5px;
    width: 90% !important;
    white-space: normal;
  }

  /* Aktion-Button auf volle Breite */
  table td:last-child {
    margin-top: 10px;
  }

  .table-header-flex {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
}

/* 3. Pagination-Fix für Mobile */
@media (max-width: 480px) {
  .pagination-container {
    /* Falls du diese Klasse nutzt */
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

/* --- FIX: DASHBOARD TABELLEN LAYOUT --- */
table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 15px 10px;
  border-bottom: 1px solid var(--border); /* FIX: Vorher #e2e8f0 */
  vertical-align: middle;
}

/* Entfernt den Rahmen bei der allerletzten Zeile, damit es in der Card sauber aussieht */
table tr:last-child td {
  border-bottom: none;
}

/* Sichert ab, dass der Button rechts bleibt, aber nicht aus der Tabelle ausbricht */
td.text-right {
  text-align: right !important;
  float: none !important;
  display: table-cell !important;
}

.btn-edit {
  padding: 0.4rem 1rem;
  background-color: var(--text);
  color: var(--border);
}

.btn-edit:hover {
  padding: 0.4rem 1rem;
  background-color: var(--text);
  color: var(--border);
  transform: translateY(-1px);
}

/* Container für Schalter und Menü */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Der Schalter (Toggle Switch) */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  top: 5px;
}

/* Styling für das Darkmode-Icon */
.theme-icon {
  width: 20px;
  height: 20px;
  color: var(--text); /* Passt sich automatisch dem Darkmode an */
  transition: color 0.4s ease;
}

/* Versteckt die echte, hässliche Checkbox */
.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Der Hintergrund des Schalters */
.theme-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.4s;
  border-radius: 24px;
}

/* Der runde Punkt im Schalter */
.theme-switch .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Wenn Checkbox aktiv (Darkmode an) -> Hintergrund wird grün */
.theme-switch input:checked + .slider {
  background-color: var(--primary);
}

/* Wenn Checkbox aktiv -> Punkt rutscht nach rechts */
.theme-switch input:checked + .slider:before {
  transform: translateX(24px);
}

/* Fade-Effekt NUR beim aktiven Umschalten per Klick */
body.is-toggling,
body.is-toggling * {
  transition:
    background-color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease,
    color 0.4s ease !important;
}

/* --- QUILL EDITOR MODERN & DARKMODE FIXES --- */

/* 1. Toolbar (Obere Leiste) */
.ql-toolbar.ql-snow {
  border: 1px solid var(--border) !important;
  background-color: var(--card);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  padding: 10px !important;
  font-family: inherit;
}

/* 2. Container (Eingabebereich) */
.ql-container.ql-snow {
  border: 1px solid var(--border) !important;
  border-top: none !important; /* Verhindert eine doppelte Linie zur Toolbar */
  background-color: var(--card);
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* 3. Text im Editor */
.ql-editor {
  color: var(--dark);
  font-family: inherit;
  font-size: 1rem;
}

/* 4. Toolbar-Icons an den Darkmode anpassen (Normalzustand) */
.ql-snow .ql-stroke {
  stroke: var(--dark) !important;
}

.ql-snow .ql-fill,
.ql-snow .ql-stroke.ql-fill {
  fill: var(--dark) !important;
}

/* style.css | Quill Toolbar Text Fix */
.ql-snow .ql-picker {
  color: var(--dark) !important;
}

/* 5. Hover- & Aktiv-Zustand der Icons (Nutzt dein Emerald Grün) */
.ql-snow .ql-picker-item:hover,
.ql-snow .ql-picker-label:hover,
.ql-snow .ql-picker-label.ql-active,
.ql-snow .ql-picker-item.ql-selected,
.ql-snow button:hover .ql-stroke,
.ql-snow button.ql-active .ql-stroke,
.ql-snow button:hover .ql-fill,
.ql-snow button.ql-active .ql-fill {
  color: var(--primary) !important;
  stroke: var(--primary) !important;
  fill: var(--primary) !important;
}

.ql-snow .ql-picker-options {
  background-color: var(--card) !important;
  border-color: var(--border) !important;
}

.ql-editor p,
.ql-editor ol,
.ql-editor ul,
.ql-editor pre,
.ql-editor blockquote,
.ql-editor h1,
.ql-editor h2,
.ql-editor h3,
.ql-editor h4,
.ql-editor h5,
.ql-editor h6 {
  color: var(--text) !important;
}

/* --- QUILL DARKMODE TEXT FIXES --- */

/* Verhindert, dass der Editor-Hintergrund weiß bleibt */
.ql-container.ql-snow {
  background-color: var(--card) !important;
  border: 1px solid var(--border) !important;
}

/* Fix für den Platzhalter-Text (Placeholder) */
.ql-editor.ql-blank::before {
  color: var(--text) !important;
  font-style: italic;
  opacity: 0.6;
}

/* Fix für die normale Schriftfarbe beim Tippen */
.ql-editor {
  color: var(--dark) !important; /* Nutzt deine helle Darkmode-Textfarbe */
  background-color: transparent !important;
}

/* Entfernt die Linie zwischen Toolbar und Editor */
.ql-toolbar.ql-snow + .ql-container.ql-snow {
  border-top: none !important;
}

/* Falls die Linie von einem Fokus-Effekt kommt */
.ql-container.ql-snow:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Dropdown-Menüs in der Toolbar */
.ql-snow .ql-picker-options {
  background-color: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--dark) !important;
}

.ql-snow .ql-picker-item {
  color: var(--dark) !important;
}

.ql-snow .ql-picker-item:hover {
  color: var(--primary) !important;
}

/* Suchergebnisse Dropdown Items */
.search-result-item {
  padding: 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.search-result-item:hover {
  background-color: var(--bg);
}
