/* Chatbot Genicotik - Styles */

/* Bouton flottant */
.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(180deg, #2aa8ff, #1987e6);
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(42, 168, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(42, 168, 255, 0.5), 0 6px 16px rgba(0, 0, 0, 0.4);
}

.chatbot-toggle.active {
    background: linear-gradient(180deg, #4dc3ff, #2aa8ff);
}

.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff5a6b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Fenêtre de chat */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 420px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: linear-gradient(180deg, #0f1627, #0c111d);
    border: 1px solid rgba(77, 140, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(42, 168, 255, 0.2);
    z-index: 999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chatbot-header {
    padding: 20px;
    border-bottom: 1px solid rgba(77, 140, 255, 0.2);
    background: linear-gradient(180deg, rgba(42, 168, 255, 0.1), transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2aa8ff, #4dc3ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    color: #c9d7ff;
    font-weight: 600;
}

.chatbot-header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #7b8aad;
}

.chatbot-close {
    background: none;
    border: none;
    color: #7b8aad;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-close:hover {
    background: rgba(77, 140, 255, 0.1);
    color: #c9d7ff;
}

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(11, 15, 23, 0.5);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(77, 140, 255, 0.3);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(77, 140, 255, 0.5);
}

.chatbot-message {
    display: flex;
    gap: 12px;
    animation: messageSlide 0.3s ease;
}

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

.chatbot-message-user {
    flex-direction: row-reverse;
}

.chatbot-message-user .message-content {
    background: linear-gradient(135deg, #2aa8ff, #1987e6);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-message-bot .message-content {
    background: rgba(77, 140, 255, 0.1);
    color: #c9d7ff;
    border-bottom-left-radius: 4px;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.message-content p {
    margin: 0 0 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content .price {
    color: #31d0aa;
    font-weight: 700;
    font-size: 16px;
}

.message-content.error {
    color: #ff5a6b;
}

/* Typing indicator - Animation améliorée et visible */
.chatbot-typing {
    display: flex;
    padding: 12px 20px;
    align-items: center;
    animation: typingPulse 2s ease-in-out infinite;
}

.typing-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(42, 168, 255, 0.15), rgba(77, 140, 255, 0.1));
    border: 1px solid rgba(77, 140, 255, 0.3);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(42, 168, 255, 0.2);
    animation: typingGlow 2s ease-in-out infinite;
}

.typing-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.typing-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2aa8ff, #4dc3ff);
    box-shadow: 0 0 12px rgba(42, 168, 255, 0.6), 0 0 20px rgba(42, 168, 255, 0.3);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

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

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

.typing-text {
    color: #93a7cc;
    font-size: 13px;
    font-style: italic;
    font-weight: 500;
    animation: typingFade 2s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    30% {
        transform: translateY(-14px) scale(1.3);
        opacity: 1;
        box-shadow: 0 0 20px rgba(42, 168, 255, 0.9), 0 0 30px rgba(42, 168, 255, 0.5);
    }
}

@keyframes typingPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

@keyframes typingGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(42, 168, 255, 0.2);
        border-color: rgba(77, 140, 255, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(42, 168, 255, 0.4), 0 0 20px rgba(42, 168, 255, 0.2);
        border-color: rgba(77, 140, 255, 0.5);
    }
}

@keyframes typingFade {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Input area */
.chatbot-input-area {
    padding: 16px 20px;
    border-top: 1px solid rgba(77, 140, 255, 0.2);
    background: rgba(11, 15, 23, 0.5);
}

.chatbot-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#chatbot-input {
    flex: 1;
    background: rgba(77, 140, 255, 0.1);
    border: 1px solid rgba(77, 140, 255, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: #c9d7ff;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: all 0.2s ease;
}

#chatbot-input:focus {
    outline: none;
    border-color: rgba(77, 140, 255, 0.5);
    background: rgba(77, 140, 255, 0.15);
}

#chatbot-input::placeholder {
    color: #7b8aad;
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2aa8ff, #1987e6);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: linear-gradient(135deg, #4dc3ff, #2aa8ff);
    transform: scale(1.05);
}

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

/* Devis options */
.chatbot-devis-options {
    margin-top: 8px;
    padding: 16px;
    background: rgba(42, 168, 255, 0.1);
    border: 1px solid rgba(77, 140, 255, 0.3);
    border-radius: 12px;
}

.devis-summary {
    margin-bottom: 16px;
}

.devis-summary h4 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #c9d7ff;
    font-weight: 600;
}

.devis-summary p {
    margin: 6px 0;
    font-size: 14px;
    color: #93a7cc;
}

.payment-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-payment {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(77, 140, 255, 0.3);
    background: rgba(77, 140, 255, 0.1);
    color: #c9d7ff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-payment:hover {
    background: rgba(77, 140, 255, 0.2);
    border-color: rgba(77, 140, 255, 0.5);
    transform: translateY(-2px);
}

.btn-stripe {
    background: linear-gradient(135deg, rgba(99, 91, 255, 0.2), rgba(99, 91, 255, 0.1));
    border-color: rgba(99, 91, 255, 0.4);
}

.btn-qonto {
    background: linear-gradient(135deg, rgba(42, 168, 255, 0.2), rgba(42, 168, 255, 0.1));
    border-color: rgba(42, 168, 255, 0.4);
}

.payment-link {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2aa8ff, #1987e6);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.payment-link:hover {
    background: linear-gradient(135deg, #4dc3ff, #2aa8ff);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .chatbot-window {
        bottom: 84px;
        right: 20px;
        left: 20px;
        width: auto;
        height: calc(100vh - 120px);
        max-height: 600px;
    }

    .message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        bottom: 80px;
        right: 12px;
        left: 12px;
        border-radius: 16px;
    }

    .chatbot-header {
        padding: 16px;
    }

    .chatbot-messages {
        padding: 16px;
    }

    .chatbot-input-area {
        padding: 12px 16px;
    }
}

