/* ===================================================
   SHL RENT CAR — ASSISTANT VOCAL & CHAT IA (CSS)
   =================================================== */

:root {
    --ai-primary: #3b82f6;
    --ai-primary-hover: #2563eb;
    --ai-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --ai-gradient-mic: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --ai-bg-dark: #0f172a;
    --ai-card-bg: #ffffff;
    --ai-border: #e2e8f0;
    --ai-text-main: #1e293b;
    --ai-text-muted: #64748b;
}

/* 1. Bouton Flottant (FAB) */
.shl-ai-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ai-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    cursor: pointer;
    z-index: 99999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

.shl-ai-fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.45);
}

.shl-ai-fab.shl-ai-listening {
    background: var(--ai-gradient-mic);
    animation: shl-ai-pulse 1.5s infinite;
}

@keyframes shl-ai-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.shl-ai-fab .shl-ai-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
}

/* 2. Fenêtre de Chat Principale */
.shl-ai-chat-window {
    position: fixed;
    bottom: 95px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.shl-ai-chat-window.shl-ai-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* 3. En-tête */
.shl-ai-header {
    background: var(--ai-gradient);
    color: white;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shl-ai-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shl-ai-avatar {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.shl-ai-title-wrap {
    display: flex;
    flex-direction: column;
}

.shl-ai-title {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.shl-ai-status {
    font-size: 0.72rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.shl-ai-status-dot {
    width: 6px;
    height: 6px;
    background: #34d399;
    border-radius: 50%;
}

.shl-ai-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shl-ai-btn-icon {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.shl-ai-btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.shl-ai-btn-icon.shl-ai-active {
    background: white;
    color: var(--ai-primary);
}

/* 4. Zone des Messages */
.shl-ai-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shl-ai-msg {
    display: flex;
    gap: 8px;
    max-width: 88%;
}

.shl-ai-msg.shl-ai-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.shl-ai-msg.shl-ai-bot {
    align-self: flex-start;
}

.shl-ai-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.45;
    word-break: break-word;
}

.shl-ai-msg.shl-ai-user .shl-ai-bubble {
    background: #2563eb;
    color: white;
    border-bottom-right-radius: 4px;
}

.shl-ai-msg.shl-ai-bot .shl-ai-bubble {
    background: #ffffff;
    color: var(--ai-text-main);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--ai-border);
}

.shl-ai-bubble ul {
    margin: 6px 0;
    padding-left: 18px;
}

.shl-ai-bubble li {
    margin-bottom: 4px;
}

.shl-ai-bubble p {
    margin: 4px 0;
}

.shl-ai-bubble strong {
    color: #0f172a;
}

.shl-ai-msg-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.shl-ai-msg-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.shl-ai-msg-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Carte interactive WhatsApp */
.shl-ai-action-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 0.8rem;
}

.shl-ai-action-card-title {
    font-weight: 700;
    color: #166534;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shl-ai-action-btn-whatsapp {
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.shl-ai-action-btn-whatsapp:hover {
    background: #16a34a;
}

/* Suggestion Chips */
.shl-ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.shl-ai-chip {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.shl-ai-chip:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    transform: translateY(-1px);
}

/* 5. Zone de Saisie (Footer) */
.shl-ai-footer {
    background: #ffffff;
    padding: 10px 14px;
    border-top: 1px solid var(--ai-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shl-ai-recording-bar {
    background: #fee2e2;
    color: #991b1b;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    animation: shl-ai-fade-in 0.2s ease;
}

.shl-ai-recording-bar.shl-ai-visible {
    display: flex;
}

.shl-ai-recording-pulse {
    width: 8px;
    height: 8px;
    background: #dc2626;
    border-radius: 50%;
    animation: shl-ai-pulse 1s infinite;
}

.shl-ai-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shl-ai-input {
    flex: 1;
    background: #f1f5f9;
    border: 1px solid transparent;
    padding: 9px 14px;
    border-radius: 24px;
    font-size: 0.85rem;
    outline: none;
    color: #1e293b;
    transition: all 0.2s;
}

.shl-ai-input:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.shl-ai-mic-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
}

.shl-ai-mic-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.shl-ai-mic-btn.shl-ai-recording {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
    animation: shl-ai-pulse 1.2s infinite;
}

.shl-ai-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ai-primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    outline: none;
}

.shl-ai-send-btn:hover {
    background: var(--ai-primary-hover);
    transform: scale(1.05);
}

.shl-ai-send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator Animation */
.shl-ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
}

.shl-ai-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: shl-ai-blink 1.4s infinite ease-in-out both;
}

.shl-ai-dot:nth-child(1) { animation-delay: -0.32s; }
.shl-ai-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes shl-ai-blink {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes shl-ai-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .shl-ai-chat-window {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 84px;
        height: 75vh;
    }
    .shl-ai-fab {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }
}
