/* ⚛️ QUANTIMMO CHATBOT - DESIGN ULTRA-PRO */

:root {
  --quantimmo-navy: #1e1e4d;
  --quantimmo-purple: #9b6bff;
  --quantimmo-purple-light: #d0b3ff;
  --gradient-primary: linear-gradient(135deg, #1e1e4d 0%, #9b6bff 100%);
  --gradient-light: linear-gradient(135deg, #9b6bff 0%, #d0b3ff 100%);
  --gradient-hero: linear-gradient(135deg, #1e1e4d 0%, #4a2d6f 40%, #9b6bff 100%);
  --chat-bg: #f8f9fc;
  --text-dark: #1e1e4d;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f8f9fc 0%, #e8e9f3 100%);
  color: var(--text-dark);
  overflow: hidden;
}

.chatbot-container {
  max-width: 950px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  box-shadow: 0 0 100px rgba(30, 30, 77, 0.2);
}

/* HEADER ULTRA-PRO */
.chat-header {
  background: var(--gradient-hero);
  color: white;
  padding: 35px 35px 30px 35px;
  box-shadow: 0 8px 40px rgba(30, 30, 77, 0.3);
  position: relative;
  overflow: hidden;
}

.chat-header::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(208, 179, 255, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  animation: orbit 20s linear infinite;
}

@keyframes orbit {
  from { transform: rotate(0deg) translateX(40px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(40px) rotate(-360deg); }
}

.chat-header-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* LOGO BIEN VISIBLE */
.chat-logo {
  width: 75px;
  height: 75px;
  background: transparent;
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.chat-header-text h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.5px;
}

.chat-header-text .tagline {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.98;
  margin-bottom: 5px;
  line-height: 1.4;
}

.chat-header-text .subtitle {
  font-size: 15px;
  opacity: 0.95;
  font-weight: 400;
  font-style: italic;
}

/* Barre de progression élégante */
.progress-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 8px;
  border-radius: 4px;
  margin-top: 25px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
}

.progress-fill {
  background: linear-gradient(90deg, rgba(255,255,255,0.8) 0%, white 100%);
  height: 100%;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* Zone messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 35px 30px;
  background: var(--chat-bg);
}

/* Message */
.message {
  display: flex;
  margin-bottom: 28px;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Avatar bot avec effet orbital */
.message.bot .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 16px;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(155, 107, 255, 0.5);
  position: relative;
}

.message.bot .avatar::after {
  content: '';
  position: absolute;
  width: 110%;
  height: 110%;
  border-radius: 50%;
  border: 2px solid rgba(208, 179, 255, 0.6);
  animation: pulse-ring 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Bulle bot */
.message.bot .bubble {
  background: transparent;
  color: var(--text-dark);
  padding: 20px 24px;
  border-radius: 22px 22px 22px 6px;
  max-width: 72%;
  box-shadow: 0 4px 20px rgba(30, 30, 77, 0.12);
  line-height: 1.7;
  border: 1px solid rgba(155, 107, 255, 0.15);
  font-size: 15.5px;
}

.message.bot .bubble strong {
  color: var(--quantimmo-purple);
  font-weight: 700;
}

/* Bulle user */
.message.user {
  justify-content: flex-end;
}

.message.user .bubble {
  background: var(--gradient-primary);
  color: white;
  padding: 20px 24px;
  border-radius: 22px 22px 6px 22px;
  max-width: 72%;
  box-shadow: 0 6px 25px rgba(155, 107, 255, 0.4);
  line-height: 1.7;
  font-weight: 600;
  font-size: 15.5px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 24px;
}

.typing-indicator span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--quantimmo-purple);
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-14px); opacity: 1; }
}

/* Zone saisie */
.chat-input-area {
  padding: 28px 30px 25px 30px;
  background: transparent;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -6px 30px rgba(30, 30, 77, 0.06);
}

