/* ========== PoE-Look Tweaks für Material-Theme ========== */

:root {
  --poe-gold: #c8aa6e;
  --poe-gold-dim: #876f47;
  --poe-bg-deep: #0d0d10;
  --poe-bg-card: #1a1a1f;
  --poe-bg-card-hover: #232328;
  --poe-border: #2c2c33;
  --poe-text-dim: #a0a0a8;
}

/* Akzentfarbe (Links, Kbd, Highlights) auf PoE-Gold biegen */
[data-md-color-scheme="slate"] {
  --md-accent-fg-color: var(--poe-gold);
  --md-accent-fg-color--transparent: rgba(200, 170, 110, 0.1);
  --md-typeset-a-color: var(--poe-gold);
}

[data-md-color-scheme="default"] {
  --md-accent-fg-color: var(--poe-gold-dim);
  --md-typeset-a-color: var(--poe-gold-dim);
}

/* ========== Hero-Section auf Landing ========== */

.poe-hero {
  background:
    radial-gradient(ellipse at top, rgba(200, 170, 110, 0.08), transparent 60%),
    linear-gradient(180deg, #161618 0%, #0d0d10 100%);
  border-bottom: 1px solid var(--poe-border);
  padding: 5rem 1rem 4rem;
  text-align: center;
}

.poe-hero__inner {
  max-width: 800px;
  margin: 0 auto;
}

.poe-hero__title {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  background: linear-gradient(180deg, var(--poe-gold) 0%, var(--poe-gold-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 24px rgba(200, 170, 110, 0.15);
}

.poe-hero__subtitle {
  color: var(--poe-text-dim);
  font-size: 1.15rem;
  margin: 0 0 2rem;
}

.poe-hero__search {
  display: flex;
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.poe-hero__search input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  background: var(--poe-bg-card);
  border: 1px solid var(--poe-border);
  border-radius: 4px;
  color: #f0f0f0;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.poe-hero__search input:focus {
  border-color: var(--poe-gold);
  box-shadow: 0 0 0 3px rgba(200, 170, 110, 0.2);
}

.poe-hero__search input::placeholder {
  color: #6b6b73;
}

.poe-hero__search button {
  padding: 0.875rem 1.5rem;
  background: var(--poe-gold);
  color: #0d0d10;
  border: 0;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.poe-hero__search button:hover {
  background: #d4b87a;
}

.poe-hero__hint {
  margin-top: 1rem;
  color: var(--poe-text-dim);
  font-size: 0.875rem;
}

.poe-hero__hint kbd {
  background: var(--poe-bg-card);
  border: 1px solid var(--poe-border);
  border-radius: 3px;
  padding: 0.125rem 0.375rem;
  font-family: inherit;
  font-size: 0.85em;
}

/* ========== Use-Case-Cards auf Landing ========== */

.poe-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.poe-card {
  display: block;
  padding: 1.5rem;
  background: var(--poe-bg-card);
  border: 1px solid var(--poe-border);
  border-radius: 6px;
  transition: all 0.2s;
  text-decoration: none !important;
  color: inherit;
}

.poe-card:hover {
  background: var(--poe-bg-card-hover);
  border-color: var(--poe-gold);
  transform: translateY(-2px);
}

.poe-card__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.poe-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--poe-gold);
}

.poe-card__desc {
  font-size: 0.9rem;
  color: var(--poe-text-dim);
  line-height: 1.5;
  margin: 0;
}

/* ========== Quick-Stats Strip ========== */

.poe-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  padding: 1.5rem;
  background: var(--poe-bg-card);
  border: 1px solid var(--poe-border);
  border-radius: 6px;
  margin: 2rem 0;
  text-align: center;
}

.poe-stat__num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--poe-gold);
  line-height: 1;
}

.poe-stat__label {
  font-size: 0.85rem;
  color: var(--poe-text-dim);
  margin-top: 0.25rem;
}

