/* ==========================================================================
   CHATBOT STYLES - VERSION COMPLÈTE
   ========================================================================== */

:root {
    --chatbot-primary: #FF3332;
    --chatbot-secondary: #FF854A;
    --chatbot-success: #28a745;
    --chatbot-obout: #4CAF50;
    --chatbot-bg: #FEFEFE;
    --chatbot-text: #180707;
    --chatbot-border: #e9ecef;
    --chatbot-shadow: 0 10px 30px rgba(255, 51, 50, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ==========================================================================
   BOUTON FLOTTANT CHATBOT
   ========================================================================== */
.chatbot-float {
    position: fixed;
    bottom: 40px;
    right: 30px;
    z-index: 1000;
    cursor: pointer;
    transform: translateX(150px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-float.show {
    transform: translateX(0);
    opacity: 1;
    animation: slideInFromRight 1s ease-out forwards;
}

.chatbot-float.compact {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: transparent !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    bottom: 40px !important;
    right: 30px !important;
}

.chatbot-float.compact .chatbot-float-content {
    background: transparent !important;
    padding: 0 !important;
    min-width: auto !important;
    gap: 0 !important;
    box-shadow: none !important;
}

.chatbot-float.compact .chatbot-float-text {
    display: none !important;
}

.chatbot-float.compact .chatbot-float-avatar {
    display: flex !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    border: none !important;
    background: transparent !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

.chatbot-float.compact .chatbot-float-avatar img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    background: white !important;
}

.chatbot-float.compact .chatbot-avatar-fallback {
    display: none !important;
    width: 100% !important;
    height: 100% !important;
    background: #2F5F7A !important;
    border-radius: 50% !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 24px !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

.chatbot-avatar-fallback {
    width: 100%;
    height: 100%;
    background: #2F5F7A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    position: absolute;
    top: 0;
    left: 0;
}

.chatbot-float-content {
    background: linear-gradient(135deg, #FF3332 0%, #FF854A 100%);
    border-radius: 30px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--chatbot-shadow);
    position: relative;
    overflow: hidden;
    min-width: 200px;
    height: 60px;
}

.chatbot-float-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.chatbot-float:hover .chatbot-float-content::before {
    left: 100%;
}

.chatbot-float-text {
    color: white;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.chatbot-float-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: none;
    background: white;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.chatbot-float-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(150px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes compactPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5);
    }
}

/* ==========================================================================
   MODAL CHATBOT
   ========================================================================== */
.chatbot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.chatbot-modal.show {
    display: flex;
    opacity: 1;
}

.chatbot-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--chatbot-shadow);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.chatbot-modal.show .chatbot-content {
    transform: scale(1);
}

/* ==========================================================================
   HEADER CHATBOT
   ========================================================================== */
.chatbot-header {
    background: linear-gradient(135deg, #FF3332 0%, #FF854A 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.chatbot-agent-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 0px solid white;
    object-fit: cover;
    object-position: center top;
    background: white;
    padding: 0px;
}

.chatbot-agent-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: background 0.3s ease;
    line-height: 1;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   CORPS CHATBOT
   ========================================================================== */
.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--chatbot-bg);
}

/* ==========================================================================
   MESSAGES DE CHAT
   ========================================================================== */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #FF3332 0%, #FF854A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    background: transparent;
}

/* Avatar utilisateur générique (icône) */
.message-avatar.user-icon {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.message-avatar .user-initial {
    font-size: 18px;
    line-height: 1;
}

.user-message .message-avatar {
    order: 2;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 75%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.bot-message .message-content {
    background: linear-gradient(135deg, #FF3332 0%, #FF854A 100%);
    color: white;
    border-bottom-left-radius: 4px;
}

.user-message .message-content {
    background: #e3f2fd;
    color: var(--chatbot-text);
    border-bottom-right-radius: 4px;
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

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

/* ==========================================================================
   BOUTONS DE CHOIX
   ========================================================================== */
.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.choice-btn {
    background: white;
    border: 2px solid var(--chatbot-primary);
    color: var(--chatbot-primary);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.choice-btn:hover {
    background: linear-gradient(135deg, #FF3332 0%, #FF854A 100%);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 51, 50, 0.3);
}

.choice-btn i {
    font-size: 18px;
}

/* ==========================================================================
   CARTES FORFAITS
   ========================================================================== */
.forfaits-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.forfait-card {
    background: white;
    border: 2px solid var(--chatbot-border);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.forfait-card.popular {
    border-color: var(--chatbot-secondary);
}

.forfait-card:hover {
    border-color: var(--chatbot-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.forfait-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--chatbot-secondary);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.forfait-title {
    color: var(--chatbot-primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.forfait-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--chatbot-secondary);
    margin: 10px 0;
}

.forfait-features {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.forfait-features li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.forfait-features li i {
    color: var(--chatbot-success);
    font-size: 16px;
}

.forfait-btn {
    width: 100%;
    background: linear-gradient(135deg, #FF3332 0%, #FF854A 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.forfait-btn:hover {
    background: linear-gradient(135deg, #e62e2d 0%, #e67a4a 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 51, 50, 0.3);
}

/* ==========================================================================
   FORMULAIRE
   ========================================================================== */
.form-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 15px;
}

.form-title {
    color: var(--chatbot-primary);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: var(--chatbot-text);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--chatbot-border);
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--chatbot-border);
    border-radius: 10px;
    font-size: 14px;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--chatbot-primary);
}

.form-submit {
    width: 100%;
    background: var(--chatbot-success);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-submit:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* ==========================================================================
   OBOUT RECOMMANDATION
   ========================================================================== */
.obout-recommendation {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 12px;
    padding: 18px;
    color: white;
    text-align: center;
    margin-top: 12px;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.25);
}

.obout-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.obout-logo img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.obout-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.obout-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 14px;
}

.obout-benefits {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin: 14px 0;
    text-align: left;
}

.obout-benefits h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.obout-benefits ul {
    list-style: none;
    padding: 0;
}

.obout-benefits li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.obout-benefits li i {
    color: #fff;
}

.obout-whatsapp {
    background: #25D366;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-top: 10px;
}

.obout-whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4);
}

/* ==========================================================================
   INDICATEUR DE SAISIE
   ========================================================================== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    max-width: fit-content;
    margin-left: 45px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

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

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes urgentPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 15px 40px rgba(255, 107, 107, 0.5);
    }
}

/* ==========================================================================
   NOTIFICATIONS
   ========================================================================== */
.chatbot-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    max-width: 350px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-notification.show {
    transform: translateX(0);
}

.chatbot-notification-success {
    background: var(--chatbot-success);
}

.chatbot-notification-error {
    background: #dc3545;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablettes */
@media (max-width: 1024px) and (min-width: 769px) {
    .chatbot-float {
        bottom: 30px;
        right: 20px;
        z-index: 1000;
    }
    
    .chatbot-float-content {
        min-width: 180px;
        padding: 8px 15px;
        height: 55px;
    }
    
    .chatbot-float-avatar {
        width: 50px;
        height: 50px;
        border: none;
        background: transparent;
    }
    
    .chatbot-float-text {
        margin-right: 25px;
        font-size: 14px;
    }
    
    .chatbot-float.compact {
        width: 58px !important;
        height: 58px !important;
        bottom: 30px !important;
        right: 20px !important;
    }
    
    .chatbot-float.compact .chatbot-float-avatar {
        width: 54px !important;
        height: 54px !important;
    }
}
@media (max-width: 768px) {
    .chatbot-float {
        bottom: 25px;
        right: 15px;
        z-index: 1000;
    }
    
    .chatbot-float-content {
        min-width: 160px;
        padding: 6px 12px;
        height: 50px;
    }
    
    .chatbot-float-avatar {
        width: 45px;
        height: 45px;
        border: none;
        background: white; /* fond blanc en mobile */
    }
    
    .chatbot-float-text {
        margin-right: 20px;
        font-size: 13px;
    }
    
    .chatbot-float.compact {
        width: 55px !important;
        height: 55px !important;
        bottom: 25px !important;
        right: 15px !important;
    }
    
    .chatbot-float.compact .chatbot-float-avatar {
        width: 51px !important;
        height: 51px !important;
        background: white !important; /* fond blanc en mobile compact */
        padding: 0 !important;
    }
    
    .chatbot-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .chatbot-header {
        padding: 15px;
    }
    
    .chatbot-agent-info h3 {
        font-size: 14px;
    }
    
    .message-content {
        max-width: 80%;
    }
    
    .forfait-price {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .chatbot-float {
        bottom: 20px;
        right: 10px;
        z-index: 1000;
    }
    
    .chatbot-float-content {
        min-width: 130px;
        padding: 5px 10px;
        height: 45px;
    }
    
    .chatbot-float-text {
        font-size: 12px;
        margin-right: 15px;
    }
    
    .chatbot-float-avatar {
        width: 40px;
        height: 40px;
        border: none;
        background: white; /* fond blanc en petit mobile */
    }
    
    .chatbot-float.compact {
        width: 50px !important;
        height: 50px !important;
        bottom: 20px !important;
        right: 10px !important;
    }
    
    .chatbot-float.compact .chatbot-float-avatar {
        width: 46px !important;
        height: 46px !important;
        background: white !important;
    }
}