/* ========== Base layout ========== */
html,
body {
  font-family: 'Open Sans', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.8));
  color: #f5f5f5;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body {
  justify-content: space-between;
}

/* ========== Background effects ========== */
#background-lines,
#canvas-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

/* Scrolling stock-like background line */
#background-lines {
  background:
    radial-gradient(ellipse at center, rgba(0,255,128,0.05), transparent),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><polyline fill="none" stroke="%2325D366" stroke-opacity="0.85" stroke-width="2" points="0,500 100,450 200,460 300,420 400,430 500,400 600,420 700,390 800,400" /></svg>')
      repeat-x;
  background-size: contain;
  animation: scrollLines 10s linear infinite;
}

@keyframes scrollLines {
  0%   { background-position-x: 0; }
  100% { background-position-x: -800px; }
}

/* ========== Header & Footer ========== */
header {
  text-align: center;
  padding: 2em 1em 1em;
}

header h1 {
  margin-bottom: 0.2em;
}

header p {
  margin-top: 0;
  color: #ccc;
}

footer {
  width: 100%;
  text-align: center;
  padding: 1em;
  font-size: 0.9em;
  background: #0b1725;
  color: #ccc;
  margin-top: auto;
}

footer a {
  color: #25D3FF;
  text-decoration: none;
  margin: 0 0.5em;
  font-weight: bold;
}

/* ========== Cookie banner ========== */
#cookie-banner {
  position: fixed;
  bottom: 10px;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.85);
  color: #fff;
  text-align: center;
  padding: 1em;
  font-size: 0.85em;
  z-index: 9999;
}

#cookie-banner button {
  margin-left: 1em;
  background: #25D366;
  border: none;
  padding: 0.5em 1em;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
}

/* ========== Search box (top form) ========== */
.search-box {
  display: flex;
  justify-content: center;
  margin: 2em auto;
  padding: 0 1em;
}

.search-box input {
  flex: 1;
  max-width: 400px;
  padding: 0.75em 1em;
  border: none;
  border-radius: 8px 0 0 8px;
  font-size: 1em;
}

.search-box button {
  background: #25D366;
  border: none;
  color: white;
  padding: 0.75em 1.5em;
  border-radius: 0 8px 8px 0;
  font-size: 1em;
  cursor: pointer;
}

/* ========== Stats card on homepage ========== */
.stock-recommendation {
  margin: 2em auto;
  max-width: 600px;
  background: #1c2f38;
  border-radius: 10px;
  padding: 1.5em;
  box-shadow: 0 0 10px #00000044;
  text-align: center;
}

.stock-recommendation h2 {
  margin-top: 0;
  font-size: 1.4em;
  color: #25D366;
}

.stock-item {
  margin: 0.5em 0;
}

/* Generic CTA (not the main WhatsApp button) */
.cta-btn {
  margin-top: 1.5em;
  background: #25D366;
  color: white;
  padding: 0.75em 1.5em;
  border: none;
  font-size: 1em;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

/* ========== Modal base ========== */
.modal {
  z-index: 1000;
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #1a2e3e;
  padding: 1.4em 1.5em 1em;
  border-radius: 10px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 1.2em;
  cursor: pointer;
  color: #ccc;
}

/* ========== Modal with sticky footer (result modal) ========== */
.modal-content--with-footer {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  padding-bottom: 0;
}

/* Specific padding for result modal to control top spacing */
#resultModal .modal-content {
  padding-top: 0.9rem;   /* top inside the box */
  padding-bottom: 0;     /* footer has own padding */
}

/* Scrollable body area */
.modal-body {
  overflow: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

/* Sticky footer (CTA + countdown + safety) */
.modal-footer,
.cta-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  background: linear-gradient(
  180deg,
  #020617 0%,
  #000000 60%,
  #000000 100%
  );
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
}

/* ========== Result modal visual style ========== */
.pretty-modal {
  background: linear-gradient(180deg, #192a38 0%, #132330 100%);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
}

/* Live claim strip at top of result modal */
.claim-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px 0;       /* fixed gap under strip */
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(56,189,248,0.45);
  font-size: 0.8rem;
  color: #dbeafe;
}

.claim-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34,197,94,0.8);
  flex-shrink: 0;
}

.claim-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Result header block (title + subtitle + pills) */
.result-head {
  margin-top: 0;             /* no extra gap above header block */
}

/* Move only the title slightly upwards (safe negative margin) */
.result-head h2 {
  margin-top: -6px;          /* pull title closer to claim strip */
  margin-bottom: 4px;        /* small gap to subtitle */
  font-size: 1.00rem;
}

/* Subtitle under title */
.result-head .muted {
  color: #b7d3ea;
  margin-top: 0;
  margin-bottom: 8px;        /* consistent gap to pills */
}

/* Pills row (Signal / Momentum / Volatilität) */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.85rem;
  color: #e7f3ff;
}

.pill--bull {
  background: rgba(74,222,128,0.12);
  border-color: rgba(74,222,128,0.25);
}

/* Card sections (Kerndaten, How it works, Benefits) */
.card-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  text-align: left;
}

.sec-title {
  font-size: 1rem;
  margin: 0 0 8px 0;
  color: #e9f4ff;
}

