/* === Hanse-Sound Chatbot – Widget CSS (bereinigt / updatefest) ===
   Hinweis: Farben/Optik werden über CSS-Variablen gesteuert.
   Dein Widget/JS kann diese Variablen per settings.json setzen (root.style.setProperty(...)).
*/

/* =========================
   1) Design-Variablen (Defaults)
   ========================= */
:root{
  --hs-primary:        #285677;
  --hs-primary-text:   #ffffff;

  --hs-window-bg:      #ffffff;
  --hs-window-border:  rgba(0,0,0,0.15);

  --hs-header-bg:      var(--hs-primary);
  --hs-header-color:   #ffffff;

  --hs-hint-bg:        var(--hs-primary);
  --hs-hint-color:     #ffffff;

  --hs-send-bg:        var(--hs-primary);
  --hs-send-color:     #ffffff;

  --hs-messages-bg:    #f7f7f7;

  --hs-font:           inherit;
}

/* =========================
   2) Container / Position
   ========================= */
   
   
#hs-chatbot{
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;

  /* wichtig: kein flex, kein grid */
  display: block;
  width: auto;
  height: auto;
}

/* Position per Klasse: #hs-chatbot.hs-left / hs-right */
#hs-chatbot.hs-left{
  left: 20px;
  right: auto;
}
#hs-chatbot.hs-right{
  right: 20px;
  left: auto;
}


/* =========================
   3) Toggle Button
   ========================= */
#hs-chatbot .hs-chatbot-toggle{
 
 background: var(--hs-toggle-bg, var(--hs-primary));
color: var(--hs-toggle-color, var(--hs-primary-text));

  position: relative;
  z-index: 2;

  padding: 10px 18px;
  border-radius: 25px;
  cursor: pointer;

  font-size: 14px;
  font-weight: bold;
  text-align: center;

  box-shadow: 0 0 6px rgba(0,0,0,0.30);
  margin-bottom: 8px; /* Abstand zum Fenster */
  user-select: none;

}



/* Optional: Toggle ausblenden (per JS Klasse setzen) */
.hs-chatbot-toggle.is-hidden{
  opacity: 0;
  pointer-events: none;
}

/* =========================
   4) Chat-Fenster (Start: unsichtbar)
   ========================= */
.hs-chatbot-window{
  position: absolute;
  right: 0;
  bottom: 100px; /* sitzt über dem Button */

  display: flex;
  flex-direction: column;

  width: 320px;
  height: 420px;

  background: var(--hs-window-bg);
  border-radius: 10px;
  border: 1px solid var(--hs-window-border);

  box-shadow: 0 0 10px rgba(0,0,0,0.15);

  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;

  font-family: var(--hs-font);
}

/* Wenn Container links ist, Fenster auch links ausrichten */
#hs-chatbot.hs-left .hs-chatbot-window{
  left: 0;
  right: auto;
}

.hs-chatbot-window.hs-open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* =========================
   5) Header
   ========================= */
