/* ========================================
   CHATBOT - SRM TTA (WordPress Theme)
   Design moderne et élégant
   ======================================== */

.chatbot-container {
    position: fixed !important;
    bottom: 100px !important;
    right: 30px !important;
    z-index: 99999 !important;
    font-family: 'Hind', sans-serif;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    filter: drop-shadow(0 10px 30px rgba(74, 113, 170, 0.3));
}

/* Bouton d'ouverture du chatbot */
.chatbot-toggle {
    width: 65px !important;
    height: 65px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #4a71aa 0%, #3498db 50%, #2ecc71 100%) !important;
    border: 4px solid rgba(255, 255, 255, 0.9) !important;
    color: white !important;
    font-size: 28px !important;
    cursor: pointer !important;
    box-shadow: 0 8px 25px rgba(74, 113, 170, 0.5), 
                0 0 0 0 rgba(74, 113, 170, 0.4),
                inset 0 2px 10px rgba(255, 255, 255, 0.3) !important;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: pulse-chatbot 2s infinite !important;
}

@keyframes pulse-chatbot {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(74, 113, 170, 0.5), 
                    0 0 0 0 rgba(74, 113, 170, 0.4),
                    inset 0 2px 10px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 25px rgba(74, 113, 170, 0.6), 
                    0 0 0 10px rgba(74, 113, 170, 0),
                    inset 0 2px 10px rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.4s ease;
}

.chatbot-toggle:hover::before {
    transform: scale(1.4);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(74, 113, 170, 0.6),
                0 0 0 8px rgba(74, 113, 170, 0.2);
}

.chatbot-toggle.active {
    transform: rotate(180deg);
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.chatbot-toggle .fa-comments {
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.chatbot-toggle.active .fa-comments::before {
    content: "\f00d";
}

/* Notification badge */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 3px solid white;
    animation: pulse-badge 2s infinite;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.5);
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.9;
    }
}

.chatbot-badge.hidden {
    display: none;
}

/* Fenêtre du chatbot */
.chatbot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 390px;
    height: 620px;
    max-height: 80vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(74, 113, 170, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.85) translateY(30px) rotate(2deg);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chatbot-window.active {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(0deg);
    pointer-events: all;
    animation: slideUpFade 0.4s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* En-tête du chatbot */
.chatbot-header {
    background: linear-gradient(135deg, #4a71aa 0%, #3498db 50%, #2ecc71 100%);
    color: white;
    padding: 22px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 25px 25px 0 0;
    box-shadow: 0 4px 15px rgba(74, 113, 170, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.chatbot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                inset 0 2px 5px rgba(255, 255, 255, 0.3);
    animation: avatarPulse 2s infinite;
}

@keyframes avatarPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                    inset 0 2px 5px rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3),
                    inset 0 2px 5px rgba(255, 255, 255, 0.4);
    }
}

.chatbot-header-text {
    position: relative;
    z-index: 1;
}

.chatbot-header-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chatbot-header-text p {
    font-size: 12px;
    margin: 2px 0 0 0;
    opacity: 0.95;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.chatbot-status {
    width: 12px;
    height: 12px;
    background: #27ae60;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 8px rgba(39, 174, 96, 0.6);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.3);
        box-shadow: 0 0 15px rgba(39, 174, 96, 0.8);
    }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(5px);
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Zone de messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

.chatbot-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.8), transparent);
    pointer-events: none;
    z-index: 1;
}

.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4a71aa 0%, #3498db 100%);
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
}

/* Message */
.chatbot-message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
    position: relative;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.bot {
    justify-content: flex-start;
}

.chatbot-message.user {
    justify-content: flex-end;
}

.chatbot-message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chatbot-message.bot .chatbot-message-avatar {
    background: linear-gradient(135deg, #4a71aa 0%, #3498db 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-message.user .chatbot-message-avatar {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-message-content {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
}

.chatbot-message.bot .chatbot-message-content {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
    color: #2c3e50;
    border-bottom-left-radius: 6px;
    box-shadow: 0 3px 12px rgba(74, 113, 170, 0.15),
                0 1px 3px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-left: 4px solid #4a71aa;
}

.chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, #4a71aa 0%, #3498db 50%, #2ecc71 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(74, 113, 170, 0.4),
                0 1px 3px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.chatbot-message-content a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

/* Options rapides */
.chatbot-quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.chatbot-quick-option {
    padding: 10px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #4a71aa;
    color: #4a71aa;
    border-radius: 25px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 113, 170, 0.15);
    position: relative;
    overflow: hidden;
}

.chatbot-quick-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 113, 170, 0.1), transparent);
    transition: left 0.5s;
}

.chatbot-quick-option:hover::before {
    left: 100%;
}

.chatbot-quick-option:hover {
    background: linear-gradient(135deg, #4a71aa 0%, #3498db 100%);
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 15px rgba(74, 113, 170, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: #3498db;
}

/* Zone de saisie */
.chatbot-input-area {
    padding: 18px 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 2px solid rgba(74, 113, 170, 0.1);
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
}

.chatbot-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid rgba(74, 113, 170, 0.2);
    border-radius: 30px;
    font-size: 14px;
    font-family: 'Hind', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05),
                inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chatbot-input:focus {
    border-color: #4a71aa;
    box-shadow: 0 4px 15px rgba(74, 113, 170, 0.2),
                0 0 0 4px rgba(74, 113, 170, 0.1),
                inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.chatbot-input::placeholder {
    color: #95a5a6;
}

.chatbot-send {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a71aa 0%, #3498db 50%, #2ecc71 100%);
    border: 3px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(74, 113, 170, 0.3),
                inset 0 2px 5px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.chatbot-send::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.chatbot-send:hover::before {
    width: 100%;
    height: 100%;
}

.chatbot-send:hover {
    transform: scale(1.15) rotate(15deg);
    box-shadow: 0 6px 20px rgba(74, 113, 170, 0.5),
                inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.chatbot-send:active {
    transform: scale(1.05) rotate(0deg);
}

/* Typing indicator */
.chatbot-typing {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #4a71aa 0%, #3498db 100%);
    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% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        max-width: 390px;
        height: calc(100vh - 120px);
        max-height: 620px;
        border-radius: 20px;
    }

    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-toggle {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .chatbot-header {
        border-radius: 20px 20px 0 0;
        padding: 18px 15px;
    }

    .chatbot-input-area {
        padding: 15px;
    }
}








