/* =========================================
   uitech-chat.css - Responsive Luxury Widget
   ========================================= */

/* Floating Button (FAB) - Perfect Circle (Lock to the Right!) */
.chat-fab {
    position: fixed !important;
    bottom: 25px !important;
    right: 25px !important;
    left: auto !important; /* Evita que el tema lo jale a la izquierda */
    width: 65px;
    height: 65px;
    padding: 0;
    background: linear-gradient(135deg, #0ea5e9 0%, #0f172a 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.4);
    z-index: 10001 !important;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-fab:hover { transform: scale(1.08) translateY(-5px); box-shadow: 0 15px 35px rgba(14, 165, 233, 0.5); }
.chat-fab span { display: none; }

/* Circular Logo */
.agent-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    margin-right: 12px;
    object-fit: cover;
}

/* Chat Window - Lock to the Right! */
.chat-window {
    position: fixed !important;
    bottom: 105px !important;
    right: 25px !important;
    left: auto !important; /* ESTO ES LO QUE ARREGLA TU PROBLEMA */
    width: 380px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10002 !important;
    font-family: 'Manrope', sans-serif;
    border: 1px solid rgba(15, 23, 42, 0.08);
    animation: uitechSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-window.active { display: flex !important; }

/* --- CUSTOM CONFIRMATION POPUP --- */
.chat-custom-popup {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10005;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.chat-custom-popup.active { opacity: 1; pointer-events: auto; }
.chat-popup-card {
    background: white; padding: 25px; border-radius: 8px;
    text-align: center; width: 85%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: translateY(20px); transition: transform 0.3s ease;
}
.chat-custom-popup.active .chat-popup-card { transform: translateY(0); }
.popup-icon { font-size: 35px; color: #0ea5e9; margin-bottom: 15px; }
.chat-popup-card h4 { margin: 0 0 10px 0; font-family: 'Playfair Display', serif; color: #0f172a; font-size: 18px; }
.chat-popup-card p { font-size: 13px; color: #64748b; margin-bottom: 20px; line-height: 1.5; }
.chat-popup-actions { display: flex; gap: 10px; justify-content: center; }
.chat-btn-cancel, .chat-btn-confirm { padding: 10px 16px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: 0.2s; flex: 1; }
.chat-btn-cancel { background: #f1f5f9; color: #475569; }
.chat-btn-cancel:hover { background: #e2e8f0; }
.chat-btn-confirm { background: #0f172a; color: white; }
.chat-btn-confirm:hover { background: #0ea5e9; }

/* Green Dot Fix */
.status-dot {
    display: inline-block; width: 8px; height: 8px;
    background: #2dd4bf; border-radius: 50%;
    box-shadow: 0 0 5px #2dd4bf; margin-right: 4px;
}

.chat-header { background: #0f172a; color: white; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid #0ea5e9; }
.agent-info h4 { margin: 0; font-size: 16px; font-family: 'Playfair Display', serif; letter-spacing: 0.5px; }

.chat-body { flex-grow: 1; padding: 20px; overflow-y: auto; background: #f8fafc; display: flex; flex-direction: column; gap: 12px; }
.chat-message { max-width: 85%; padding: 12px 16px; border-radius: 8px; font-size: 14px; line-height: 1.6; animation: uitechPop 0.3s ease; }
.chat-message:not(.user) { background: white; color: #334155; align-self: flex-start; border-bottom-left-radius: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border-left: 3px solid #0ea5e9; }
.chat-message.user { background: #0ea5e9; color: white; align-self: flex-end; border-bottom-right-radius: 0; }

.chat-input-area { padding: 20px; background: white; border-top: 1px solid #e2e8f0; display: flex; align-items: center; gap: 12px; }
#chatInputBox { flex-grow: 1; border: 1px solid #cbd5e1; border-radius: 6px; padding: 12px 15px; font-size: 14px; outline: none; }
.chat-send-btn { background: #0ea5e9; color: white; width: 42px; height: 42px; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s; }

/* Quick Replies */
.chat-quick-replies { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; margin-bottom: 10px; padding-left: 2px; animation: uitechPop 0.4s ease; }
.chat-quick-reply-btn { background: #ffffff; border: 1px solid #0ea5e9; color: #0ea5e9; padding: 8px 14px; border-radius: 20px; font-size: 12px; cursor: pointer; transition: all 0.2s ease; font-weight: 600; }
.chat-quick-reply-btn:hover { background: #0ea5e9; color: #ffffff; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2); }

@keyframes uitechSlideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes uitechPop { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Mobile Full Screen Adjustment */
@media (max-width: 480px) {
    .chat-window { width: 100% !important; right: 0 !important; left: 0 !important; bottom: 0 !important; height: 100% !important; max-height: 100% !important; border-radius: 0 !important; }
}