/* ===================================
   AI Assistant Chatbot - Premium Design
   =================================== */

/* Bouton Flottant */
#aiAssistantBtn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.4);
    border: none;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse-glow 2s infinite;
}

#aiAssistantBtn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 15px 50px rgba(212, 175, 55, 0.6);
}

#aiAssistantBtn i {
    font-size: 28px;
    color: white;
}

#aiAssistantBtn .notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    animation: bounce 1s infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 10px 40px rgba(212, 175, 55, 0.4);
    }

    50% {
        box-shadow: 0 10px 50px rgba(212, 175, 55, 0.7);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Container du Chatbot */
#aiChatContainer {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 550px;
    max-height: calc(100vh - 6rem);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    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;
}

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

/* Masquer le bouton quand le chat est ouvert */
#aiChatContainer.active~#aiAssistantBtn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-header-text h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.chat-header-text p {
    font-size: 11px;
    opacity: 0.9;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

#closeChat {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
}

#closeChat:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

#closeChat i {
    font-size: 14px;
}

/* Quick Actions */
.quick-actions {
    padding: 0.75rem 1rem;
    background: linear-gradient(to bottom, #f9fafb 0%, white 100%);
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.quick-actions-title {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.quick-action-btn {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.3rem;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.quick-action-btn:hover {
    background: #f9fafb;
    border-color: #D4AF37;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quick-action-btn i {
    font-size: 14px;
    color: #D4AF37;
}

/* Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fafafa;
}

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

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

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Message Bubble */
.message {
    display: flex;
    gap: 12px;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: white;
}

.message.user .message-avatar {
    background: #228B22;
    color: white;
}

.message-bubble {
    max-width: 75%;
    padding: 0.875rem 1.125rem;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.message.ai .message-bubble {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #228B22 0%, #1B6B1B 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: right;
}

.message.ai .message-time {
    text-align: left;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

/* Input Area */
.chat-input-area {
    padding: 0.875rem 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 20px 20px;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.625rem;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 18px;
    padding: 0.75rem 1rem;
    font-size: 13px;
    resize: none;
    max-height: 80px;
    font-family: inherit;
    transition: all 0.2s;
}

#chatInput:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

#sendMessage {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-center;
    flex-shrink: 0;
    transition: all 0.2s;
}

#sendMessage:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

#sendMessage:active {
    transform: scale(0.95);
}

#sendMessage i {
    color: white;
    font-size: 16px;
}

/* Suggestions */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.625rem;
}

.suggestion-chip {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 0.4rem 0.75rem;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: #f9fafb;
    border-color: #D4AF37;
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    #aiChatContainer {
        right: 1rem;
        left: 1rem;
        width: auto;
        bottom: 1.5rem;
        height: calc(100vh - 4rem);
        max-height: calc(100vh - 4rem);
    }

    #aiAssistantBtn {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Powered By */
.powered-by {
    text-align: center;
    padding: 0.4rem;
    font-size: 9px;
    color: #9ca3af;
    background: #f9fafb;
    flex-shrink: 0;
}

.powered-by a {
    color: #D4AF37;
    text-decoration: none;
    font-weight: 600;
}

.powered-by a:hover {
    text-decoration: underline;
}