/* ==========================================
   LIVE CHAT WIDGET - Polyclinique St Philippe
   ========================================== */

/* Chat button flottant */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0A9C38; /* Vert du logo */
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(10, 156, 56, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    transition: all 0.3s ease;
    position: relative;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(10, 156, 56, 0.5);
}

.chat-button.active {
    background: #E3001B; /* Rouge du logo */
}

/* Badge notification */
.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #E3001B;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    border: 2px solid white;
}

/* Fenêtre de chat */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header du chat */
.chat-header {
    background: linear-gradient(135deg, #0A9C38, #088530);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0A9C38;
    font-weight: bold;
    font-size: 1.25rem;
}

.chat-header-text h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.chat-status {
    font-size: 0.75rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: transform 0.2s;
}

.chat-close:hover {
    transform: rotate(90deg);
}

/* Corps du chat */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

/* Messages */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

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

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

.message-time {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 4px;
}

/* Message assistant */
.message.bot {
    align-self: flex-start;
}

.message.bot .message-content {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Message utilisateur */
.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.user .message-content {
    background: linear-gradient(135deg, #0A9C38, #088530);
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.message.user .message-time {
    text-align: right;
}

/* Quick replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-reply {
    padding: 8px 16px;
    border: 1px solid #0A9C38;
    background: white;
    color: #0A9C38;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply:hover {
    background: #0A9C38;
    color: white;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    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);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Footer du chat */
.chat-footer {
    padding: 16px;
    border-top: 1px solid #e9ecef;
    background: white;
    border-radius: 0 0 12px 12px;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #0A9C38;
}

.chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0A9C38;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.chat-send:hover {
    background: #088530;
    transform: scale(1.05);
}

.chat-send:disabled {
    background: #dee2e6;
    cursor: not-allowed;
}

/* Scrollbar personnalisé */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f8f9fa;
}

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

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 90px;
        height: 500px;
    }
    
    .chat-button {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        bottom: 20px;
        right: 20px;
    }
}