.input-wrapper {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.input-wrapper input {
  flex: 1;
  padding: 18px 24px;
  border: 2px solid var(--border-color);
  border-radius: 32px;
  font-size: 16px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-weight: 500;
}

.input-wrapper input:focus {
  border-color: var(--quantimmo-purple);
  box-shadow: 0 0 0 5px rgba(155, 107, 255, 0.12);
  background: #fafbff;
}

.voice-btn, .send-btn {
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  position: relative;
}

.voice-btn {
  background: var(--gradient-light);
  box-shadow: 0 6px 25px rgba(155, 107, 255, 0.4);
}

.voice-btn::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  z-index: -1;
  transition: transform 0.3s;
}

.voice-btn:hover::before {
  transform: scale(1.2);
  opacity: 0.5;
}

.voice-btn:hover {
  transform: scale(1.12) translateY(-3px);
  box-shadow: 0 8px 30px rgba(155, 107, 255, 0.6);
}

.voice-btn.listening {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  animation: pulse 1.5s infinite;
}

.send-btn {
  background: var(--gradient-primary);
  box-shadow: 0 6px 25px rgba(30, 30, 77, 0.45);
}

.send-btn:hover:not(:disabled) {
  transform: scale(1.12) translateY(-3px);
  box-shadow: 0 8px 30px rgba(30, 30, 77, 0.6);
}

.send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* BOUTONS DE CHOIX ULTRA-PRO */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  animation: fadeIn 0.5s ease;
}

.quick-reply-btn {
  padding: 16px 30px;
  background: transparent;
  border: 2px solid var(--quantimmo-purple);
  color: var(--quantimmo-navy);
  border-radius: 35px;
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 700;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(155, 107, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.quick-reply-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.quick-reply-btn:hover::before {
  left: 0;
}

.quick-reply-btn:hover {
  color: white;
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 35px rgba(155, 107, 255, 0.5);
  border-color: transparent;
}

.quick-reply-btn:active {
  transform: translateY(-2px) scale(1.01);
}

/* Footer badges */
.chat-footer-signature {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

.security-badge, .free-badge, .quantum-badge-footer {
  padding: 6px 14px;
  background: rgba(155, 107, 255, 0.08);
  border-radius: 20px;
  border: 1px solid rgba(155, 107, 255, 0.15);
}

/* Scrollbar ultra-moderne */
.chat-messages::-webkit-scrollbar {
  width: 12px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 6px;
  margin: 10px 0;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--gradient-light);
  border-radius: 6px;
  border: 3px solid #f1f3f5;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--gradient-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .chatbot-container {
    max-width: 100%;
    border-radius: 0;
  }
  
  .chat-header {
    padding: 25px 20px 20px 20px;
  }
  
  .chat-logo {
    width: 60px;
    height: 60px;
  }
  
  .chat-header-text h1 {
    font-size: 24px;
  }
  
  .chat-header-text .tagline {
    font-size: 14px;
  }
  
  .chat-header-text .subtitle {
    font-size: 12px;
  }
  
  .message.bot .bubble,
  .message.user .bubble {
    max-width: 88%;
  }
}

/* Animation spin pour loader */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Amélioration boutons Phase 5B */
.quick-reply-btn {
  font-size: 17px !important;
  padding: 18px 35px !important;
  font-weight: 700 !important;
  border-radius: 16px !important;
  letter-spacing: 0.3px !important;
}

.quick-reply-btn:hover {
  transform: translateY(-5px) scale(1.03) !important;
}

/* Styles pour multi-sélection */
.multi-btn {
  transition: all 0.3s ease !important;
  border: 2px solid #667eea !important;
}

.multi-btn:hover {
  transform: scale(1.02);
}

.multi-btn.selected {
  background: linear-gradient(135deg, #667eea, #764ba2) !important;
  color: white !important;
  transform: scale(1.05);
  border: 2px solid #764ba2 !important;
}

.validate-btn {
  width: 100%;
  margin-top: 15px !important;
  font-weight: bold;
}

