/* ============================================================
   LOGGI FLOATING CHATBOT - STYLESHEET
   Responsivo, Mobile-First, Oficial Loggi
   ============================================================ */

/* Botão Flutuante */
.loggi-chat-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0055FE 0%, #003DB3 100%);
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 85, 254, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.loggi-chat-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(0, 85, 254, 0.45);
}

.loggi-chat-badge-pulse {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #10B981;
    border: 2.5px solid #FFFFFF;
    border-radius: 50%;
    animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Janela do Chat */
.loggi-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: #FFFFFF;
    border-radius: 18px;
    box-shadow: 0 20px 45px rgba(7, 19, 48, 0.22);
    border: 1px solid #E2E8F0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    animation: chatSlideUp 0.25s ease-out;
}

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

/* Header */
.loggi-chat-header {
    background: linear-gradient(135deg, #0055FE 0%, #003DB3 100%);
    color: #FFFFFF;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-attendant-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attendant-avatar {
    width: 38px;
    height: 38px;
    background: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.attendant-avatar img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.attendant-name {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.attendant-status {
    font-size: 0.74rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #34D399;
    border-radius: 50%;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 6px;
    opacity: 0.85;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close-btn:hover {
    opacity: 1;
}

/* Área de Mensagens */
.loggi-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-wrap: break-word;
}

.chat-msg.bot {
    background: #FFFFFF;
    color: #1E293B;
    border: 1px solid #E2E8F0;
    border-top-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.chat-msg.user {
    background: #0055FE;
    color: #FFFFFF;
    border-top-right-radius: 4px;
    align-self: flex-end;
}

.chat-time {
    font-size: 0.68rem;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

/* Card de Encomenda dentro do Chat */
.chat-order-card {
    background: #FFFFFF;
    border: 1px solid #BFDBFE;
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 85, 254, 0.08);
}

.chat-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #0F172A;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.chat-order-row {
    font-size: 0.78rem;
    color: #475569;
    margin-bottom: 4px;
}

.chat-order-row strong {
    color: #0F172A;
}

.chat-order-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.btn-chat-pay {
    background: #0055FE;
    color: #FFFFFF !important;
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
    display: block;
}

.btn-chat-pay:hover {
    background: #0043CA;
}

.btn-chat-link {
    color: #0055FE !important;
    text-align: center;
    font-size: 0.76rem;
    text-decoration: underline;
    font-weight: 600;
}

/* Sugestões / Quick Chips */
.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.chat-chip {
    background: #EBF2FF;
    color: #0055FE;
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.chat-chip:hover {
    background: #0055FE;
    color: #FFFFFF;
}

/* Input Area */
.loggi-chat-input-area {
    padding: 10px 12px;
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input {
    flex: 1;
    border: 1px solid #CBD5E1;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 0.88rem;
    outline: none;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #0055FE;
    box-shadow: 0 0 0 2px rgba(0, 85, 254, 0.15);
}

.chat-send-btn {
    background: #0055FE;
    color: #FFFFFF;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

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

/* Mobile Adjustments */
@media (max-width: 600px) {
    .loggi-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 82vh;
        max-height: 82vh;
        border-radius: 20px 20px 0 0;
    }
    .loggi-chat-trigger {
        bottom: 18px;
        right: 18px;
        width: 54px;
        height: 54px;
    }
}
