/* ============================================================
   tips-tricks.be — TipsBot widget styling
   ============================================================ */

.tt-chat-container {
  --tt-red: #dc2626;
  --tt-red-2: #ef4444;
  --tt-bg: rgba(20, 20, 20, 0.97);
  --tt-bg-2: #242424;
  --tt-border: #333;
  --tt-text: #f3f3f3;
  --tt-dim: #a1a1a1;
  --tt-gradient: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  --tt-radius: 20px;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.5;
}

/* ---- Open-knop (chatballon) ---- */
.tt-chat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--tt-gradient);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
  font-family: inherit;
  position: relative;
}
.tt-chat-btn:hover { transform: translateY(-2px); }
.tt-chat-btn .tt-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.tt-chat-btn .tt-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tt-chat-btn .tt-open-label {
  padding-right: 18px;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}
.tt-chat-btn .tt-notification {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff4d6d;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--tt-bg);
}
.tt-chat-btn .tt-notification.show { display: flex; }

/* ---- Chat-venster (popup) ---- */
.tt-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  transform: translateY(0);
  will-change: transform;
  pointer-events: none;
}
.tt-chat-card {
  height: 100%;
  background: var(--tt-bg);
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.tt-chat-window.open .tt-chat-card {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* ---- Header ---- */
.tt-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--tt-gradient);
  color: #fff;
}
.tt-chat-header .tt-avatar-sm {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}
.tt-chat-header .tt-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tt-chat-header .tt-title {
  flex: 1;
  min-width: 0;
}
.tt-chat-header .tt-title strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}
.tt-chat-header .tt-title strong span {
  font-weight: 400;
}
.tt-chat-header .tt-status {
  font-size: 12px;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tt-chat-header .tt-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2dd4a7;
  display: inline-block;
}
.tt-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.tt-close-btn:hover { opacity: 1; }

/* ---- Berichten-venster ---- */
.tt-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--tt-bg);
}
.tt-chat-body::-webkit-scrollbar { width: 6px; }
.tt-chat-body::-webkit-scrollbar-thumb {
  background: var(--tt-border);
  border-radius: 3px;
}

.tt-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.tt-msg.bot {
  align-self: flex-start;
  background: var(--tt-bg-2);
  border: 1px solid var(--tt-border);
  color: var(--tt-text);
  border-bottom-left-radius: 4px;
}
.tt-msg.user {
  align-self: flex-end;
  background: var(--tt-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.tt-msg.error {
  align-self: flex-start;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}
.tt-msg a {
  color: #fca5a5;
  text-decoration: underline;
  word-break: break-all;
}
.tt-msg a:hover { color: #fff; }

/* Quick-suggesties */
.tt-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 14px 0;
}
.tt-suggestion {
  background: var(--tt-bg-2);
  border: 1px solid var(--tt-border);
  color: var(--tt-text);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: inherit;
}
.tt-suggestion:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: var(--tt-red);
}

/* Typing indicator */
.tt-typing {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tt-typing span {
  width: 8px;
  height: 8px;
  background: var(--tt-dim);
  border-radius: 50%;
  animation: tt-bounce 1.2s infinite ease-in-out;
}
.tt-typing span:nth-child(2) { animation-delay: 0.15s; }
.tt-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tt-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---- Invoer-gebied ---- */
.tt-chat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--tt-border);
  background: var(--tt-bg);
}
.tt-chat-footer input {
  flex: 1;
  background: var(--tt-bg-2);
  border: 1px solid var(--tt-border);
  color: var(--tt-text);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.tt-chat-footer input:focus { border-color: var(--tt-red); }
.tt-chat-footer input::placeholder { color: var(--tt-dim); }
.tt-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--tt-gradient);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  font-family: inherit;
}
.tt-send-btn:hover { transform: scale(1.08); }
.tt-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tt-disclaimer {
  padding: 0 12px 8px;
  font-size: 11px;
  color: var(--tt-dim);
  text-align: center;
  background: var(--tt-bg);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .tt-chat-window {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    bottom: 84px;
    height: min(70svh, 480px);
  }
  .tt-chat-btn .tt-open-label { display: none; }
  .tt-chat-btn .tt-avatar { width: 48px; height: 48px; }
  .tt-chat-header { padding: 10px 12px; }
  .tt-chat-header .tt-avatar-sm { width: 38px; height: 38px; }
  .tt-chat-header .tt-title strong { font-size: 14px; }
  .tt-chat-header .tt-status { font-size: 11px; }
  .tt-msg { font-size: 13px; padding: 8px 12px; }
  .tt-suggestion { font-size: 11px; padding: 5px 10px; }
  .tt-chat-footer input { font-size: 13px; padding: 9px 14px; }
  .tt-send-btn { width: 38px; height: 38px; font-size: 16px; }
  .tt-disclaimer { font-size: 10px; }
}