/* =========================================================
   FX Landschaftsbau — KI-Komponenten
   Chat-Widget (Lead-Bot) + Marketing-Tool
   Nutzt die Theme-Variablen aus style.css
   ========================================================= */

/* ---------- Floating Launcher ---------- */
.fx-bot-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 20px 14px 16px; border: none; cursor: pointer;
  border-radius: 100px; font-family: var(--font); font-weight: 600; font-size: 15px;
  color: #042a14; background: var(--grad);
  box-shadow: 0 14px 38px -10px var(--glow);
  transition: transform .3s var(--ease), box-shadow .3s, opacity .3s;
}
.fx-bot-launcher:hover { transform: translateY(-3px); box-shadow: 0 20px 50px -10px var(--glow); }
.fx-bot-launcher svg { width: 24px; height: 24px; }
.fx-bot-launcher .pulse {
  width: 9px; height: 9px; border-radius: 50%; background: #042a14; opacity: .55;
  animation: pulse 2s infinite;
}
.fx-bot-launcher.hidden { opacity: 0; pointer-events: none; transform: scale(.8); }

/* ---------- Chat-Fenster ---------- */
.fx-bot {
  position: fixed; right: 24px; bottom: 24px; z-index: 201;
  width: min(400px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
  opacity: 0; transform: translateY(20px) scale(.96); pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.fx-bot.open { opacity: 1; transform: none; pointer-events: auto; }

.fx-bot-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: linear-gradient(160deg, #0e2a18, #061a0f);
  border-bottom: 1px solid var(--line);
}
.fx-bot-head .ava {
  flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--line-2); color: var(--green);
}
.fx-bot-head .ava svg { width: 24px; height: 24px; }
.fx-bot-head .who { flex: 1; min-width: 0; }
.fx-bot-head .who b { font-family: var(--display); font-size: 1.02rem; display: block; }
.fx-bot-head .who span { font-size: 12px; color: var(--green); display: inline-flex; align-items: center; gap: 6px; }
.fx-bot-head .who span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.fx-bot-close {
  flex: none; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-2); color: var(--muted);
  display: grid; place-items: center; transition: background .3s, color .3s;
}
.fx-bot-close:hover { background: rgba(255,255,255,.08); color: var(--text); }

.fx-bot-body {
  flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.fx-msg { max-width: 85%; padding: 12px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.fx-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.fx-msg.user { align-self: flex-end; background: var(--grad); color: #042a14; border-bottom-right-radius: 5px; font-weight: 500; }
.fx-msg.bot a { color: var(--green); text-decoration: underline; }

.fx-typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 5px; }
.fx-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: fxblink 1.4s infinite both; }
.fx-typing span:nth-child(2) { animation-delay: .2s; }
.fx-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes fxblink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.fx-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 4px; }
.fx-chips button {
  font-family: var(--font); font-size: 12.5px; color: var(--text); cursor: pointer;
  padding: 8px 13px; border-radius: 100px; background: rgba(255,255,255,.03); border: 1px solid var(--line-2);
  transition: background .25s, border-color .25s;
}
.fx-chips button:hover { background: var(--grad-soft); border-color: var(--green); }

.fx-bot-foot { padding: 14px 16px; border-top: 1px solid var(--line); }
.fx-bot-form { display: flex; gap: 10px; align-items: flex-end; }
.fx-bot-form textarea {
  flex: 1; resize: none; max-height: 120px; min-height: 46px;
  background: var(--bg-solid); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 13px 15px; color: var(--text); font-family: inherit; font-size: 14.5px; line-height: 1.4;
  transition: border-color .3s, box-shadow .3s;
}
.fx-bot-form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(61,220,132,.12); }
.fx-bot-send {
  flex: none; width: 46px; height: 46px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--grad); color: #042a14; display: grid; place-items: center;
  transition: transform .25s var(--ease), opacity .25s;
}
.fx-bot-send:hover { transform: translateY(-2px); }
.fx-bot-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.fx-bot-send svg { width: 20px; height: 20px; }
.fx-bot-note { font-size: 10.5px; color: var(--faint); text-align: center; margin-top: 9px; }

/* ---------- Marketing-Tool-Seite ---------- */
.tool-main { padding-top: 120px; min-height: 100vh; }
.tool-wrap { width: min(100% - 48px, 1100px); margin-inline: auto; }
.tool-head { margin-bottom: 36px; }
.tool-head .eyebrow { margin-bottom: 14px; }
.tool-head h1 { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.02; }
.tool-head h1 .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.tool-head p { color: var(--muted); margin-top: 16px; max-width: 64ch; }

.tool-grid { display: grid; grid-template-columns: 380px 1fr; gap: 28px; align-items: start; }
.tool-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; }
.tool-panel h3 { font-family: var(--display); font-size: 1.15rem; margin-bottom: 20px; }
.tool-field { margin-bottom: 18px; }
.tool-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; letter-spacing: .02em; }
.tool-field input, .tool-field select, .tool-field textarea {
  width: 100%; background: var(--bg-solid); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 13px 15px; color: var(--text); font-family: inherit; font-size: 15px;
  transition: border-color .3s, box-shadow .3s;
}
.tool-field textarea { resize: vertical; min-height: 90px; }
.tool-field input:focus, .tool-field select:focus, .tool-field textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(61,220,132,.12);
}
.tool-panel .btn-primary { width: 100%; justify-content: center; margin-top: 6px; }

.tool-output { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; min-height: 420px; position: relative; display: flex; flex-direction: column; }
.tool-output-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.tool-output-head h3 { font-family: var(--display); font-size: 1.15rem; }
.tool-copy {
  font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text);
  padding: 9px 16px; border-radius: 100px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2);
  display: inline-flex; align-items: center; gap: 8px; transition: background .25s, border-color .25s, opacity .25s;
}
.tool-copy:hover { background: var(--grad-soft); border-color: var(--green); }
.tool-copy:disabled { opacity: .4; cursor: not-allowed; }
.tool-copy svg { width: 15px; height: 15px; }
.tool-result {
  flex: 1; white-space: pre-wrap; word-wrap: break-word; color: var(--text); font-size: 15px; line-height: 1.7;
}
.tool-result.placeholder { color: var(--faint); display: flex; align-items: center; justify-content: center; text-align: center; }
.tool-result h1, .tool-result h2, .tool-result h3 { font-family: var(--display); margin: 14px 0 8px; }
.tool-result strong { color: var(--text); }
.tool-alert { margin-top: 14px; font-size: 13px; color: #ffb4a0; }

.tool-back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 26px; transition: color .3s; }
.tool-back:hover { color: var(--green); }
.tool-back svg { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: 1fr; }
}