.hs-chatbot-header{
  background: var(--hs-header-bg);
  color: var(--hs-header-color);
  padding: 12px 46px 12px 12px;
  font-size: 18px;
  text-align: center;
  margin:0;
    border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* Close-Button */
.hs-chatbot-close{
  position: absolute;
  top: 6px;
  right: 10px;
  left: auto !important;
  z-index: 3;
  cursor: pointer;
}

.hs-chatbot-close:hover{ opacity: 0.6; }

/* =========================
   6) Avatar / Figure (optional)
   ========================= */
.hs-chatbot-figure{
  position: absolute;
  top: 25px;
  right: 10px;         /* Platz lassen fürs X */
  width: 80px;         /* nur Breite festlegen */
  height: auto !important; /* KEINE feste Höhe -> nicht verzerren */
  max-height: none;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}
.hs-chatbot-figure img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Figure ausblenden (per JS Klasse setzen) */
.hs-chatbot-window.hs-nofigure .hs-chatbot-figure{ display:none; }

/* =========================
   7) Nachrichtenbereich
   ========================= */
.hs-chatbot-messages{
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-size: 13px;

  background: var(--hs-messages-bg);
}

/* Optional: Background-Image aktivieren (per Klasse) */
.hs-chatbot-window.hs-bgimg .hs-chatbot-messages{
  background-image: url(./assets/background.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

/* =========================
   8) Nachrichtenblasen
   ========================= */
.hs-msg{ margin-bottom: 8px; }

.hs-msg .hs-msg-bubble{
  display: inline-block;
  padding: 8px 10px;
  border-radius: 10px;
  max-width: 85%;
  line-height: 1.35;
}

.hs-msg-user{ text-align: right; }
.hs-msg-user .hs-msg-bubble{
  background: var(--hs-primary);
  color: var(--hs-primary-text);
}

.hs-msg-bot{ text-align: left; }
.hs-msg-bot .hs-msg-bubble{
  background: #fff;
  color: #111111;
}

/* Links in Bot-Bubbles */
.hs-msg-bot .hs-msg-bubble a{
  color: var(--hs-primary);
  text-decoration: underline;
}

/* =========================
   9) Hint-Bereich
   ========================= */
.hs-chatbot-hint{
  font-size: 12px;
  user-select: none;
  line-height: 1.3;

  padding: 10px;
  text-align: center;

  background: var(--hs-hint-bg);
  color: var(--hs-hint-color);  

  xxmargin-top: 10px;
  padding: 10px 12px;
   border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  line-height: 1.3;
}

}

/* =========================
   10) Eingabebereich
   ========================= */
.hs-chatbot-input{
  display: flex;
  border-top: 1px solid rgba(0,0,0,0.15);
}

.hs-chatbot-input input{
  flex: 1;
  border: none;
  padding: 10px;
  outline: none;
  font-size: 14px;
  color: #000;
  background: #fff;
}

.hs-chatbot-input button{
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 15px;

  background: var(--hs-send-bg);
  color: var(--hs-send-color);
}
.hs-chatbot-input button:hover{ filter: brightness(0.95); }

.hs-chatbot-input-row{
  display: flex;
  gap: 10px;
  align-items: stretch; /* gleiche Höhe */
}

.hs-chatbot-input-row input{
  flex: 1;
  height: 40px;
  box-sizing: border-box;
}

.hs-chatbot-input-row button{
  height: 40px;
  box-sizing: border-box;
  white-space: nowrap;
  padding: 0 14px;
}



/* =========================
   11) Legacy / Fremd-Button (falls noch irgendwo verwendet)
   ========================= */
#chatButton{
  background: var(--hs-primary);
  color: var(--hs-primary-text);
  border: none;
}

/* =========================
   12) Mobile
   ========================= */
@media (max-width: 420px){
  .hs-chatbot-window{
    width: 92vw;
    height: 70vh;
  }
}

/* Placeholder im Eingabefeld sichtbar machen */
.hs-chatbot-input input::placeholder {
  color: rgba(0, 0, 0, 0.5);
  opacity: 1;
}
/* Default: nur Farbe */
.hs-chatbot-messages{
  background-color: var(--hs-messages-bg);
  background-image: none;   /* wichtig: nix fest verdrahtet */
}

/* Wenn Background-Image aktiv: aus settings.json nehmen */
.hs-chatbot-window.hs-bgimg .hs-chatbot-messages{
  background-image: var(--hs-bgimg-url);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}
/* Position über Container-Klasse steuern (left/right) */
#hs-chatbot.hs-chatbot-container{
  position: fixed;
  bottom: 20px;
  z-index: 9999;
}

#hs-chatbot.hs-position-right{
  right: 20px;
  left: auto;
}

#hs-chatbot.hs-position-left{
  left: 20px;
  right: auto;
}

/* Wichtig: Fenster/Button dürfen nicht selbst "fixed right" festnageln */

#hs-chatbot .hs-chatbot-toggle{
  position: absolute;
  bottom: 0;
  margin: 10px; /* Abstand zum Rand */
}
/* Wenn Chat rechts steht → Button rechts */
#hs-chatbot.hs-position-right .hs-chatbot-toggle{
  right: 0;
  left: auto;
}

/* Wenn Chat links steht → Button links */
#hs-chatbot.hs-position-left .hs-chatbot-toggle{
  left: 0;
  right: auto;
}
#hs-chatbot .hs-chatbot-window{
  position: relative;
}








