/* Chatbot Frontend Styles */

#fabomatic-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: var(--chatbot-font-text, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
}

/* Bouton toggle */
#fabomatic-chatbot-container .fabomatic-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

#fabomatic-chatbot-container .fabomatic-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#fabomatic-chatbot-container .fabomatic-chatbot-toggle i {
    width: 28px;
    height: 28px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Fenêtre du chatbot */
#fabomatic-chatbot-container .fabomatic-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
    transition: height 0.3s ease, max-height 0.3s ease, bottom 0.3s ease;
}

/* État agrandi */
#fabomatic-chatbot-container.expanded .fabomatic-chatbot-window {
    bottom: 20px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* En-tête */
#fabomatic-chatbot-container .fabomatic-chatbot-header {
    background: var(--primary-color);
    color: white;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
}

#fabomatic-chatbot-container .fabomatic-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fabomatic-chatbot-container .fabomatic-chatbot-avatar i {
    width: 24px;
    height: 24px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    font-family: var(--chatbot-font-title, inherit);
}

#fabomatic-chatbot-container .fabomatic-chatbot-status {
    font-size: 12px;
    opacity: 0.9;
}

#fabomatic-chatbot-container .fabomatic-chatbot-header-actions {
    display: flex;
    gap: 8px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-header-actions #fabomatic-chatbot-minimize, 
#fabomatic-chatbot-container .fabomatic-chatbot-header-actions #fabomatic-chatbot-close,
#fabomatic-chatbot-container .fabomatic-chatbot-header-actions #fabomatic-chatbot-expand,
#fabomatic-chatbot-container .fabomatic-chatbot-header-actions #fabomatic-chatbot-history {
    padding: 5px;
    background: transparent;
}

#fabomatic-chatbot-container .fabomatic-chatbot-header-actions #fabomatic-chatbot-minimize:hover, 
#fabomatic-chatbot-container .fabomatic-chatbot-header-actions #fabomatic-chatbot-close:hover,
#fabomatic-chatbot-container .fabomatic-chatbot-header-actions #fabomatic-chatbot-expand:hover,
#fabomatic-chatbot-container .fabomatic-chatbot-header-actions #fabomatic-chatbot-history:hover {
    padding: 5px;
    background: var(--accent-color);
}

#fabomatic-chatbot-container .fabomatic-chatbot-suggestion-btn {
    padding: 10px 16px;
    border-radius: 20px;
    background: white;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--chatbot-font-text, inherit);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: none!important;
}

#fabomatic-chatbot-container .fabomatic-chatbot-suggestion-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        border: none!important;

}

/* Boutons d'action dans le header */
#fabomatic-chatbot-container .fabomatic-chatbot-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#fabomatic-chatbot-container .fabomatic-chatbot-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

#fabomatic-chatbot-container .fabomatic-chatbot-action-btn i {
    width: 18px;
    height: 18px;
}

/* Zone de messages */
#fabomatic-chatbot-container .fabomatic-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--secondary-color);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#fabomatic-chatbot-container .fabomatic-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#fabomatic-chatbot-container .fabomatic-chatbot-message-assistant {
    justify-content: flex-start;
}

#fabomatic-chatbot-container .fabomatic-chatbot-message-user {
    justify-content: flex-end;
}

