/**
 * Styles frontend pour Brasport Chatbot
 * Inspiré de la charte graphique Brasport
 */

:root {
    --brasport-primary: #2c2c2c;
    --brasport-secondary: #8b8375;
    --brasport-text: #ffffff;
    --brasport-text-dark: #2c2c2c;
    --brasport-bg-light: #f5f4f2;
    --brasport-border: rgba(255, 255, 255, 0.2);
}

.brasport-chatbot {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.brasport-chatbot.brasport-chatbot-bottom-right {
    bottom: 24px;
    right: 24px;
}

.brasport-chatbot.brasport-chatbot-bottom-left {
    bottom: 24px;
    left: 24px;
}

/* Bouton d'ouverture */
.brasport-chatbot-trigger {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: #ffffff !important;
    color: #5a4838 !important;
    border: 2px solid #5a4838 !important;
    border-radius: 50px !important;
    padding: 14px 24px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    letter-spacing: 0.3px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(90, 72, 56, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.brasport-chatbot-trigger:hover {
    background: #5a4838 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(90, 72, 56, 0.3) !important;
}

.brasport-chatbot-trigger .trigger-icon {
    font-size: 20px;
    line-height: 1;
}

.brasport-chatbot.chatbot-open .brasport-chatbot-trigger {
    display: none;
}

/* Fenêtre du chatbot */
.brasport-chatbot-window {
    position: absolute;
    bottom: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: var(--brasport-bg-light);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.brasport-chatbot.brasport-chatbot-bottom-right .brasport-chatbot-window {
    right: 0;
}

.brasport-chatbot.brasport-chatbot-bottom-left .brasport-chatbot-window {
    left: 0;
}

/* En-tête */
.brasport-chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #5a4838;
    color: #ffffff;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.header-icon {
    font-size: 22px;
    line-height: 1;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-minimize,
.header-close {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    border: 2px solid #5a4838 !important;
    border-radius: 6px !important;
    color: #5a4838 !important;
    font-size: 20px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.header-minimize:hover,
.header-close:hover {
    background: #5a4838 !important;
    color: #ffffff !important;
    border-color: #5a4838 !important;
}

/* Corps du chatbot */
.brasport-chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--brasport-bg-light);
}

.brasport-chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Messages */
.chatbot-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: messageAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.chatbot-message-bot {
    align-self: flex-start;
}

.chatbot-message-user {
    align-self: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-message-bot .message-content {
    background: #ffffff;
    color: var(--brasport-text-dark);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chatbot-message-user .message-content {
    background: #5a4838;
    color: #ffffff;
}

/* Liens dans les messages */
.message-content a {
    color: #5a4838;
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.2s;
}

.message-content a:hover {
    color: #6b5848;
    text-decoration: none;
}

.chatbot-message-user .message-content a {
    color: #ffffff;
    text-decoration: underline;
}

.chatbot-message-user .message-content a:hover {
    opacity: 0.9;
}

/* Suggestions */
.chatbot-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.suggestion-label {
    font-size: 13px;
    color: var(--brasport-secondary);
    font-weight: 500;
}

.suggestion-button {
    text-align: left !important;
    padding: 10px 14px !important;
    background: #ffffff !important;
    border: 2px solid #5a4838 !important;
    border-radius: 8px !important;
    color: #5a4838 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.4 !important;
    width: 100% !important;
}

.suggestion-button:hover {
    background: #5a4838 !important;
    color: #ffffff !important;
    border-color: #5a4838 !important;
}

/* Indicateur de saisie */
.chatbot-typing {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    width: fit-content;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: var(--brasport-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Pied du chatbot */
.brasport-chatbot-footer {
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.brasport-chatbot-form {
    display: flex;
    gap: 10px;
}

.brasport-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.brasport-chatbot-input:focus {
    border-color: #5a4838;
    box-shadow: 0 0 0 2px rgba(90, 72, 56, 0.1);
}

.brasport-chatbot-submit {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #5a4838 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.brasport-chatbot-submit:hover {
    background: #6b5848 !important;
    transform: scale(1.05) !important;
}

.brasport-chatbot-submit:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Scrollbar personnalisée */
.brasport-chatbot-body::-webkit-scrollbar {
    width: 6px;
}

.brasport-chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}

.brasport-chatbot-body::-webkit-scrollbar-thumb {
    background: var(--brasport-secondary);
    border-radius: 3px;
}

.brasport-chatbot-body::-webkit-scrollbar-thumb:hover {
    background: var(--brasport-primary);
}

/* Responsive */
@media (max-width: 480px) {
    .brasport-chatbot {
        bottom: 16px;
        left: 16px;
        right: 16px;
    }
    
    .brasport-chatbot-window {
        width: 100%;
        height: calc(100vh - 100px);
    }
    
    .brasport-chatbot-trigger .trigger-text {
        display: none;
    }
    
    .brasport-chatbot-trigger {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
}

