/* ============================================================
   AI Chat Widget - store.medjira.com
   Fichier : /wp-content/themes/store-child/ai-chat/chat.css
   ============================================================ */

/* Bouton flottant */
#ai-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #16a34a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(22,163,74,0.35);
    transition: transform 0.2s, background 0.2s;
}
#ai-chat-toggle:hover {
    background: #15803d;
    transform: scale(1.08);
}
#ai-chat-toggle svg {
    width: 26px;
    height: 26px;
    fill: white;
}

/* Badge notification */
#ai-chat-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
}

/* Fenêtre de chat */
#ai-chat-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 340px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-height: 520px;
}
#ai-chat-window.open {
    display: flex;
}

/* Header */
#ai-chat-header {
    background: #16a34a;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
#ai-chat-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
#ai-chat-header .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
#ai-chat-header .avatar svg {
    width: 18px;
    height: 18px;
    fill: white;
}
#ai-chat-header .title {
    color: white;
    font-size: 15px;
    font-weight: 600;
}
#ai-chat-header .status {
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
#ai-chat-header .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #86efac;
}
#ai-chat-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    padding: 4px;
    display: flex;
    align-items: center;
}
#ai-chat-close:hover { color: white; }
#ai-chat-close svg { width: 18px; height: 18px; fill: currentColor; }

/* Zone messages */
#ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Bulles */
.ai-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.ai-msg-row.user {
    flex-direction: row-reverse;
}
.ai-msg-row .small-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ai-msg-row .small-avatar svg { width: 14px; height: 14px; fill: white; }
.ai-msg-row.user .small-avatar {
    background: #e5e7eb;
}
.ai-msg-row.user .small-avatar svg { fill: #6b7280; }

.ai-bubble {
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 76%;
    word-break: break-word;
}
.ai-bubble.ai {
    background: #16a34a;
    color: white;
    border-bottom-left-radius: 4px;
}
.ai-bubble.user {
    background: #f3f4f6;
    color: #111827;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing-dots { display: flex; gap: 4px; align-items: center; padding: 2px 0; }
.typing-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.7);
    animation: ai-bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ai-bounce {
    0%,60%,100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Zone de saisie */
#ai-chat-input-area {
    border-top: 1px solid #f3f4f6;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
#ai-chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #111827;
    background: transparent;
    font-family: inherit;
}
#ai-chat-input::placeholder { color: #9ca3af; }
#ai-chat-send {
    background: #16a34a;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
#ai-chat-send:hover { background: #15803d; }
#ai-chat-send svg { width: 16px; height: 16px; fill: white; }
#ai-chat-send:disabled { background: #9ca3af; cursor: not-allowed; }

/* Responsive mobile */
@media (max-width: 400px) {
    #ai-chat-window {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 80px;
    }
    #ai-chat-toggle {
        bottom: 16px;
        right: 16px;
    }
}

/* debut Bouton de l'assistant IA */
/* Bouton de l'assistant IA */
.medjira-chat-button {
  background-color: #f7a01b !important; /* Code hexadécimal de la couleur orange */
  border: 2px solid #fff !important;
  border-radius: 50% !important;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2) !important;
  padding: 10px !important;
  transition: all 0.3s ease-in-out !important;
}

.medjira-chat-button:hover {
  background-color: #fca311 !important; /* Couleur orange plus foncée au survol */
  transform: translateY(-2px) !important;
}

/* Texte de l'assistant IA */
.medjira-chat-button span {
  color: #fff !important;
  font-family: sans-serif !important;
  font-weight: bold !important;
  font-size: 14px !important;
}

/* Boutons de chat (réponses rapides) */
.medjira-chat-quick-reply {
  background-color: #fff !important;
  border: 1px solid #f7a01b !important;
  border-radius: 20px !important;
  color: #f7a01b !important;
  font-family: sans-serif !important;
  font-size: 12px !important;
  margin: 5px !important;
  padding: 8px 15px !important;
  transition: all 0.3s ease-in-out !important;
}

.medjira-chat-quick-reply:hover {
  background-color: #f7a01b !important;
  color: #fff !important;
  transform: translateY(-1px) !important;
}

/*  debut Bouton de l'assistant IA */
#ai-chat-toggle {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 65px !important;
    height: 65px !important;
    background-color: #f7941e !important; /* Orange */
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 30px !important; /* Taille de l'émoji */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
    z-index: 999999 !important;
    transition: transform 0.3s ease !important;
    padding: 0 !important;
}

#ai-chat-toggle:hover {
    transform: scale(1.1) !important;
}