#fabomatic-chatbot-container .fabomatic-chatbot-message-content {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 20px;
    line-height: 1.5;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#fabomatic-chatbot-container .fabomatic-chatbot-message-assistant .fabomatic-chatbot-message-content {
    background: #f5f5f5;
    color: var(--text-color);
    border-bottom-left-radius: 6px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-message-user .fabomatic-chatbot-message-content {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 6px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-message-content p {
    margin: 0;
    margin-bottom: 10px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-message-content p:last-child {
    margin-bottom: 0;
}

/* Boutons de suggestions */
#fabomatic-chatbot-container .fabomatic-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

#fabomatic-chatbot-container .fabomatic-chatbot-suggestion-btn {
    padding: 10px 16px;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    background: white;
    color: var(--accent-color);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--chatbot-font-text, inherit);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

#fabomatic-chatbot-container .fabomatic-chatbot-suggestion-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Indicateur de frappe */
#fabomatic-chatbot-container .fabomatic-chatbot-loading {
    padding: 0 20px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-typing span {
    width: 8px;
    height: 8px;
    background: var(--text-light-color);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

#fabomatic-chatbot-container .fabomatic-chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

#fabomatic-chatbot-container .fabomatic-chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Zone d'input */
#fabomatic-chatbot-container .fabomatic-chatbot-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

#fabomatic-chatbot-container .fabomatic-chatbot-input-container form {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: none;

}
#fabomatic-chatbot-container button {
    transition: background 0.3s;
}
#fabomatic-chatbot-container .fabomatic-chatbot-input {
    flex: 1;
    border: 1px solid #e5e5e5;
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: var(--chatbot-font-text, inherit);
    background: #f8f8f8;
}

#fabomatic-chatbot-container .fabomatic-chatbot-input:focus {
    border-color: var(--primary-color);
}

#fabomatic-chatbot-container .fabomatic-chatbot-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

#fabomatic-chatbot-container .fabomatic-chatbot-send:hover {
    transform: scale(1.05);
}

#fabomatic-chatbot-container .fabomatic-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#fabomatic-chatbot-container .fabomatic-chatbot-send i {
    width: 20px;
    height: 20px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-footer-text {
    text-align: center;
    font-size: 11px;
    color: var(--text-light-color);
    margin-top: 8px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-footer-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

#fabomatic-chatbot-container .fabomatic-chatbot-footer-text a:hover {
    opacity: 0.8;
}

/* Formulaire de contact */
#fabomatic-chatbot-container .fabomatic-chatbot-contact-form {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#fabomatic-chatbot-container .fabomatic-chatbot-contact-form h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    font-family: var(--chatbot-font-title, inherit);
}

#fabomatic-chatbot-container #fabomatic-chatbot-form {
    background-color: transparent;
}

#fabomatic-chatbot-container .fabomatic-chatbot-form-group {
    margin-bottom: 12px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
}

#fabomatic-chatbot-container .fabomatic-chatbot-form-input,
#fabomatic-chatbot-container .fabomatic-chatbot-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--chatbot-font-text, inherit);
    outline: none;
    transition: border-color 0.2s ease;
}

#fabomatic-chatbot-container .fabomatic-chatbot-form-input:focus,
#fabomatic-chatbot-container .fabomatic-chatbot-form-textarea:focus {
    border-color: var(--primary-color);
}

#fabomatic-chatbot-container .fabomatic-chatbot-form-textarea {
    resize: vertical;
    min-height: 80px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-form-submit {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--chatbot-font-text, inherit);
}

#fabomatic-chatbot-container .fabomatic-chatbot-form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#fabomatic-chatbot-container .fabomatic-chatbot-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Panneau d'historique */
#fabomatic-chatbot-container .fabomatic-chatbot-history-panel {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin-top: 10px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-history-panel strong {
    color: var(--text-color);
    font-size: 15px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-history-panel ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

#fabomatic-chatbot-container .fabomatic-chatbot-history-panel li {
    padding: 6px 0;
    color: var(--text-color);
    font-size: 14px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-clear-history {
    width: 100%;
    padding: 10px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

#fabomatic-chatbot-container .fabomatic-chatbot-clear-history:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    #fabomatic-chatbot-container .fabomatic-chatbot-window {
        bottom: 80px;
        right: 10px;
        left: 10px;
        width: auto;
        height: calc(100vh - 100px);
    }
    
    #fabomatic-chatbot-container .fabomatic-chatbot-minimized {
        right: 10px;
        width: calc(100% - 20px);
    }
}
