/**
 * Estilos públicos do Digicare Chatbot
 */

/* Container principal */
.digicare-chatbot-container {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.digicare-chatbot-container[data-position="right"] {
    right: 20px;
}

.digicare-chatbot-container[data-position="left"] {
    left: 20px;
}

/* Botão flutuante */
.digicare-chatbot-button {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0073aa;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.digicare-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.digicare-chatbot-button:active {
    transform: scale(0.95);
}

.digicare-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Janela do chat */
.digicare-chatbot-window {
    position: absolute;
    bottom: 80px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.digicare-chatbot-container[data-position="right"] .digicare-chatbot-window {
    right: 0;
}

.digicare-chatbot-container[data-position="left"] .digicare-chatbot-window {
    left: 0;
}

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

/* Header */
.digicare-chatbot-header {
    background-color: #0073aa;
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.bot-avatar {
    flex-shrink: 0;
}

.header-info {
    flex-grow: 1;
}

.bot-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.digicare-chatbot-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

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

/* Área de mensagens */
.digicare-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
    scroll-behavior: smooth;
}

.digicare-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.digicare-chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.digicare-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Mensagens */
.digicare-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: messageIn 0.3s ease;
}

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

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

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0073aa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.digicare-chatbot-message.user .message-bubble {
    background: #0073aa;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.digicare-chatbot-message.bot .message-bubble {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Typing indicator */
.digicare-typing-indicator {
    padding: 0 20px 10px;
    display: flex;
    gap: 4px;
}

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

/* Quick Replies */
.digicare-quick-replies {
    padding: 0 20px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.digicare-quick-reply {
    background: #fff;
    border: 2px solid #0073aa;
    color: #0073aa;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.digicare-quick-reply:hover {
    background: #0073aa;
    color: #fff;
    transform: translateY(-2px);
}

/* Produtos */
.product-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.product-info {
    flex: 1;
}

.product-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.product-price {
    color: #2ecc71;
    font-weight: bold;
    font-size: 16px;
}

.product-stock {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.product-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.product-btn-primary {
    background: #0073aa;
    color: #fff;
}

.product-btn-primary:hover {
    background: #005a87;
}

.product-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.product-btn-secondary:hover {
    background: #e0e0e0;
}

/* Input */
.digicare-chatbot-input {
    display: flex;
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.message-input:focus {
    border-color: #0073aa;
}

.digicare-chatbot-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0073aa;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.digicare-chatbot-send-btn:hover {
    background: #005a87;
    transform: scale(1.05);
}

.digicare-chatbot-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.digicare-chatbot-footer {
    padding: 8px;
    text-align: center;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

.digicare-chatbot-footer small {
    color: #999;
    font-size: 11px;
}

/* WhatsApp Button */
.whatsapp-redirect-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25d366;
    color: #fff;
    padding: 10px 16px;
    border-radius: 24px;
    text-decoration: none;
    font-size: 14px;
    margin-top: 8px;
    transition: all 0.2s;
}

.whatsapp-redirect-btn:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

/* Responsive */
@media screen and (max-width: 480px) {
    .digicare-chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        left: 10px !important;
        right: 10px !important;
    }

    .digicare-chatbot-button {
        width: 56px;
        height: 56px;
    }

    .message-bubble {
        max-width: 85%;
    }
}

/* Utilitários */
.digicare-hidden {
    display: none !important;
}

.digicare-fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