.small-stock-label {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #9fb9d6;
}

/* Indicator grid (Kerndaten) */
.indicator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 12px;
}

.metric {
  background: rgba(23,45,60,0.9);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric .label {
  color: #cfe8ff;
  font-size: 0.95em;
  margin-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric .value {
  font-weight: 800;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}

/* Lists inside card sections */
.fineprint {
  color: #a9c9e6;
  margin-top: 10px;
  font-size: 0.9rem;
}

.card-section ol {
  margin: 6px 0 0 0;
  padding-left: 1.2em;
  text-align: left;
}

/* Scroll hint text */
.scroll-hint-text {
  text-align: center;
  font-size: 0.85rem;
  color: #8aaec9;
  opacity: 0.8;
  margin: 8px 0;
}

/* Safety badge at bottom of modal */
.safety-badge {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #8aaec9;
  text-align: center;
  opacity: 0.9;
}

/* ========== Countdown block ========== */
.popup-countdown {
  margin: 8px 0 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.4);
}

.popup-countdown-top {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
}

.popup-countdown-label {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #d1e0f0;
  text-align: center;
}

.popup-countdown-time {
  font-weight: 700;
  padding: 0 3px;
  color: #f97373;
}

/* Countdown bar */
.popup-countdown-bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(51,65,85,0.8);
}

.popup-countdown-bar-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #f97316);
  transition: width 1s linear;
}

/* ========== WhatsApp CTA button (no glow, shake) ========== */
.cta-btn.cta-pretty {
  display: block;
  width: 90%;
  margin: 0 auto;
  text-align: center;
  padding: 14px 18px;
  font-weight: 800;
  font-size: 1.05rem;
  border-radius: 12px;
  background: linear-gradient(90deg, #1f9f55 0%, #25d366 40%, #128c4a 100%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 6px 16px rgba(0,0,0,0.45);
  transition:
    transform 0.08s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.cta-btn.cta-pretty:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.55);
  filter: brightness(1.03);
}

.cta-btn.cta-pretty:active {
  transform: translateY(0);
}

/* Shake animation (two short shakes) */
@keyframes waShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-3px); }
  50%  { transform: translateX(3px); }
  75%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.wa-shake {
  animation: waShake 0.18s ease-in-out 2;
}

/* ========== Popup overall animation ========== */
.trust-popup {
  animation: popupFade 0.35s ease;
}

@keyframes popupFade {
  0%   { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1);    opacity: 1; }
}

/* ========== Responsive tweaks (mobile) ========== */
@media (max-width: 480px) {
  .modal {
    padding: 6px;
  }

  .modal-content {
    width: 90%;
    max-width: 360px;
    border-radius: 12px;
  }

  .modal-content--with-footer {
    max-height: 78dvh;
    padding-bottom: 0;
  }

  .modal-body {
    padding: 10px 12px;
  }

  .sec-title {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .card-section {
    padding: 10px;
    border-radius: 10px;
    margin-top: 10px;
  }

  .indicator-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 6px;
  }

  .metric {
    min-height: 38px;
    padding: 8px 10px;
  }

  .cta-footer {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
  }

  .cta-btn.cta-pretty {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .pill-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pill {
    flex: 0 0 auto;
  }
}

.section-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.stock-code-label {
  font-size: 0.85rem;
  color: #25d366;
  white-space: nowrap;
}

/* =========================================================
   NODE TRACE – STREAM progress + rolling log (CLEAN FINAL)
   ========================================================= */
.trace-modal {
  position: relative;
  width: min(860px, 92vw);
  padding: 22px;
  border-radius: 16px;
  background: rgba(10, 14, 20, 0.96);
  border: 1px solid rgba(0, 255, 255, 0.18);
  box-shadow:
    0 0 0 1px rgba(0, 255, 255, 0.06),
    0 30px 80px rgba(0, 0, 0, 0.6);
}

.trace-top {
  position: relative;
  padding-right: 56px;
}

.trace-kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0, 255, 255, 0.7);
  margin-bottom: 6px;
}

.trace-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: #eaf6ff;
}

.trace-accent {
  color: rgba(0, 255, 255, 0.95);
}

.trace-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.15);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}

.trace-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.trace-stream {
  margin-top: 16px;
}

.trace-stream-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}

.trace-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(0, 255, 255, 0.1);
}

.trace-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: rgba(0, 255, 255, 0.75);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.35);
  transition: width 0.08s linear;
}

.trace-log {
  margin-top: 14px;
  padding-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  color: rgba(220, 245, 255, 0.9);
}

.trace-line {
  display: flex;
  gap: 8px;
  line-height: 1.6;
  white-space: nowrap;
}

.trace-time {
  color: rgba(255, 255, 255, 0.35);
}

.trace-tag {
  color: rgba(0, 255, 255, 0.85);
}

.trace-msg {
  color: rgba(220, 245, 255, 0.9);
}


/* Mobile-friendly secondary close button */
.modal-close-bottom {
  width: 90%;
  margin: 10px auto 0;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  color: #ccc;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-bottom:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

.modal-close-bottom:active {
  transform: scale(0.98);
}
