/* ── Anonymous Live Chat – Frontend CSS ─────────────────────────────────── */

#alc-chat-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Toggle-Button Wrapper mit rundem Label */
#alc-toggle-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #1a73e8;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, background .2s;
  position: relative;
  margin-left: auto;
}
#alc-toggle-btn:hover { background: #1558b0; transform: scale(1.06); }

/* Rundes "Live Chat" Label um die Bubble */
#alc-toggle-btn::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2.5px dashed rgba(26,115,232,.45);
  animation: alc-spin 12s linear infinite;
  pointer-events: none;
}
#alc-toggle-btn::after {
  content: 'LIVE CHAT';
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: #e53935;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(229,57,53,.4);
}
@keyframes alc-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Badge */
#alc-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: #e53935;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chat-Box */
#alc-chat-box {
  width: 340px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 20px;
  transform: scale(.9) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform .2s, opacity .2s;
  transform-origin: bottom right;
}
#alc-chat-box.alc-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
#alc-chat-header {
  background: #1a73e8;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
}
#alc-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

/* Status-Dot */
#alc-offline-dot { font-size: 10px; margin-left: 4px; }
#alc-online-dot  { font-size: 10px; margin-left: 4px; }

/* Nachrichten */
#alc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.alc-msg {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  animation: alc-slide-in .15s ease;
}
@keyframes alc-slide-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alc-msg-user  { background: #1a73e8; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.alc-msg-admin { background: #f1f3f4; color: #202124; align-self: flex-start; border-bottom-left-radius: 4px; }
.alc-msg-time  { font-size: 11px; opacity: .6; margin-top: 3px; text-align: right; }

/* Links */
.alc-msg a { color: inherit; text-decoration: underline; word-break: break-all; }
.alc-msg-user a  { color: #fff; }
.alc-msg-admin a { color: #1a73e8; }

/* Bewertungs-Nachricht */
.alc-msg-rating { background: #f8f9fa; border: 1px solid #e8eaed; align-self: flex-start; border-bottom-left-radius: 4px; }
.alc-stars { display: flex; gap: 6px; margin-top: 8px; }
.alc-star {
  font-size: 24px;
  cursor: pointer;
  transition: transform .15s;
  color: #dadce0;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}
.alc-star:hover,
.alc-star.alc-star-hover { color: #f9a825; transform: scale(1.2); }
.alc-star.alc-star-selected { color: #f9a825; }
.alc-rating-thanks { margin-top: 6px; font-size: 13px; color: #5f6368; }

/* Input */
#alc-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e8eaed;
  background: #fafafa;
}
#alc-input {
  flex: 1;
  border: 1px solid #dadce0;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  resize: none;
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}
#alc-input:focus { border-color: #1a73e8; }
#alc-send-btn {
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s;
  white-space: nowrap;
}
#alc-send-btn:hover     { background: #1558b0; }
#alc-send-btn:disabled  { background: #9aa0a6; cursor: default; }

#alc-chat-status {
  font-size: 11px;
  color: #9aa0a6;
  padding: 0 12px 8px;
  min-height: 18px;
  text-align: center;
}

/* Offline-Banner */
#alc-offline-banner {
  background: #fff8e1;
  border-left: 3px solid #f9a825;
  margin: 10px 12px 0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #5f4400;
  line-height: 1.5;
}
#alc-offline-banner p { margin: 0; }

/* E-Mail-Feld */
#alc-email-field {
  border-bottom: 1px solid #e8eaed;
  padding-bottom: 10px;
  margin-bottom: 2px;
}
#alc-visitor-email:focus { border-color: #1a73e8; }

/* Mobile */
@media (max-width: 400px) {
  #alc-chat-box { width: calc(100vw - 48px); }
}

/* Bewertungs-Abschicken-Button */
.alc-rating-submit {
  margin-top: 10px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  display: block;
}
.alc-rating-submit:hover    { background: #1558b0; }
.alc-rating-submit:disabled { background: #9aa0a6; cursor: default; }
.alc-rating-text { margin-bottom: 6px; font-size: 13px; }

/* System-Nachrichten (Inaktivität, Warnung) */
.alc-msg-system {
  background: #fff8e1;
  color: #5f4400;
  border: 1px solid #ffe082;
  align-self: center;
  border-radius: 10px;
  font-size: 12px;
  text-align: center;
  max-width: 90%;
  padding: 8px 12px;
}
#alc-countdown { font-weight: 700; color: #e53935; }

/* Online/Offline Label im Chat-Header */
#alc-admin-status-dot {
  margin-left: 6px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.alc-status-label {
  font-size: 10px;
  font-weight: 400;
  opacity: .85;
  letter-spacing: .03em;
}
