/* ═══════════════════════════════════════════════════════════════════════════════
   ASSISTANT IA - Chat (PWA Chauffeur)
   ═══════════════════════════════════════════════════════════════════════════════ */

.assistant-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px);
    max-height: calc(100vh - 70px);
    overflow: hidden;
}

/* Header */
.assistant-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.assistant-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.assistant-header-info { flex: 1; }
.assistant-header-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.assistant-header-sub { font-size: 11px; color: var(--text-muted); }

.assistant-clear-btn {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: none;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
}

/* Messages */
.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

/* Welcome */
.assistant-welcome {
    text-align: center;
    padding: 32px 16px;
}

.assistant-welcome-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: white;
    margin: 0 auto 14px;
}

.assistant-welcome-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.assistant-welcome-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.assistant-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.assistant-chip {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.assistant-chip:active {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
}

/* Message bubbles */
.msg {
    display: flex;
    gap: 8px;
    max-width: 88%;
    animation: msgIn 0.25s ease;
}

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

.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-assistant { align-self: flex-start; }

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.msg-avatar-user {
    background: linear-gradient(135deg, var(--ve-marine) 0%, var(--ve-marine-light) 100%);
    color: white;
}

.msg-avatar-assistant {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.msg-bubble-user {
    background: linear-gradient(135deg, var(--ve-marine) 0%, var(--ve-marine-light) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-bubble-assistant {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

/* Confirmation card */
.msg-confirmation {
    align-self: flex-start;
    max-width: 92%;
    animation: msgIn 0.25s ease;
}

.confirm-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 3px solid #6366f1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.confirm-header {
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.06);
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confirm-body {
    padding: 12px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.confirm-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.confirm-btn-yes {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    font-family: inherit;
}

.confirm-btn-no {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: inherit;
}

.confirm-btn-yes:active { opacity: 0.8; }
.confirm-btn-no:active { background: var(--danger-light); color: var(--danger); }

.confirm-loading {
    padding: 8px 12px;
    text-align: center;
    color: #6366f1;
    font-size: 13px;
    font-weight: 600;
}

.confirm-done {
    padding: 10px 12px;
    background: rgba(16, 185, 129, 0.08);
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
}

.confirm-cancelled {
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.05);
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--danger);
    font-weight: 600;
}

.confirm-error {
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.05);
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--danger);
    font-weight: 600;
}

/* Typing dots */
.msg-typing {
    display: flex;
    gap: 8px;
    align-self: flex-start;
    animation: msgIn 0.25s ease;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input bar */
.assistant-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    padding-bottom: calc(10px + var(--safe-bottom, 0px));
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-shrink: 0;
}

.assistant-input-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 15px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
}

.assistant-input-bar input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.assistant-mic-btn,
.assistant-send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.assistant-mic-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.assistant-mic-btn.recording {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    animation: micPulse 1.5s infinite;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.assistant-send-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.assistant-send-btn:active {
    transform: scale(0.95);
}
