/* ── KKZ Wien Chatbot Widget ──────────────────────────────────────────────── */

#kkz-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toggle button */
#kkz-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #3dbdb0;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 13px 20px 13px 16px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(61, 189, 176, 0.45);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  letter-spacing: -0.01em;
}

#kkz-toggle:hover {
  background: #2ea89c;
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(61, 189, 176, 0.55);
}

#kkz-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Notification badge */
#kkz-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #f4821f;
  color: #fff;
  border-radius: 50%;
  width: 19px;
  height: 19px;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: kkzPulse 2.2s ease-in-out infinite;
  border: 2px solid #fff;
}

@keyframes kkzPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}

/* Chat window */
#kkz-window {
  position: absolute;
  bottom: 62px;
  right: 0;
  width: 360px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease;
  transform-origin: bottom right;
}

#kkz-window.kkz-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95) translateY(6px);
}

/* Header */
#kkz-header {
  background: linear-gradient(135deg, #3dbdb0 0%, #2ea89c 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.kkz-avatar {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}

.kkz-header-info { flex: 1; min-width: 0; }

#kkz-header-title {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#kkz-header-sub {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 1px;
}

#kkz-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.75;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
#kkz-close:hover { opacity: 1; }

/* Messages */
#kkz-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  max-height: 280px;
  scroll-behavior: smooth;
}

#kkz-messages::-webkit-scrollbar { width: 4px; }
#kkz-messages::-webkit-scrollbar-thumb { background: #dde8e6; border-radius: 4px; }

.kkz-msg {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  animation: kkzFadeIn 0.18s ease;
}

@keyframes kkzFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kkz-msg-bot {
  background: #f0f4f3;
  color: #1e2d2a;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.kkz-msg-user {
  background: #3dbdb0;
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* Loading dots */
.kkz-loading {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
}

.kkz-dot {
  width: 7px;
  height: 7px;
  background: #3dbdb0;
  border-radius: 50%;
  animation: kkzBounce 0.9s infinite ease-in-out;
}
.kkz-dot:nth-child(2) { animation-delay: 0.15s; }
.kkz-dot:nth-child(3) { animation-delay: 0.30s; }

@keyframes kkzBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-6px); }
}

/* Quick replies */
#kkz-quick-replies {
  padding: 6px 12px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.kkz-qr {
  background: #fff;
  color: #3dbdb0;
  border: 1.5px solid #3dbdb0;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.kkz-qr:hover {
  background: #3dbdb0;
  color: #fff;
}

/* Date picker grid */
.kkz-date-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  width: 100%;
}

.kkz-date-btn {
  background: #fff;
  color: #1e2d2a;
  border: 1.5px solid #dde8e6;
  border-radius: 10px;
  padding: 7px 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}
.kkz-date-btn:hover {
  border-color: #3dbdb0;
  background: #f0fbfa;
}
.kkz-day-label {
  display: block;
  font-size: 9.5px;
  color: #6b8c89;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Text input */
#kkz-input-area {
  display: flex;
  align-items: center;
  padding: 7px 10px 9px;
  border-top: 1px solid #edf1f0;
  gap: 6px;
  flex-shrink: 0;
}
#kkz-input-area.kkz-hidden { display: none; }

#kkz-input {
  flex: 1;
  border: 1.5px solid #dde8e6;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  background: #fff;
  font-family: inherit;
  color: #1e2d2a;
  transition: border-color 0.2s;
}
#kkz-input:focus { border-color: #3dbdb0; }
#kkz-input::placeholder { color: #a0b5b2; }

#kkz-send {
  background: #3dbdb0;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
#kkz-send:hover { background: #2ea89c; }
#kkz-send svg {
  width: 15px;
  height: 15px;
}

/* Mobile */
@media (max-width: 420px) {
  #kkz-chat {
    right: 12px;
    bottom: 16px;
  }
  #kkz-window {
    width: calc(100vw - 24px);
    right: 0;
    bottom: 58px;
  }
  #kkz-toggle span { display: none; }
  #kkz-toggle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
  }
  .kkz-date-grid { grid-template-columns: repeat(3, 1fr); }
}
