/* ===== THEME VARIABLES ===== */
:root,
[data-theme="dark"] {
  --bg: #0A0A0A;
  --bg-mid: #181818;
  --bg-surface: #252525;
  --text: #FFFFFF;
  --text-secondary: #E5E5E5;
  --muted: rgba(229, 229, 229, 0.5);
  --accent: #CEAF61;
  --accent-text: #000000;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(206, 175, 97, 0.2);
  --sticky-bg: rgba(10, 10, 10, 0.95);
  --card-hover: #1f1f1f;
  --input-focus-ring: rgba(206, 175, 97, 0.15);
  --logo-filter: none;
}

[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-mid: #F5F5F5;
  --bg-surface: #EBEBEB;
  --text: #1A1A1A;
  --text-secondary: #444444;
  --muted: rgba(0, 0, 0, 0.4);
  --accent: #1A1A1A;
  --accent-text: #FFFFFF;
  --border: rgba(0, 0, 0, 0.1);
  --border-accent: rgba(0, 0, 0, 0.15);
  --sticky-bg: rgba(255, 255, 255, 0.95);
  --card-hover: #E8E8E8;
  --input-focus-ring: rgba(0, 0, 0, 0.08);
  --logo-filter: brightness(0);
}

/* ===== BASE ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 140px;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== THEME UTILITY CLASSES ===== */
.theme-bg { background-color: var(--bg); }
.theme-text { color: var(--text); }
.theme-secondary { color: var(--text-secondary); }
.theme-muted { color: var(--muted); }
.theme-accent { color: var(--accent); }
.theme-sidebar-bg { background-color: var(--bg-mid); }
.theme-surface-bg { background-color: var(--bg-surface); }
.theme-sticky-bg { background-color: var(--sticky-bg); }
.theme-border-b { border-bottom: 1px solid var(--border); }
.theme-border-r { border-right: 1px solid var(--border); }
.theme-border-t { border-top: 1px solid var(--border); }
.theme-logo { filter: var(--logo-filter); }

.theme-input {
  background-color: var(--bg-surface);
  color: var(--text);
}
.theme-input::placeholder {
  color: var(--muted);
}
.theme-input-border {
  border-color: var(--border-accent);
}
.theme-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--input-focus-ring);
}

/* ===== SCROLLBAR HIDE ===== */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ===== SIDEBAR ===== */
.sidebar-btn {
  color: var(--text-secondary);
  border-left: 3px solid transparent;
}
.sidebar-btn:hover {
  background: var(--bg-surface);
}
.sidebar-btn.active {
  color: var(--accent);
  background: rgba(206, 175, 97, 0.08);
  border-left-color: var(--accent);
}
[data-theme="light"] .sidebar-btn.active {
  background: rgba(0, 0, 0, 0.06);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle-btn {
  color: var(--text-secondary);
}
.theme-toggle-btn:hover {
  background: var(--bg-surface);
}

/* Sun/Moon icon visibility */
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

/* ===== MOBILE TABS ===== */
.mobile-tab {
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.mobile-tab:hover {
  color: var(--text-secondary);
}
.mobile-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== LETTER NAV ===== */
.letter-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.letter-btn:hover {
  background: rgba(206, 175, 97, 0.1);
}
.letter-btn.active {
  background: rgba(206, 175, 97, 0.15);
}
[data-theme="light"] .letter-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .letter-btn.active {
  background: rgba(0, 0, 0, 0.1);
}

/* ===== ACCORDION ===== */
.accordion-item {
  background: var(--bg-mid);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: background 0.15s;
}
.accordion-item:hover {
  background: var(--card-hover);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  gap: 12px;
}

.accordion-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 8px;
}

.accordion-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.accordion-item.is-open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.accordion-item.is-open .accordion-body {
  opacity: 1;
}

.accordion-body-inner {
  padding: 0 16px 16px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

/* ===== SECTION HEADERS ===== */
.glossar-section {
  margin-bottom: 32px;
}

.glossar-section:last-child {
  margin-bottom: 64px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-top: 8px;
}

.section-letter {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border-accent);
}

/* ===== TOOL CARDS ===== */
.tool-card {
  background: var(--bg-mid);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid transparent;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.tool-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tool-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.tool-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.tool-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 16px;
  transition: background 0.15s;
  text-decoration: none;
  align-self: flex-start;
}

.tool-link:hover {
  background: rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .tool-link:hover {
  background: rgba(206, 175, 97, 0.08);
}

/* ===== BACK TO TOP ===== */
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== VIEW TRANSITIONS ===== */
.view-content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1023px) {
  html {
    scroll-padding-top: 200px;
  }

  #glossar-sticky {
    top: 45px;
  }

  #view-werkzeuge .sticky {
    top: 45px;
  }
}

@media (min-width: 1024px) {
  footer {
    margin-left: 240px;
  }
}
