/* Bulle de support — design moderne */
.support-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.support-widget-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e30613 0%, #c20510 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 6px 24px rgba(227, 6, 19, 0.4), 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.support-widget-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(227, 6, 19, 0.5), 0 4px 12px rgba(0,0,0,0.1);
}

.support-widget-panel {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 392px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: 75vh;
  min-height: 320px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.support-widget-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.support-widget-header {
  padding: 18px 20px;
  padding-right: 52px;
  background: linear-gradient(135deg, #e30613 0%, #b8040e 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.support-widget-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  object-fit: cover;
}

.support-widget-avatar-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
}

.support-widget-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
}

.support-widget-header p {
  font-size: 0.8rem;
  opacity: 0.92;
  margin: 2px 0 0 0;
}

.support-widget-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  scroll-behavior: smooth;
}

.support-widget-messages::-webkit-scrollbar {
  width: 6px;
}
.support-widget-messages::-webkit-scrollbar-track {
  background: transparent;
}
.support-widget-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.support-widget-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.support-msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.support-msg-bot,
.support-msg-operator {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px 18px 18px 6px;
}

.support-msg-operator {
  border-left: 4px solid #0f172a;
}

.support-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #e30613 0%, #c20510 100%);
  color: #fff;
  border: none;
  border-radius: 18px 18px 6px 18px;
}

.support-msg-meta {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-top: 6px;
}

.support-widget-input-wrap {
  padding: 16px 20px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.support-attachment-preview {
  padding: 8px 12px;
  margin-bottom: 8px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.support-attachment-preview .support-attachment-remove {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0 4px;
}

.support-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.support-input-row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.support-input-row input[type="text"]:focus {
  outline: none;
  border-color: #e30613;
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}

.support-btn-icon {
  width: 44px;
  height: 44px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 14px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.support-btn-icon:hover {
  border-color: #e30613;
  color: #e30613;
  background: #fff5f5;
}

.support-btn-icon.recording {
  background: #e30613;
  color: #fff;
  border-color: #e30613;
  animation: support-pulse 1.2s ease-in-out infinite;
}

@keyframes support-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 6, 19, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(227, 6, 19, 0); }
}

.support-widget-input-wrap button[type="submit"],
.support-widget-input-wrap #support-widget-send {
  padding: 12px 18px;
  background: linear-gradient(135deg, #e30613 0%, #c20510 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.2s;
}

.support-widget-input-wrap button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(227, 6, 19, 0.35);
}

.support-msg-attachment {
  margin-top: 10px;
}

.support-msg-attachment img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 12px;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Lecteur audio moderne — widget et support-desk */
.audio-player-modern {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.05);
  border-radius: 14px;
  margin-top: 6px;
  min-width: 240px;
  max-width: 280px;
}
.support-msg-user .audio-player-modern {
  background: rgba(255,255,255,0.2);
}

.audio-player-modern audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.audio-player-modern__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #e30613;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.2s;
}
.audio-player-modern__btn:hover {
  background: #c20510;
  transform: scale(1.05);
}
.support-msg-user .audio-player-modern__btn {
  background: rgba(255,255,255,0.9);
  color: #e30613;
}
.support-msg-user .audio-player-modern__btn:hover {
  background: #fff;
}

.audio-player-modern__btn .fa-play { margin-left: 2px; }
.audio-player-modern__btn .fa-pause { margin: 0; }

.audio-player-modern__track {
  flex: 1;
  height: 6px;
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}
.support-msg-user .audio-player-modern__track {
  background: rgba(255,255,255,0.3);
}

.audio-player-modern__progress {
  height: 100%;
  width: 0%;
  background: #e30613;
  border-radius: 3px;
  transition: width 0.1s linear;
}
.support-msg-user .audio-player-modern__progress {
  background: #fff;
}

.audio-player-modern__time {
  font-size: 0.75rem;
  color: #64748b;
  min-width: 52px;
  text-align: right;
}
.support-msg-user .audio-player-modern__time {
  color: rgba(255,255,255,0.9);
}

.support-msg-attachment .support-file-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.06);
  border-radius: 10px;
  font-size: 0.85rem;
  color: inherit;
  text-decoration: none;
  margin-top: 6px;
  transition: background 0.2s;
}

.support-msg-attachment .support-file-link:hover {
  background: rgba(0,0,0,0.1);
}

.support-widget-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s;
}

.support-widget-close:hover {
  background: rgba(255,255,255,0.35);
}

.support-widget-contact {
  padding: 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.support-widget-contact-intro {
  font-size: 0.9rem;
  color: #475569;
  margin: 0 0 12px 0;
}
.support-widget-contact form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-top: 10px;
  margin-bottom: 4px;
}
.support-widget-contact form label:first-of-type { margin-top: 0; }
.support-widget-contact form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.support-widget-contact form input:focus {
  outline: none;
  border-color: #e30613;
}
.support-widget-btn-primary {
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  background: #e30613;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.support-widget-btn-primary:hover { background: #c20510; }

.support-widget-rating {
  padding: 16px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}
.support-widget-rating-question {
  font-size: 0.9rem;
  color: #334155;
  margin: 0 0 12px 0;
  font-weight: 500;
}
.support-widget-rating-emojis {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}
.support-widget-rating-btn {
  width: 48px;
  height: 48px;
  border: 2px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  font-size: 1.75rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.support-widget-rating-btn:hover {
  border-color: #e30613;
  transform: scale(1.1);
}
.support-widget-rating-thanks {
  font-size: 0.9rem;
  color: #16a34a;
  font-weight: 600;
  margin: 0;
  text-align: center;
}

@media (max-width: 480px) {
  .support-widget-panel {
    width: 100%;
    right: 0;
    bottom: 70px;
    border-radius: 16px 16px 0 0;
    max-width: 100%;
  }
  .support-widget-bubble {
    right: 16px;
    bottom: 16px;
  }
  .support-input-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .support-input-row input[type="text"] {
    order: 0;
    flex: 1 1 140px;
  }
  .support-widget-input-wrap button[type="submit"],
  .support-widget-input-wrap #support-widget-send {
    order: 0;
  }
  .support-widget-input-wrap .support-btn-icon {
    order: 1;
    width: 42px;
    height: 42px;
  }
}

.support-widget-contact,
.support-widget-rating {
  flex-shrink: 0;
}
