/* ====== Chat Widget Styles (Design Parity) ====== */
:root {
    --chat-primary: #1E56A0; /* Azul de la imagen */
    --chat-bg: #FFFFFF;    /* Fondo blanco en la imagen */
    --chat-text: #333333;
    --chat-bot-bubble: #F1F6FF;
    --chat-user-bubble: #1E56A0;
    --chat-border: #E1E8F0;
}

/* FAB - Rediseñado para coincidir con la imagen */
.chat-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #FFFFFF;
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 8px 15px 8px 8px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: all 0.3s ease;
    border: 1px solid #E1E8F0;
}

.chat-fab:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.chat-fab-img-container {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #2D6CDF, #1E56A0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.chat-fab-img-container i {
    color: white;
    font-size: 1.5rem;
}

.chat-fab-text {
    display: flex;
    flex-direction: column;
}

.chat-fab-text .name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #010A11;
    letter-spacing: 1px;
    margin-bottom: -2px;
}

.chat-fab-text .sub {
    font-size: 0.75rem;
    color: #666;
}

/* Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 130px); /* Evita que se corte arriba */
    background-color: var(--chat-bg);
    border: none;
    border-radius: 28px;
    display: none;
    flex-direction: column;
    z-index: 10001;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.chat-window.active {
    display: flex;
}

/* --- Media Queries para Responsividad Total --- */
@media (max-width: 576px) {
    .chat-fab {
        bottom: 15px;
        right: 15px;
        padding: 6px 12px 6px 6px;
    }

    .chat-fab-img-container {
        width: 35px;
        height: 35px;
    }

    .chat-fab-text .name {
        font-size: 0.85rem;
    }

    .chat-fab-text .sub {
        font-size: 0.65rem;
    }

    .chat-window {
        width: calc(100% - 30px);
        right: 15px;
        bottom: 85px;
        height: calc(100vh - 100px);
        border-radius: 20px;
    }

    .chat-header {
        padding: 15px 20px;
    }

    .chat-messages {
        padding: 15px;
    }

    .chat-input-area {
        padding: 10px 15px;
    }
}

/* Tablet (iPad Mini, etc) */
@media (max-height: 750px) {
    .chat-window {
        height: 500px;
    }
}

/* Header */
.chat-header {
    padding: 20px 25px;
    background-color: var(--chat-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-avatar-container {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.chat-avatar-container i {
    color: white;
    font-size: 1.4rem;
}

.chat-title h4 {
    margin: 0;
    font-size: 1.15rem;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chat-title span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
}

.chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

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

/* Messages */
.chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #F8FAFF;
}

.message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.message.bot {
    align-self: flex-start;
    background-color: #FFFFFF;
    color: #444;
    border: 1px solid #E1E8F0;
    border-bottom-left-radius: 4px;
}

.message.user {
    align-self: flex-end;
    background-color: var(--chat-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

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

.chat-input {
    flex: 1;
    background-color: #F8FAFF;
    border: 1px solid #E1E8F0;
    border-radius: 30px;
    padding: 12px 20px;
    color: #333;
    font-size: 0.95rem;
}

.chat-input::placeholder {
    color: #AAA;
}

.chat-input:focus {
    outline: none;
    border-color: var(--chat-primary);
}

.chat-send-btn {
    background-color: var(--chat-primary);
    border: none;
    color: #fff;
    padding: 12px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background-color: #164687;
}

.chat-send-btn i {
    font-size: 0.9rem;
}

/* Typing Indicator */
.typing .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #999;
    border-radius: 50%;
    margin-right: 3px;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing .dot:nth-child(1) { animation-delay: -0.32s; }
.typing .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}