/* ========== Tabellen lesbarer ========== */

.md-typeset table:not([class]) {
  font-size: 0.85rem;
}

.md-typeset table:not([class]) th {
  background: var(--poe-bg-card);
  color: var(--poe-gold);
  font-weight: 600;
}

/* ========== Light-Mode Anpassungen ========== */

[data-md-color-scheme="default"] .poe-hero {
  background:
    radial-gradient(ellipse at top, rgba(135, 111, 71, 0.08), transparent 60%),
    linear-gradient(180deg, #f5f5f0 0%, #ffffff 100%);
}

[data-md-color-scheme="default"] .poe-hero__title {
  background: linear-gradient(180deg, #876f47 0%, #5a4a30 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

[data-md-color-scheme="default"] .poe-card,
[data-md-color-scheme="default"] .poe-stats {
  background: #fafaf7;
  border-color: #e0ddd3;
}

[data-md-color-scheme="default"] .poe-card:hover {
  background: #f5f3ed;
}

[data-md-color-scheme="default"] .poe-card__title,
[data-md-color-scheme="default"] .poe-stat__num {
  color: var(--poe-gold-dim);
}

/* ========== Q&A Progress-Bar + Steps ========== */

.poe-qa__progress {
  margin-bottom: 1rem;
}

.poe-qa-bar {
  height: 6px;
  background: var(--poe-bg-card);
  border: 1px solid var(--poe-border);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.poe-qa-bar__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--poe-gold-dim), var(--poe-gold));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.poe-qa-bar__fill--shimmer {
  background: linear-gradient(
    90deg,
    var(--poe-gold-dim) 0%,
    var(--poe-gold) 50%,
    var(--poe-gold-dim) 100%);
  background-size: 200% 100%;
  animation: poe-bar-shimmer 1.4s linear infinite;
}

.poe-qa-bar__fill--done {
  background: linear-gradient(90deg, #6cbe6c 0%, #8eda8e 100%);
  animation: none;
}

@keyframes poe-bar-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.poe-qa-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.poe-qa-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.25rem;
  background: var(--poe-bg-card);
  border: 1px solid var(--poe-border);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--poe-text-dim);
  text-align: center;
  transition: all 0.3s;
  opacity: 0.55;
}

.poe-qa-step.is-active {
  opacity: 1;
  border-color: var(--poe-gold);
  background: rgba(200, 170, 110, 0.08);
  color: #f0e8d8;
  box-shadow: 0 0 0 2px rgba(200, 170, 110, 0.15);
  animation: poe-step-pulse 1.5s ease-in-out infinite;
}

.poe-qa-step.is-done {
  opacity: 0.85;
  border-color: rgba(108, 190, 108, 0.4);
  color: #aaccaa;
}

.poe-qa-step__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.poe-qa-step__label {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@keyframes poe-step-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(200, 170, 110, 0.15); }
  50% { box-shadow: 0 0 0 4px rgba(200, 170, 110, 0.3); }
}

@media (max-width: 600px) {
  .poe-qa-steps { gap: 0.25rem; }
  .poe-qa-step { padding: 0.3rem 0.15rem; }
  .poe-qa-step__label { font-size: 0.65rem; }
}

