/* Chat Flutuante AllesMed - Estilos Premium */
#allesmed-support-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#allesmed-support-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4), 0 8px 10px -6px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#allesmed-support-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 20px 25px -5px rgba(16, 185, 129, 0.5), 0 10px 10px -5px rgba(16, 185, 129, 0.5);
}

#allesmed-support-btn.active {
    transform: rotate(135deg) scale(0.9);
    background: #ef4444;
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.4);
}

#allesmed-support-chatbox {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#allesmed-support-chatbox.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#allesmed-chat-header {
    padding: 18px 20px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

#allesmed-chat-header .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
}

#allesmed-chat-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.025em;
}

#allesmed-chat-header p {
    margin: 2px 0 0 0;
    color: #94a3b8;
    font-size: 11px;
}

#allesmed-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Chat */
#allesmed-chat-body::-webkit-scrollbar {
    width: 6px;
}
#allesmed-chat-body::-webkit-scrollbar-track {
    background: transparent;
}
#allesmed-chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
#allesmed-chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.allesmed-msg {
    max-width: 80%;
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: msgFadeIn 0.25s ease-out forwards;
}

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

.allesmed-msg.system {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border-top-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.allesmed-msg.user {
    align-self: flex-end;
    background: #059669;
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.2);
}

.allesmed-msg p {
    margin: 0 0 8px 0;
}
.allesmed-msg p:last-child {
    margin-bottom: 0;
}
.allesmed-msg ul, .allesmed-msg ol {
    margin: 6px 0;
    padding-left: 20px;
}
.allesmed-msg li {
    margin-bottom: 4px;
}

#allesmed-chat-footer {
    padding: 15px 20px 20px;
    background: rgba(15, 23, 42, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 10px;
    align-items: center;
}

#allesmed-chat-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

#allesmed-chat-input::placeholder {
    color: #64748b;
}

#allesmed-chat-input:focus {
    border-color: #10b981;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

#allesmed-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#allesmed-chat-send:hover {
    background: #059669;
    transform: scale(1.05);
}

#allesmed-chat-send:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: #64748b;
    cursor: not-allowed;
    transform: none;
}

/* Typing indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 6px;
    align-items: center;
}
.typing-dots span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite both;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
    #allesmed-support-chatbox {
        width: calc(100vw - 40px);
        height: 480px;
        right: 0;
    }
}
