/* Rafa Chat - Clean & Elegant Porto Nobre */
.sofia-floating-chat {
    position: fixed !important;
    z-index: 2147483647 !important;
    pointer-events: none !important;
    user-select: none !important;
}

/* Botão Rafa - Clean com cores Porto Nobre */
.sofia-chat-button {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 66px !important;
    height: 66px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #c1592d, #d4af37) !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 16px rgba(193, 89, 45, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    pointer-events: auto !important;
    z-index: 2147483647 !important;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

.sofia-chat-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(193, 89, 45, 0.35) !important;
    background: linear-gradient(135deg, #b04d26, #c19b2f) !important;
}

.sofia-chat-button:active {
    transform: scale(0.96) !important;
    transition: all 0.1s ease !important;
}

.sofia-button-avatar {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background-image: url('attached_assets/image_1755692270371.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border: none !important;
}

.sofia-status-indicator {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    width: 10px !important;
    height: 10px !important;
    background: #22c55e !important;
    border-radius: 50% !important;
    border: 2px solid white !important;
}

/* Janela de chat - Clean e rápida */
.sofia-chat-window {
    position: fixed !important;
    bottom: 85px !important;
    right: 20px !important;
    width: 300px !important;
    height: 380px !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    z-index: 2147483646 !important;
    opacity: 0 !important;
    transform: translateY(10px) scale(0.95) !important;
    visibility: hidden !important;
    transition: all 0.15s ease !important;
    overflow: hidden !important;
    pointer-events: none !important;
    display: flex !important;
    flex-direction: column !important;
}

.sofia-chat-window.active {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Header clean com cores Porto Nobre */
.sofia-chat-header {
    padding: 12px 16px !important;
    background: linear-gradient(135deg, rgba(193, 89, 45, 0.05), rgba(212, 175, 55, 0.03)) !important;
    color: #1f2937 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid rgba(193, 89, 45, 0.1) !important;
    flex-shrink: 0 !important;
}

.sofia-agent-info {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.sofia-agent-avatar {
    width: 36px !important;
    height: 36px !important;
    background: transparent !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
}

.sofia-agent-avatar .sofia-mini-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background-image: url('attached_assets/image_1755692270371.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border: none !important;
}

.sofia-agent-details h3 {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #c1592d !important;
}

.sofia-agent-details p {
    margin: 1px 0 0 0 !important;
    font-size: 11px !important;
    color: #8b5a2b !important;
}

.sofia-chat-close {
    background: rgba(193, 89, 45, 0.1) !important;
    border: none !important;
    color: #c1592d !important;
    cursor: pointer !important;
    padding: 6px !important;
    border-radius: 50% !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
    font-size: 12px !important;
}

.sofia-chat-close:hover {
    background: rgba(193, 89, 45, 0.15) !important;
    color: #b04d26 !important;
}

/* Área de mensagens clean */
.sofia-chat-messages {
    flex: 1 !important;
    padding: 16px !important;
    overflow-y: auto !important;
    background: #fefefe !important;
}

.sofia-message {
    margin-bottom: 12px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    animation: sofiaMessageSlide 0.2s ease forwards !important;
}

.sofia-message.user {
    flex-direction: row-reverse !important;
}

.sofia-message-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background-image: url('attached_assets/image_1755692270371.png') !important;
    background-size: cover !important;
    background-position: center !important;
    flex-shrink: 0 !important;
    border: none !important;
}

.sofia-message.user .sofia-message-avatar {
    background: linear-gradient(135deg, #c1592d, #d4af37) !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
}

.sofia-message.user .sofia-message-avatar::after {
    content: '👤' !important;
}

.sofia-message-content {
    max-width: 200px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}

.sofia-message.sofia .sofia-message-content,
.sofia-message.ai .sofia-message-content {
    background: #f8f9fa !important;
    color: #1f2937 !important;
    border-bottom-left-radius: 4px !important;
    border: none !important;
}

.sofia-message.user .sofia-message-content {
    background: linear-gradient(135deg, #c1592d, #d4af37) !important;
    color: white !important;
    border-bottom-right-radius: 4px !important;
}

/* Área de input clean com cores Porto Nobre */
.sofia-chat-input {
    padding: 12px 16px !important;
    background: rgba(193, 89, 45, 0.02) !important;
    border-top: 1px solid rgba(193, 89, 45, 0.1) !important;
    flex-shrink: 0 !important;
}

.sofia-input-wrapper {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    background: white !important;
    border: 1px solid rgba(193, 89, 45, 0.15) !important;
    border-radius: 8px !important;
    padding: 2px !important;
}

.sofia-input-wrapper:focus-within {
    border-color: #c1592d !important;
    box-shadow: 0 0 0 1px rgba(193, 89, 45, 0.2) !important;
}

#sofiaInputField {
    flex: 1 !important;
    border: none !important;
    outline: none !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    background: transparent !important;
    color: #1f2937 !important;
}

#sofiaInputField::placeholder {
    color: #9ca3af !important;
}

.sofia-send-button {
    width: 32px !important;
    height: 32px !important;
    background: linear-gradient(135deg, #c1592d, #d4af37) !important;
    border: none !important;
    border-radius: 6px !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
    font-size: 12px !important;
}

.sofia-send-button:hover {
    background: linear-gradient(135deg, #b04d26, #c19b2f) !important;
}

.sofia-typing-indicator {
    margin-top: 6px !important;
    color: #c1592d !important;
    font-size: 11px !important;
    display: none !important;
    align-items: center !important;
    gap: 4px !important;
}

.sofia-typing-indicator.active {
    display: flex !important;
}

/* Mobile responsivo */
@media (max-width: 768px) {
    .sofia-chat-window {
        width: calc(100vw - 20px) !important;
        max-width: 300px !important;
        height: 360px !important;
        bottom: 75px !important;
        right: 15px !important;
    }
    
    .sofia-chat-button {
        width: 64px !important;
        height: 64px !important;
        bottom: 18px !important;
        right: 18px !important;
    }
    
    .sofia-button-avatar {
        width: 48px !important;
        height: 48px !important;
    }
}

/* Animações simples */
@keyframes sofiaMessageSlide {
    from {
        opacity: 0 !important;
        transform: translateY(5px) !important;
    }
    to {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}