/* ===========================
   ToolDingo – Shared Styles
   =========================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #d97706;
  --color-primary-dark: #b45309;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-success: #16a34a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.85rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  font-size: 1.1rem;
}

.header-logo span {
  color: var(--color-primary);
}

/* Header Nav – zentriert, Spalte 2 */
.header-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  justify-content: center;
}

.header-nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.header-nav a:hover,
.header-nav a.active {
  background: #fff7ed;
  color: var(--color-primary);
}

/* Lang-Switcher */
.lang-switcher {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.lang-switcher a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
}

.lang-switcher a:hover,
.lang-switcher a.active {
  background: #fff7ed;
  color: var(--color-primary);
}

/* Main layout – standalone pages ohne Sidebar */
main {
  max-width: 720px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

/* Main innerhalb page-layout Grid */
.page-content {
  padding-left: 0;
  padding-right: 0;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

/* Form */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

input[type="number"],
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.15s;
}

input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Radio group */
.radio-group {
  display: flex;
  gap: 1.5rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  cursor: pointer;
}

/* Button */
button {
  width: 100%;
  padding: 0.75rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.5rem;
}

button:hover {
  background: var(--color-primary-dark);
}

/* Result */
.result {
  display: none;
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  text-align: center;
}

.result.visible {
  display: block;
}

.result-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.result-label {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.result-category {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* SEO text */
.seo-text {
  margin-top: 2rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.seo-text h2 {
  font-size: 1.2rem;
  color: var(--color-text);
  margin: 1.5rem 0 0.5rem;
}

/* Page Layout: Content + Sidebar */
.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 2rem;
}

.page-content {
  min-width: 0;
  padding-top: 2.5rem;
}

.page-sidebar {
  display: none;
}

@media (min-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }

  .page-sidebar {
    display: block;
    padding-top: 2.5rem;
    position: sticky;
    top: 1.5rem;
  }
}

/* Ad Slots */
.ad-slot {
  width: 100%;
  min-height: 90px;
  margin: 1.5rem 0;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.ad-slot::before {
  content: 'Anzeige';
}

/* Wenn AdSense aktiv: Platzhalter-Styles entfernen */
.ad-slot:has(ins) {
  background: none;
  border: none;
  min-height: auto;
}
.ad-slot:has(ins)::before {
  display: none;
}

.ad-slot--footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Mobile Ad: sichtbar unter 900px */
.ad-slot--mobile {
  display: block;
}

/* Sidebar Ad: versteckt unter 900px */
.ad-slot--sidebar {
  display: none;
  min-height: 250px;
  width: 100%;
}

@media (min-width: 900px) {
  .ad-slot--mobile {
    display: none;
  }

  .ad-slot--sidebar {
    display: flex;
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
}

/* Cookie Banner */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e293b;
  color: #f8fafc;
  z-index: 9999;
  padding: 1rem 1.5rem;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#cookie-banner.cookie-banner--hidden {
  transform: translateY(100%);
  opacity: 0;
}

.cookie-banner__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-banner__text {
  flex: 1;
  font-size: 0.9rem;
  color: #cbd5e1;
  min-width: 200px;
}

.cookie-banner__link {
  color: #93c5fd;
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-banner__btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  width: auto;
  margin-top: 0;
}

.cookie-banner__btn--primary {
  background: var(--color-primary);
  color: white;
}

.cookie-banner__btn--primary:hover {
  background: var(--color-primary-dark);
}

.cookie-banner__btn--secondary {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #475569;
}

.cookie-banner__btn--secondary:hover {
  background: #334155;
  color: #f8fafc;
}

/* Homepage grid */
.rechner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.rechner-card {
  display: block;
  text-decoration: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rechner-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(217,119,6,0.15);
}

.rechner-card .icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.rechner-card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

/* ===========================
   Mega-Menu & Mobile Drawer
   =========================== */

.header-wrap { position: relative; }

/* Desktop mega-menu panel */
.mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  z-index: 999;
}
.mega-menu.open { display: block; }

.mega-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.mega-col {
  padding: 0 .85rem;
  border-right: 1px solid var(--color-border);
}
.mega-col:first-child { padding-left: 0; }
.mega-col:last-child { border-right: none; padding-right: 0; }

.mega-col-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-primary);
  margin-bottom: .6rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid #fde68a;
  white-space: nowrap;
}

.mega-col a {
  display: block;
  font-size: .8rem;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: .18rem 0;
  line-height: 1.4;
  transition: color .12s;
}
.mega-col a:hover { color: var(--color-primary); }

/* Hamburger button – override global button styles */
.hamburger {
  display: none !important;
  background: none !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  padding: .3rem .5rem !important;
  color: var(--color-text) !important;
  font-size: 1.2rem !important;
  line-height: 1 !important;
  width: auto !important;
  margin: 0 !important;
  transition: background .15s !important;
}
.hamburger:hover { background: #f1f5f9 !important; }

/* Header right (lang-switcher + hamburger) */
.header-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: flex-end;
}

/* Mobile drawer */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
}
.drawer-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(300px, 88vw);
  height: 100dvh;
  background: var(--color-surface);
  z-index: 1001;
  overflow-y: auto;
  transition: right .25s ease;
  padding: 1rem;
  border-left: 1px solid var(--color-border);
}
body.drawer-open .drawer-overlay { display: block; }
body.drawer-open .drawer-panel { right: 0; }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--color-border);
}
.drawer-title { font-weight: 700; font-size: 1rem; color: var(--color-primary); }
.drawer-close {
  background: none !important;
  border: none !important;
  font-size: 1.25rem !important;
  cursor: pointer !important;
  color: var(--color-text-muted) !important;
  width: auto !important;
  margin: 0 !important;
  padding: .2rem .4rem !important;
  border-radius: 4px !important;
}
.drawer-close:hover { background: #f1f5f9 !important; }

.drawer-section { border-bottom: 1px solid var(--color-border); }
.drawer-section summary {
  font-weight: 600;
  font-size: .88rem;
  padding: .7rem 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text);
}
.drawer-section summary::-webkit-details-marker { display: none; }
.drawer-section summary::after { content: "+"; color: var(--color-text-muted); font-weight: 400; }
.drawer-section[open] summary::after { content: "−"; }

.drawer-section-links {
  padding-bottom: .5rem;
}
.drawer-section-links a {
  display: block;
  font-size: .83rem;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: .25rem .5rem;
  border-radius: 4px;
}
.drawer-section-links a:hover { background: #fff7ed; color: var(--color-primary); }

.drawer-lang {
  display: flex;
  gap: .5rem;
  margin-top: 1.25rem;
}
.drawer-lang a {
  padding: .4rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: .85rem;
  font-weight: 500;
}
.drawer-lang a.active { border-color: var(--color-primary); color: var(--color-primary); }

/* Mobile breakpoint */
@media (max-width: 768px) {
  header { grid-template-columns: 1fr auto; }
  .header-nav { display: none !important; }
  .hamburger { display: flex !important; align-items: center !important; }
  .lang-switcher { display: none !important; }
}