/* Light-Mode */
[data-md-color-scheme="default"] .poe-qa-bar { background: #ece9e0; }
[data-md-color-scheme="default"] .poe-qa-step {
  background: #fafaf7;
  border-color: #e0ddd3;
}
[data-md-color-scheme="default"] .poe-qa-step.is-active {
  background: rgba(135, 111, 71, 0.08);
  color: #5a4a30;
}
[data-md-color-scheme="default"] .poe-qa-step.is-done {
  color: #4a8a4a;
}

/* ========== Q&A Loading-States ========== */

.poe-hero__search button.poe-qa__btn--loading {
  background: linear-gradient(90deg, var(--poe-gold) 0%, var(--poe-gold-dim) 50%, var(--poe-gold) 100%);
  background-size: 200% 100%;
  animation: poe-btn-shimmer 1.2s ease-in-out infinite;
}
.poe-hero__search button.poe-qa__btn--loading::before {
  content: '⏳ ';
}
@keyframes poe-btn-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.poe-qa__pulse {
  display: inline-block;
  color: var(--poe-gold);
  font-size: 1.5rem;
  animation: poe-pulse 1s ease-in-out infinite;
}
@keyframes poe-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ========== Q&A Result-Panel ========== */

.poe-qa {
  background: linear-gradient(180deg, #0d0d10 0%, #161618 100%);
  padding: 0 1rem 3rem;
  border-bottom: 1px solid var(--poe-border);
}

.poe-qa__inner {
  max-width: 800px;
  margin: 0 auto;
}

.poe-qa__status {
  font-size: 0.875rem;
  color: var(--poe-text-dim);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--poe-gold);
  background: rgba(200, 170, 110, 0.05);
  border-radius: 0 4px 4px 0;
  font-family: 'JetBrains Mono', monospace;
}
.poe-qa__status--progress { border-left-color: #4a90e2; color: #aac; }
.poe-qa__status--done { border-left-color: #6cbe6c; color: #aaccaa; }
.poe-qa__status--error { border-left-color: #d20000; color: #f88; background: rgba(210, 0, 0, 0.08); }
.poe-qa__status--cutoff { border-left-color: #d4a13c; color: #ddc080; }

.poe-qa__answer {
  background: var(--poe-bg-card);
  border: 1px solid var(--poe-border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #e8e8e0;
  min-height: 2rem;
  white-space: normal;
}

.poe-qa__answer strong { color: var(--poe-gold); }
.poe-qa__answer em { color: #ddc080; font-style: italic; }
.poe-qa__answer h3, .poe-qa__answer h4, .poe-qa__answer h5 {
  color: var(--poe-gold);
  margin: 1rem 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.poe-qa__answer h3:first-child, .poe-qa__answer h4:first-child { margin-top: 0; }
.poe-qa__answer p { margin: 0.5rem 0; }
.poe-qa__answer p:first-child { margin-top: 0; }
.poe-qa__answer ul, .poe-qa__answer ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}
.poe-qa__answer li { margin: 0.2rem 0; line-height: 1.5; }
.poe-qa__answer li::marker { color: var(--poe-gold); }
.poe-qa-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.92rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--poe-border);
  border-radius: 4px;
  overflow: hidden;
}
.poe-qa-table th {
  background: rgba(200,170,110,0.1);
  color: var(--poe-gold);
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid var(--poe-border);
}
.poe-qa-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.poe-qa-table tr:last-child td { border-bottom: 0; }
.poe-qa-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

[data-md-color-scheme="default"] .poe-qa-table {
  background: #fafaf7;
  border-color: #e0ddd3;
}
[data-md-color-scheme="default"] .poe-qa-table th {
  background: rgba(135,111,71,0.08);
  color: var(--poe-gold-dim);
}
.poe-qa__answer code {
  background: rgba(200, 170, 110, 0.1);
  color: #d4d4ff;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.92em;
}
.poe-qa__answer a {
  color: var(--poe-gold);
  text-decoration: underline;
  text-decoration-color: rgba(200, 170, 110, 0.4);
}
.poe-qa__answer a:hover { text-decoration-color: var(--poe-gold); }

.poe-qa__sources {
  margin-top: 1rem;
  font-size: 0.85rem;
}
.poe-qa-src__title {
  color: var(--poe-text-dim);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.poe-qa__sources ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.poe-qa__sources li {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--poe-border);
}
.poe-qa__sources li:last-child { border-bottom: 0; }
.poe-qa__sources a {
  color: var(--poe-gold);
  text-decoration: none;
}
.poe-qa__sources a:hover { color: #d4b87a; }
.poe-qa-src__sec {
  color: var(--poe-text-dim);
  font-size: 0.85em;
  font-weight: 400;
}
.poe-qa-src__rel {
  color: #6cbe6c;
  font-size: 0.78em;
  margin-left: 0.4rem;
  background: rgba(108, 190, 108, 0.1);
  padding: 0.05em 0.4em;
  border-radius: 3px;
}

/* Light-Mode */
[data-md-color-scheme="default"] .poe-qa {
  background: linear-gradient(180deg, #fafaf7 0%, #f5f5f0 100%);
}
[data-md-color-scheme="default"] .poe-qa__answer {
  background: #ffffff;
  color: #2a2520;
  border-color: #e0ddd3;
}
[data-md-color-scheme="default"] .poe-qa__answer strong,
[data-md-color-scheme="default"] .poe-qa__answer a,
[data-md-color-scheme="default"] .poe-qa__sources a {
  color: var(--poe-gold-dim);
}

/* ========== PoE-Tooltip-Renderer ========== */

.poe-tooltip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.poe-tooltip {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top, rgba(0, 0, 0, 0.4), transparent 70%),
    linear-gradient(180deg, #1a1612 0%, #0f0c08 100%);
  border: 1px solid #2a2520;
  border-radius: 4px;
  padding: 0.75rem 1rem 0.875rem;
  font-family: 'Fontin SmallCaps', 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.35;
  scroll-margin-top: 6rem;
  position: relative;
}

.poe-tooltip--corrupted {
  border-color: #5a1a1a;
}

.poe-tooltip__header {
  text-align: center;
  padding-bottom: 0.5rem;
}

.poe-tooltip__name {
  color: #af6025;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.poe-tooltip--corrupted .poe-tooltip__name {
  color: #d20000;
}

.poe-tooltip__base {
  color: #af6025;
  font-size: 0.95rem;
  margin-top: 0.125rem;
  opacity: 0.85;
}

.poe-tooltip__req {
  color: #7f7f7f;
  font-size: 0.78rem;
  margin-top: 0.25rem;
  font-style: normal;
}

.poe-tooltip__sep {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(175, 96, 37, 0.4) 30%,
    rgba(175, 96, 37, 0.6) 50%,
    rgba(175, 96, 37, 0.4) 70%,
    transparent 100%);
  margin: 0.5rem -0.5rem;
}

.poe-tooltip__mods {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin-top: 0.25rem;
}

.poe-mod {
  color: #8888ff;
  text-align: center;
  font-size: 0.875rem;
}

.poe-mod--explicit {
  color: #8888ff;
}

.poe-mod--skill {
  color: #71d5ff; /* hellerer cyan für Skill-Grants */
}

.poe-mod--enchant {
  color: #b4b4ff;
  font-weight: 600;
}

.poe-mod--meta {
  color: #aa9988;
  font-style: italic;
  font-size: 0.82rem;
}

.poe-num {
  color: #ffffff;
  font-weight: 600;
}

.poe-range {
  color: #d4d4ff;
  font-weight: 500;
}

.poe-tooltip__corrupted {
  text-align: center;
  color: #d20000;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Light-Mode-Anpassungen für Tooltips (PoE-Tooltips bleiben dark, das ist authentisch) */
[data-md-color-scheme="default"] .poe-tooltip {
  background:
    radial-gradient(ellipse at top, rgba(0, 0, 0, 0.5), transparent 70%),
    linear-gradient(180deg, #1a1612 0%, #0f0c08 100%);
  border-color: #2a2520;
}

/* ========== Mobile ========== */

@media (max-width: 600px) {
  .poe-hero__title {
    font-size: 2.5rem;
  }
  .poe-hero {
    padding: 3rem 1rem 2.5rem;
  }
  .poe-hero__search {
    flex-direction: column;
  }
  .poe-stats {
    gap: 1rem;
  }
}
