/**
 * Styles du Widget Chat IA Flottant
 */

/* Container principal */
#ai-assistant-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    z-index: 9999;
}

/* La bulle flottante */
.ai-bubble {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.ai-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.6);
}

.ai-bubble svg {
    width: 28px;
    height: 28px;
}

/* Fenêtre du chat */
.ai-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

/* Header du chat */
.ai-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-title {
    font-size: 18px;
    font-weight: 600;
}

.ai-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ai-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.ai-message {
    animation: fadeIn 0.3s ease;
}

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

.ai-user {
    align-self: flex-end;
    max-width: 80%;
    background: #667eea;
    color: white;
    padding: 12px 16px;
    border-radius: 12px 12px 4px 12px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.ai-assistant strong {
    font-weight: 600;
    color: #667eea;
}

.ai-assistant em {
    font-style: italic;
    color: #666;
}

.ai-assistant code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.ai-assistant {
    align-self: flex-start;
    max-width: 80%;
    background: white;
    color: #333;
    padding: 12px 16px;
    border-radius: 12px 12px 12px 4px;
    border: 1px solid #e0e0e0;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

/* Bouton de navigation dans le chat */
.ai-navigation-button {
    align-self: center;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 8px 0 !important;
}

.ai-nav-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ai-nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.ai-nav-button:active {
    transform: translateY(0);
}

/* Zone d'input */
.ai-input-area {
    padding: 12px;
    border-top: 1px solid #e0e0e0;
    background: white;
    display: flex;
    gap: 8px;
}

#ai-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#ai-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#ai-input::placeholder {
    color: #999;
}

/* Statut de chargement */
.ai-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #667eea;
    font-size: 14px;
    height: 40px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Boutons d'action (Envoyer, Annuler) */
.ai-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.ai-send-btn {
    background-color: #667eea;
    color: white;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 18px;
}

.ai-send-btn:hover {
    background-color: #5568d3;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

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

.ai-cancel-btn-action {
    background-color: #ff5252;
    color: white;
    padding: 8px 14px;
    font-size: 13px;
}

.ai-cancel-btn-action:hover {
    background-color: #ff3838;
    box-shadow: 0 2px 8px rgba(255, 82, 82, 0.3);
}

.ai-cancel-btn-action:active {
    transform: scale(0.95);
}

/* Toast de guidance */
.ai-guidance-toast {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    max-width: 300px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 9998;
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .ai-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-width: none;
    }
    
    .ai-message {
        max-width: 85% !important;
    }
}

/* Scrollbar personnalisée */
.ai-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.ai-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}
/* Bouton d'annulation */
.ai-cancel-button-container {
    display: flex;
    justify-content: center;
    padding: 12px 0;
    margin: 8px 0;
}

.ai-cancel-button {
    padding: 8px 16px;
    background-color: #ff5252;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 82, 82, 0.3);
}

.ai-cancel-button:hover {
    background-color: #ff3838;
    box-shadow: 0 4px 12px rgba(255, 82, 82, 0.4);
    transform: translateY(-2px);
}

.ai-cancel-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(255, 82, 82, 0.3);
}