/* =========================================
   CHATBOT PREMIUM - DIRECCIÓN 360
   ========================================= */

#bot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Montserrat', sans-serif;
}

/* Botón flotante del Chat */
.bot-launcher {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-claro));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid var(--dorado);
}

/* Notificación Roja (Badge) */
.bot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4d;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(255, 77, 77, 0.5);
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
    border: 2px solid var(--azul-oscuro);
}

.bot-badge.active {
    opacity: 1;
    transform: scale(1);
}

.bot-launcher:hover {
    transform: scale(1.1);
}

/* Animación de Pulso para resaltar */
.bot-launcher.pulse {
    animation: launcherPulse 2s infinite;
}

@keyframes launcherPulse {
    0% { box-shadow: 0 0 0 0 rgba(200, 162, 74, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(200, 162, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(200, 162, 74, 0); }
}

.bot-launcher svg {
    width: 30px;
    height: 30px;
    color: var(--dorado);
}

/* Ventana de Chat */
.bot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 550px;
    background: rgba(11, 31, 58, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(200, 162, 74, 0.3);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform-origin: bottom right;
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
}

.bot-window.active {
    display: flex;
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Header del Chat */
.bot-header {
    background: linear-gradient(to right, var(--azul-oscuro), var(--azul-claro));
    padding: 20px;
    color: var(--blanco);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(200, 162, 74, 0.2);
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: var(--dorado);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--azul-oscuro);
    font-size: 18px;
}

.bot-status {
    font-size: 14px;
    font-weight: 600;
}

.bot-status span {
    display: block;
    font-size: 10px;
    color: #4ade80;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bot-close {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

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

/* Área de Mensajes */
.bot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--dorado) transparent;
}

.bot-messages::-webkit-scrollbar {
    width: 4px;
}

.bot-messages::-webkit-scrollbar-thumb {
    background-color: var(--dorado);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: messageIn 0.3s ease forwards;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: var(--blanco);
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message.user {
    align-self: flex-end;
    background: var(--dorado);
    color: var(--azul-oscuro);
    border-bottom-right-radius: 2px;
    font-weight: 500;
}

/* Input del Chat */
.bot-input-area {
    padding: 20px;
    border-top: 1px solid rgba(200, 162, 74, 0.2);
    display: flex;
    gap: 10px;
}

.bot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 15px;
    color: var(--blanco);
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.bot-input:focus {
    border-color: var(--dorado);
}

.bot-send {
    background: var(--dorado);
    color: var(--azul-oscuro);
    border: none;
    border-radius: 10px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.bot-send:hover {
    background: var(--dorado-hover);
    transform: scale(1.05);
}

/* Opciones Rápidas */
.bot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.bot-option {
    background: rgba(200, 162, 74, 0.1);
    border: 1px solid var(--dorado);
    color: var(--dorado);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.bot-option:hover {
    background: var(--dorado);
    color: var(--azul-oscuro);
}

/* Indicador de escribiendo */
.typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    width: fit-content;
}

.typing span {
    width: 6px;
    height: 6px;
    background: var(--dorado);
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
    opacity: 0.4;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* Responsive */
@media (max-width: 480px) {
    .bot-window {
        width: calc(100vw - 40px);
        right: -10px;
        height: 80vh;
    }
}
