/* Globaler SM-ING Dark Mode */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1420;
  --panel: rgba(18, 29, 44, 0.86);
  --panel-strong: rgba(15, 25, 39, 0.96);
  --text: #edf5ff;
  --muted: #a9bdd2;
  --line: rgba(179, 207, 238, 0.14);
  --line-strong: rgba(179, 207, 238, 0.24);
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.32);

  /* Variablen der Rezeptsammlung */
  --bg-2: #111c2a;
  --card: #152234;
  --border: #33475e;
  --accent: #72adff;
  --accent-2: #9ec5ff;
  --soft: #1c2d42;
  --danger: #ff8b83;
}

html[data-theme="dark"] body {
  background: #0b1420 !important;
  color: #edf5ff !important;
}

html[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at top right, rgba(41, 73, 111, 0.92), rgba(15, 27, 42, 0.95) 44%, rgba(9, 17, 28, 1) 100%),
    linear-gradient(180deg, #101c2b, #09111c) !important;
}

html[data-theme="dark"] body::after {
  background:
    linear-gradient(90deg, rgba(128, 177, 235, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(128, 177, 235, 0.035) 1px, transparent 1px) !important;
  background-size: 46px 46px !important;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .icon-link,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .contact-card {
  background: rgba(15, 25, 39, 0.95) !important;
  border-color: rgba(179, 207, 238, 0.14) !important;
  color: #edf5ff !important;
}

html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .dropdown-toggle,
html[data-theme="dark"] .hero-subtitle,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .small {
  color: #a9bdd2 !important;
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .dropdown-toggle:hover,
html[data-theme="dark"] .dropdown.is-open .dropdown-toggle,
html[data-theme="dark"] .dropdown-item:hover {
  background: rgba(114, 173, 255, 0.10) !important;
  color: #edf5ff !important;
}

html[data-theme="dark"] .nav-link.primary {
  background: #2f78cf !important;
  color: #fff !important;
}

html[data-theme="dark"] .banner::before {
  background:
    linear-gradient(90deg, rgba(9, 20, 32, 0.94) 0%, rgba(12, 26, 42, 0.80) 40%, rgba(12, 26, 42, 0.35) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.18)) !important;
}

html[data-theme="dark"] .eyebrow {
  background: rgba(15, 25, 39, 0.78) !important;
  border-color: rgba(114, 173, 255, 0.28) !important;
  color: #ff9b95 !important;
}

html[data-theme="dark"] .footer {
  color: #9fb5cc !important;
  border-color: rgba(179, 207, 238, 0.12) !important;
}

/* Formulare und Standard-Komponenten */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #101d2d !important;
  color: #edf5ff !important;
  border-color: #354b64 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #7f98b2 !important;
}

html[data-theme="dark"] option {
  background: #101d2d;
  color: #edf5ff;
}

/* Rezeptsammlung mit eigenständigen Inline-Styles */
html[data-theme="dark"] .container header,
html[data-theme="dark"] .container .card,
html[data-theme="dark"] .hero,
html[data-theme="dark"] .recipe,
html[data-theme="dark"] .day-card,
html[data-theme="dark"] .week-day,
html[data-theme="dark"] .step-card {
  background: #152234 !important;
  border-color: #33475e !important;
  color: #edf5ff !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] .badge,
html[data-theme="dark"] .step-ingredients,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .recipe-image,
html[data-theme="dark"] .preview {
  background: #1b2b3e !important;
  border-color: #3a5069 !important;
  color: #c9d9ea !important;
}

html[data-theme="dark"] .step-ingredients strong,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 {
  color: #f4f8fd !important;
}

html[data-theme="dark"] .btn-secondary {
  background: #1a2c42 !important;
  color: #bcd8ff !important;
  border-color: #3b5573 !important;
}

html[data-theme="dark"] .btn-ghost {
  background: #1c2d42 !important;
  color: #edf5ff !important;
  border-color: #3a5069 !important;
}

html[data-theme="dark"] .btn-danger {
  background: #351d24 !important;
  color: #ffaaa4 !important;
  border-color: #6c3941 !important;
}

html[data-theme="dark"] .meal-link,
html[data-theme="dark"] .recipe-link,
html[data-theme="dark"] a:not(.nav-link):not(.primary):not(.btn):not(.lm-btn) {
  color: inherit;
}

/* Inline-Karten im internen Bereich */
html[data-theme="dark"] .content-wrap [style*="background:rgba(255,255,255"],
html[data-theme="dark"] .content-wrap [style*="background: rgba(255,255,255"] {
  background: rgba(18, 29, 44, 0.95) !important;
  border-color: rgba(179, 207, 238, 0.14) !important;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] .content-wrap [style*="color:#111"],
html[data-theme="dark"] .content-wrap [style*="color: #111"] {
  color: #f4f8fd !important;
}

html[data-theme="dark"] .content-wrap [style*="color:rgba(20,20,20"],
html[data-theme="dark"] .content-wrap [style*="color: rgba(20,20,20"] {
  color: #a9bdd2 !important;
}

/* Theme-Schalter */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(16,74,140,.12));
  background: rgba(255,255,255,.66);
  color: var(--text, #0f2747);
  font: inherit;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}

.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle-icon { font-size: 1rem; line-height: 1; }

html[data-theme="dark"] .theme-toggle {
  background: rgba(21, 34, 52, .92);
  border-color: rgba(179, 207, 238, 0.17);
  color: #edf5ff;
}

.theme-toggle-floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 700px) {
  .theme-toggle-label { display: none; }
  .theme-toggle { width: 42px; padding: 8px; }
}
