/* /www/assets/css/chatbot.css — Digital Tech Nogent */

/* ── Bouton toggle ─────────────────────────────────────────────────────── */
#dtn-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Calibri', 'Segoe UI', sans-serif;
}

#dtn-chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f07020, #d45e10);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(240,112,32,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
#dtn-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(240,112,32,0.55);
}
#dtn-chat-toggle svg {
  width: 26px;
  height: 26px;
  color: white;
}

/* Badge notification */
.dtn-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #3a8ef5;
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* ── Boîte de chat ─────────────────────────────────────────────────────── */
#dtn-chat-box {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  max-height: 480px;
  background: #0d1f3c;
  border: 1px solid #1e3a6e;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dtn-slide-up 0.25s ease;
}

@keyframes dtn-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ────────────────────────────────────────────────────────────── */
#dtn-chat-header {
  background: linear-gradient(135deg, #0f2448, #0d1f3c);
  border-bottom: 2px solid #f07020;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dtn-chat-avatar {
  flex-shrink: 0;
}

.dtn-chat-title {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.dtn-chat-title strong {
  font-size: 13.5px;
  color: #ffffff;
  font-weight: 700;
}
.dtn-chat-title span {
  font-size: 11px;
  color: #3a8ef5;
}

#dtn-chat-close {
  background: none;
  border: none;
  color: #8899bb;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}
#dtn-chat-close:hover { color: #ffffff; }

/* ── Messages ──────────────────────────────────────────────────────────── */
#dtn-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #1e3a6e transparent;
}

.dtn-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.dtn-msg-user {
  background: #f07020;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

.dtn-msg-bot {
  background: #0f2448;
  color: #c8d8f0;
  align-self: flex-start;
  border: 1px solid #1e3a6e;
  border-bottom-left-radius: 3px;
}

/* Indicateur de frappe */
.dtn-typing {
  display: flex;
  gap: 5px;
  padding: 12px 14px;
  align-items: center;
}
.dtn-typing span {
  width: 7px;
  height: 7px;
  background: #3a8ef5;
  border-radius: 50%;
  animation: dtn-bounce 1.2s infinite ease-in-out;
}
.dtn-typing span:nth-child(2) { animation-delay: 0.2s; }
.dtn-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dtn-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%           { transform: scale(1.1); opacity: 1; }
}

/* ── Footer / Input ────────────────────────────────────────────────────── */
#dtn-chat-footer {
  padding: 10px 12px;
  border-top: 1px solid #1e3a6e;
  display: flex;
  gap: 8px;
  background: #091626;
}

#dtn-chat-input {
  flex: 1;
  background: #0f2448;
  border: 1px solid #1e3a6e;
  border-radius: 8px;
  color: #c8d8f0;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
}
#dtn-chat-input::placeholder { color: #4a6080; }
#dtn-chat-input:focus { border-color: #3a8ef5; }

#dtn-chat-send {
  width: 38px;
  height: 38px;
  background: #f07020;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
#dtn-chat-send:hover { background: #d45e10; transform: scale(1.05); }
#dtn-chat-send:disabled { background: #555; cursor: not-allowed; transform: none; }
#dtn-chat-send svg {
  width: 16px;
  height: 16px;
  color: white;
}

/* ── Responsive mobile ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #dtn-chat-box {
    width: calc(100vw - 32px);
    right: -8px;
    bottom: 68px;
  }
}
