/* ==========================================================================
   SolMed Landing Chatbot - Estilos del widget de chat
   ========================================================================== */

/* Boton flotante */
.solmed-chat-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0072CE 0%, #00AEEF 100%);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 114, 206, 0.4);
    z-index: 9998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.solmed-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 114, 206, 0.5);
}

.solmed-chat-btn .chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FF4757;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: chatBadgePulse 2s infinite;
}

@keyframes chatBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Panel de chat */
.solmed-chat-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 370px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.solmed-chat-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header del chat */
.solmed-chat-header {
    background: linear-gradient(135deg, #0072CE 0%, #00AEEF 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.solmed-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.solmed-chat-header-info {
    flex: 1;
}

.solmed-chat-header-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.solmed-chat-header-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.85;
}

.solmed-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.solmed-chat-close:hover {
    opacity: 1;
}

/* Area de mensajes */
.solmed-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fc;
}

.solmed-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.solmed-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.solmed-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Mensajes individuales */
.chat-msg {
    max-width: 85%;
    display: flex;
    flex-direction: column;
}

.chat-msg.bot {
    align-self: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
}

.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-msg.bot .chat-msg-bubble {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.chat-msg.user .chat-msg-bubble {
    background: linear-gradient(135deg, #0072CE 0%, #00AEEF 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.chat-msg.user .chat-msg-time {
    text-align: right;
}

/* Indicador de escritura */
.chat-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    align-self: flex-start;
    max-width: 70px;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #bbb;
    animation: typingDot 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Botones de opciones */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chat-option-btn {
    background: #fff;
    border: 1.5px solid #0072CE;
    color: #0072CE;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.chat-option-btn:hover {
    background: #0072CE;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 114, 206, 0.3);
}

.chat-option-btn i {
    margin-right: 6px;
}

/* Area de input */
.solmed-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    align-items: center;
    background: #fff;
    flex-shrink: 0;
}

.solmed-chat-input {
    flex: 1;
    border: 1.5px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Poppins', sans-serif;
}

.solmed-chat-input:focus {
    border-color: #0072CE;
}

.solmed-chat-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.solmed-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0072CE 0%, #00AEEF 100%);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.solmed-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 114, 206, 0.3);
}

.solmed-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Powered by footer */
.solmed-chat-footer {
    text-align: center;
    padding: 6px;
    font-size: 11px;
    color: #bbb;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 480px) {
    .solmed-chat-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .solmed-chat-btn {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
        font-size: 22px;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .solmed-chat-panel {
        width: 340px;
        height: 480px;
        bottom: 88px;
        right: 16px;
    }
}
