/**
 * Chatwoot Widget - Personnalisation Digital Systems
 * Applique la charte graphique du site au widget Chatwoot
 * Compatible iOS Safari
 */

/* Variables de la charte graphique */
:root {
  --chatwoot-primary: #0F172A;
  /* matches --color-primary-500 */
  --chatwoot-accent: #EC6C1B;
  /* matches --color-accent-500 */
  --chatwoot-dark: #020617;
  /* matches --color-primary-800 */
  --chatwoot-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* iOS Safari fixes - Enable touch interactions */
* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  -webkit-touch-callout: none;
}

button,
input,
textarea,
.button,
.send-button,
.emoji-button {
  touch-action: manipulation !important;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer !important;
}

/* Widget bubble (icône en bas à droite) */
.woot-widget-bubble {
  background: linear-gradient(135deg, var(--chatwoot-primary) 0%, var(--chatwoot-dark) 100%) !important;
  box-shadow: 0 8px 24px rgba(15, 52, 96, 0.3) !important;
  touch-action: manipulation !important;
}

.woot-widget-bubble:hover,
.woot-widget-bubble:active {
  background: linear-gradient(135deg, var(--chatwoot-accent) 0%, #c95a15 100%) !important;
  transform: scale(1.05);
  transition: all 0.3s ease;
}

/* Widget header */
.header,
.chat-bubble-wrap .header {
  background: linear-gradient(135deg, var(--chatwoot-primary) 0%, var(--chatwoot-dark) 100%) !important;
}

/* Messages de l'agent */
.left .message-text--content,
.wrap.left .message-text--content {
  background-color: var(--chatwoot-primary) !important;
  color: white !important;
}

/* Liens dans le chat */
.message-text--content a,
.chat-bubble__content a {
  color: var(--chatwoot-accent) !important;
  text-decoration: underline;
}

/* Boutons - Sélecteurs spécifiques */
.button,
button.button,
.send-button,
.chat-bubble-wrap button {
  background-color: var(--chatwoot-primary) !important;
  border-color: var(--chatwoot-primary) !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
}

.button:hover,
.button:active,
button.button:hover,
button.button:active,
.send-button:hover,
.send-button:active {
  background-color: var(--chatwoot-accent) !important;
  border-color: var(--chatwoot-accent) !important;
}

/* Input de message - Fix iOS */
.input,
input.input,
textarea.input,
.form-input,
.message-input {
  border-color: #cbd5e1 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  touch-action: manipulation !important;
}

.input:focus,
input.input:focus,
textarea.input:focus,
.message-input:focus {
  border-color: var(--chatwoot-primary) !important;
  outline: none !important;
}

/* iOS: Fix pour le clavier qui cache l'input */
.chat-bubble-wrap,
.conversation-wrap {
  position: fixed !important;
  -webkit-overflow-scrolling: touch;
}

/* Police */
.chat-bubble-wrap,
.chat-bubble-wrap body,
.message-text--content,
.input,
.chat-bubble-wrap button {
  font-family: var(--chatwoot-font) !important;
}

/* Typing indicator (points qui bougent) */
.typing-indicator span,
.typing-indicator__dot {
  background-color: var(--chatwoot-primary) !important;
}

/* Timestamp */
.time,
.message-text__wrap .time {
  color: var(--chatwoot-dark) !important;
  opacity: 0.7;
}

/* Widget minimized badge (notification count) */
.unread-badge,
.notification-badge {
  background-color: var(--chatwoot-accent) !important;
}

/* iOS Safari: Ensure send button is clickable */
.send-button,
button[aria-label="Send"],
.chat-input__send-button {
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 8px !important;
  pointer-events: auto !important;
  z-index: 10 !important;
}

/* iOS: Fix input container */
.chat-message-input-container,
.input-wrapper {
  position: relative !important;
  z-index: 1 !important;
}