/**
 * ╔═══════════════════════════════════════════════════════════════╗
 * ║  DigiSchool Africa — CHATBOT SMART STYLES                     ║
 * ║  Version 3.0 — Cadré, professionnel, accessible              ║
 * ╚═══════════════════════════════════════════════════════════════╝
 */

/* ============================================
   BOUTON FLOTTANT
   ============================================ */
.ds-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.ds-chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(30, 136, 229, 0.6);
}

.ds-chat-toggle:active {
  transform: scale(0.95);
}

.ds-chat-toggle svg {
  width: 28px;
  height: 28px;
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 3px solid #1E88E5;
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* ============================================
   FENÊTRE CHATBOT
   ============================================ */
.ds-chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 150px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ds-chat-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ============================================
   HEADER
   ============================================ */
.ds-chat-header {
  background: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ds-chat-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.ds-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ds-chat-header-text {
  flex: 1;
}

.ds-chat-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 2px;
}

.ds-chat-status {
  font-size: 13px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ds-chat-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #26A69A;
  border-radius: 50%;
  display: inline-block;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ds-chat-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s;
  flex-shrink: 0;
}

.ds-chat-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   MESSAGES
   ============================================ */
.ds-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #F5F7FA;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ds-chat-welcome {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.ds-welcome-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.ds-chat-welcome h3 {
  font-size: 18px;
  font-weight: 700;
  color: #263238;
  margin-bottom: 8px;
}

.ds-chat-welcome p {
  font-size: 14px;
  color: #546E7A;
  line-height: 1.5;
  margin: 0;
}

/* ============================================
   MENU INTENTIONS
   ============================================ */
.ds-chat-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ds-intent-btn {
  background: white;
  border: 2px solid #E0E7EF;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #263238;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ds-intent-btn:hover {
  background: #F5F7FA;
  border-color: #1E88E5;
  transform: translateX(4px);
}

.ds-intent-btn:active {
  transform: translateX(2px);
}

/* ============================================
   MESSAGES BOT
   ============================================ */
.ds-message {
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.ds-bot-message .ds-message-content {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 14px;
  line-height: 1.6;
  color: #263238;
}

.ds-bot-message .ds-message-content a {
  color: #1E88E5;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 8px 12px;
  background: #E3F2FD;
  border-radius: 8px;
  transition: all 0.2s;
}

.ds-bot-message .ds-message-content a:hover {
  background: #BBDEFB;
  transform: translateX(2px);
}

.ds-whatsapp-action {
  background: #25D366;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.ds-whatsapp-action:hover {
  background: #20BA5A;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* ============================================
   ACTIONS RAPIDES
   ============================================ */
.ds-chat-input-wrapper {
  background: white;
  border-top: 1px solid #E0E7EF;
  padding: 16px;
}

.ds-chat-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ds-quick-action {
  flex: 1;
  min-width: 140px;
  background: #F5F7FA;
  border: 1px solid #E0E7EF;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #546E7A;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.ds-quick-action:hover {
  background: #E0E7EF;
  color: #263238;
}

.ds-whatsapp-btn {
  background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
  border-color: #25D366;
  color: white;
}

.ds-whatsapp-btn:hover {
  background: linear-gradient(135deg, #20BA5A 0%, #1DA851 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* ============================================
   RESPONSIVE MOBILE
   ============================================ */
@media (max-width: 768px) {
  .ds-chat-toggle {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }

  .ds-chat-toggle svg {
    width: 24px;
    height: 24px;
  }

  .ds-chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .ds-chat-messages {
    padding: 16px;
  }

  .ds-chat-welcome {
    padding: 16px;
  }

  .ds-welcome-icon {
    font-size: 40px;
  }

  .ds-chat-welcome h3 {
    font-size: 16px;
  }

  .ds-chat-welcome p {
    font-size: 13px;
  }

  .ds-intent-btn {
    padding: 12px 14px;
    font-size: 13px;
  }

  .ds-quick-action {
    min-width: 0;
    flex: 1 1 calc(50% - 4px);
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* ============================================
   SCROLLBAR
   ============================================ */
.ds-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ds-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ds-chat-messages::-webkit-scrollbar-thumb {
  background: #CBD5E0;
  border-radius: 3px;
}

.ds-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #A0AEC0;
}
