/* chatbot-myrh.css - Styles adaptés au site MyRH */

/* Variables de couleurs MyRH */
:root {
    --myrh-primary: #8000ff;
    --myrh-secondary: #4343FF;
    --myrh-dark: #2a2a2a;
    --myrh-light: #f8f9fa;
    --myrh-text: #333333;
    --myrh-shadow: 0 4px 20px rgba(128, 0, 255, 0.15);
}

/* Container principal - FIXE et non pleine page */
.myrh-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Bouton d'ouverture style MyRH */
.myrh-chatbot-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--myrh-primary) 0%, var(--myrh-secondary) 100%);
    border: none;
    cursor: pointer;
    box-shadow: var(--myrh-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

.myrh-chatbot-toggle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.6s;
}

.myrh-chatbot-toggle:hover::before {
    transform: scale(1);
}

.myrh-chatbot-toggle:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 8px 30px rgba(128, 0, 255, 0.3);
}

.myrh-chatbot-toggle svg {
    width: 35px;
    height: 35px;
    fill: white;
    position: relative;
    z-index: 1;
}

/* Badge notification animé */
.myrh-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse-badge 2s infinite;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
}

@keyframes pulse-badge {
    0% { transform: scale(1); box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 2px 12px rgba(255, 68, 68, 0.6); }
    100% { transform: scale(1); box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4); }
}

/* Fenêtre de chat - TAILLE FIXE */
.myrh-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 420px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(128, 0, 255, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.myrh-chatbot-window.active {
    display: flex;
    animation: slideInUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header du chat style MyRH */
.myrh-chatbot-header {
    background: linear-gradient(135deg, var(--myrh-primary) 0%, var(--myrh-secondary) 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.myrh-chatbot-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate-bg 20s linear infinite;
}

@keyframes rotate-bg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.myrh-chatbot-header-info {
    position: relative;
    z-index: 1;
}

.myrh-chatbot-header-info h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.myrh-chatbot-status {
    display: flex;
    align-items: center;
    font-size: 13px;
    opacity: 0.9;
    margin-top: 5px;
}

.myrh-chatbot-status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    animation: blink-status 3s infinite;
}

@keyframes blink-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.myrh-chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.myrh-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Zone de messages */
.myrh-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #fafbfc;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(128, 0, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(67, 67, 255, 0.03) 0%, transparent 50%);
}

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

.myrh-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.myrh-chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--myrh-primary);
    border-radius: 3px;
}

/* Messages */
.myrh-message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeInMessage 0.4s ease;
}

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

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

.myrh-message-content {
    max-width: 75%;
    padding: 14px 20px;
    border-radius: 20px;
    word-wrap: break-word;
    white-space: pre-line;
    position: relative;
    font-size: 15px;
    line-height: 1.5;
}

.myrh-message.bot .myrh-message-content {
    background: white;
    color: var(--myrh-text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-bottom-left-radius: 5px;
}

.myrh-message.user .myrh-message-content {
    background: linear-gradient(135deg, var(--myrh-primary) 0%, var(--myrh-secondary) 100%);
    color: white;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 10px rgba(128, 0, 255, 0.2);
}

/* Boutons dans les messages */
.myrh-message-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.myrh-message-button {
    padding: 10px 18px;
    border: 2px solid var(--myrh-primary);
    background: white;
    color: var(--myrh-primary);
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.myrh-message-button:hover {
    background: var(--myrh-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(128, 0, 255, 0.2);
}

/* Indicateur de frappe */
.myrh-typing {
    display: inline-flex;
    align-items: center;
    padding: 14px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

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

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

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

/* Zone de saisie */
.myrh-chatbot-input {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.myrh-chatbot-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.myrh-chatbot-input-field {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
}

.myrh-chatbot-input-field:focus {
    border-color: var(--myrh-primary);
    box-shadow: 0 0 0 3px rgba(128, 0, 255, 0.1);
}

.myrh-chatbot-send {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--myrh-primary) 0%, var(--myrh-secondary) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(128, 0, 255, 0.2);
}

.myrh-chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(128, 0, 255, 0.3);
}

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

.myrh-chatbot-send svg {
    width: 22px;
    height: 22px;
    fill: white;
}

/* Message de bienvenue popup */
.myrh-welcome-popup {
    position: absolute;
    bottom: 85px;
    right: 0;
    background: white;
    padding: 18px 24px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(128, 0, 255, 0.15);
    max-width: 300px;
    animation: fadeIn 0.5s ease;
    display: none;
    font-size: 15px;
    color: var(--myrh-text);
}

.myrh-welcome-popup.show {
    display: block;
}

.myrh-welcome-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 35px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

/* Responsive mobile */
@media (max-width: 480px) {
    .myrh-chatbot {
        bottom: 10px;
        right: 10px;
    }
    
    .myrh-chatbot-toggle {
        width: 60px;
        height: 60px;
    }
    
    .myrh-chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 10px;
        border-radius: 15px;
    }
    
    .myrh-chatbot-header {
        padding: 15px 20px;
    }
    
    .myrh-chatbot-messages {
        padding: 20px;
    }
    
    .myrh-message-content {
        font-size: 14px;
    }
}