/* --- CONTENEDOR PRINCIPAL DEL CHAT --- */
#digibot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    background: #0A0140; /* Fondo oscuro de tu diseño */
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    transform-origin: bottom right;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#digibot-window.digibot-hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* --- HEADER DEL CHAT --- */
.digibot-header {
    background: #1C0A60; /* Morado fuerte */
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#digibot-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
}

#digibot-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* --- ÁREA DE MENSAJES --- */
#digibot-messages {
    height: 380px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0A0140;
}

/* Burbuja del Bot */
.bot-msg {
    background: #2D1482; /* Morado medio */
    color: #fff;
    padding: 12px 16px;
    border-radius: 15px 15px 15px 0;
    align-self: flex-start;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Burbuja del Usuario */
.user-msg {
    background: #5503a6; /* Morado brillante */
    color: #fff;
    padding: 12px 16px;
    border-radius: 15px 15px 0 15px;
    align-self: flex-end;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.bot-msg strong, .user-msg strong {
    font-weight: 700;
    color: #E8CAA2; /* Resalta las negritas con tu color acento */
}

.typing-indicator {
    opacity: 0.7;
    font-style: italic;
    font-size: 0.85rem;
}

/* --- ÁREA DE ESCRITURA --- */
.digibot-input-area {
    display: flex;
    padding: 15px;
    background: #0A0140;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

#digibot-input {
    flex-grow: 1;
    padding: 12px 15px;
    background: transparent;
    border: 1px solid #5503a6;
    border-radius: 25px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: 0.3s;
}

#digibot-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#digibot-input:focus {
    border-color: #C682D9;
    box-shadow: 0 0 10px rgba(85, 3, 166, 0.5);
}

#digibot-send {
    background: transparent;
    color: #C682D9;
    border: none;
    font-size: 1.5rem;
    margin-left: 10px;
    cursor: pointer;
    transition: 0.3s;
}

#digibot-send:hover {
    color: #fff;
    transform: scale(1.1) rotate(5deg);
}

/* --- BOTÓN FLOTANTE (TOGGLE) --- */
#digibot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #5503a6; /* Morado brillante */
    color: #fff;
    border: none;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(85, 3, 166, 0.4);
    z-index: 9999;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

#digibot-toggle:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(85, 3, 166, 0.6);
}

/* Custom Scrollbar para el chat */
#digibot-messages::-webkit-scrollbar { width: 6px; }
#digibot-messages::-webkit-scrollbar-track { background: transparent; }
#digibot-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
#digibot-messages::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

/* --- RESPONSIVE MÓVIL --- */
@media (max-width: 480px) {
    #digibot-window {
        width: 90%;
        right: 5%;
        bottom: 85px;
        height: 70vh; /* Se expande en móviles */
    }
    #digibot-messages {
        height: auto;
        flex-grow: 1;
    }
}