/* AGENTE IA PALADIUM - ESTILOS OPTIMIZADOS */
.cloud-button {

        position: fixed;
        bottom: 30%;
        right: 1%;
        width: 4.3%;
        height: 55px;
    /*background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);*/
    border: none;
    border-radius: 50%;
    box-shadow: 
        0 15px 30px rgba(0,0,0,0.15),
        0 6px 12px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.cloud-button:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.25),
        0 10px 20px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.9);
}

.cloud-button:active {
    transform: translateY(-3px) scale(1.02);
}

.cloud-icon {
    font-size: 35px; /* Reducido de 45px a 35px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* CONTAINER DEL CHAT - MÁS COMPACTO */
.chat-container {
    position: fixed;
    bottom: 200px; /* Ajustado para el botón más pequeño */
    right: 40px;
    width: 350px; /* Reducido de 420px a 350px */
    height: 415px; /* Reducido de 650px a 500px */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px; /* Reducido de 28px a 24px */
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.2),
        0 12px 25px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.8);
    display: none;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    animation: slideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.3);
}

.chat-container.active {
    display: flex;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(25px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* HEADER DEL CHAT - MÁS COMPACTO */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 20px 18px; /* Reducido de 28px 24px 24px */
    text-align: center;
    position: relative;
    border-radius: 24px 24px 0 0; /* Ajustado */
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.chat-header h3 {
    margin: 0;
    font-size: 18px; /* Reducido de 20px a 18px */
    font-weight: 700;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

/* ÁREA DE MENSAJES - MÁS COMPACTA */
.chat-messages {
    flex: 1;
    padding: 18px; /* Reducido de 24px a 18px */
    overflow-y: auto;
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
    position: relative;
}

.message {
    margin-bottom: 16px; /* Reducido de 20px a 16px */
    display: flex;
    align-items: flex-start;
    animation: messageSlideIn 0.4s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    justify-content: flex-end;
}

.message.agent {
    justify-content: flex-start;
}

.message-content {
    max-width: 85%;
    padding: 14px 18px; /* Reducido de 16px 20px */
    border-radius: 20px; /* Reducido de 24px a 20px */
    font-size: 14px; /* Reducido de 15px a 14px */
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-line;
    position: relative;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.message-content:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.3),
        0 3px 10px rgba(0,0,0,0.1);
}

.message.agent .message-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #2d3748;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-bottom-left-radius: 6px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    letter-spacing: -0.2px;
    box-shadow: 
        0 6px 20px rgba(0,0,0,0.06),
        0 2px 6px rgba(0,0,0,0.04);
}

.message-time {
    font-size: 11px; /* Reducido de 12px a 11px */
    color: rgba(255,255,255,0.8);
    margin-top: 6px; /* Reducido de 8px a 6px */
    text-align: center;
    font-weight: 500;
    opacity: 0.9;
}

.message.user .message-time {
    color: rgba(255,255,255,0.9);
}

.message.agent .message-time {
    color: #a0aec0;
    font-weight: 600;
}

/* INPUT DEL CHAT - MÁS COMPACTO */
.chat-input {
    padding: 18px; /* Reducido de 24px a 18px */
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    gap: 10px; /* Reducido de 12px a 10px */
    align-items: center;
    position: relative;
}

.chat-input input {
    flex: 1;
    padding: 14px 18px; /* Reducido de 16px 20px */
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px; /* Reducido de 28px a 24px */
    font-size: 14px; /* Reducido de 15px a 14px */
    outline: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    font-weight: 500;
    color: #2d3748;
}

.chat-input input:focus {
    border-color: #667eea;
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        0 6px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.chat-input input::placeholder {
    color: #a0aec0;
    font-weight: 500;
}

.send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 45px; /* Reducido de 52px a 45px */
    height: 45px; /* Reducido de 52px a 45px */
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 16px; /* Reducido de 18px a 16px */
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.3),
        0 3px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.send-button:hover {
    transform: scale(1.08) translateY(-1px);
    box-shadow: 
        0 10px 25px rgba(102, 126, 234, 0.4),
        0 6px 12px rgba(0,0,0,0.15);
}

/* INDICADOR DE ESCRITURA - MÁS COMPACTO */
.typing-indicator {
    display: none;
    padding: 14px 18px; /* Reducido de 16px 20px */
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px; /* Reducido de 24px a 20px */
    border-bottom-left-radius: 6px;
    margin-bottom: 16px; /* Reducido de 20px a 16px */
    max-width: 85%;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
}

.typing-indicator.active {
    display: block;
    animation: typingSlideIn 0.4s ease-out;
}

@keyframes typingSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.typing-dots {
    display: flex;
    gap: 5px; /* Reducido de 6px a 5px */
    align-items: center;
}

.typing-dot {
    width: 8px; /* Reducido de 10px a 8px */
    height: 8px; /* Reducido de 10px a 8px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    animation: typing 1.6s infinite ease-in-out;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.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.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* RESPONSIVE - PERFECTO EN MÓVIL */
@media (max-width: 768px) {
    .chat-container {
        width: 85vw; /* Reducido de 92vw a 85vw */
        height: 70vh; /* Reducido de 85vh a 70vh */
        right: 7.5vw;
        bottom: 160px;
        border-radius: 20px;
    }

    .cloud-button {
        width: 65px; /* Reducido de 80px a 65px */
        height: 65px; /* Reducido de 80px a 65px */
        bottom: 100px;
        right: 20px;
    }

    .cloud-icon {
        font-size: 30px; /* Reducido de 40px a 30px */
    }

    .message-content {
        max-width: 88%;
        padding: 12px 16px; /* Reducido de 14px 18px */
        font-size: 13px; /* Reducido de 14px a 13px */
    }

    .chat-input {
        padding: 16px; /* Reducido de 20px a 16px */
    }

    .chat-input input {
        padding: 12px 16px; /* Reducido de 14px 18px */
        font-size: 13px; /* Reducido de 14px a 13px */
    }

    .send-button {
        width: 42px; /* Reducido de 48px a 42px */
        height: 42px; /* Reducido de 48px a 42px */
        font-size: 15px; /* Reducido de 16px a 15px */
    }

    .chat-header {
        padding: 18px 16px 16px; /* Reducido de 24px 20px 20px */
    }

    .chat-header h3 {
        font-size: 16px; /* Reducido de 18px a 16px */
    }
}

@media (max-width: 480px) {
    .chat-container {
        width: 90vw;
        height: 75vh;
        right: 5vw;
        bottom: 140px;
        border-radius: 18px;
    }

    .cloud-button {
        width: 60px; /* Reducido de 65px a 60px */
        height: 60px; /* Reducido de 65px a 60px */
        bottom: 90px;
        right: 18px;
    }

    .cloud-icon {
        font-size: 28px; /* Reducido de 30px a 28px */
    }

    .message-content {
        max-width: 90%;
        padding: 11px 15px;
        font-size: 12px;
    }

    .chat-input {
        padding: 14px;
    }

    .chat-input input {
        padding: 11px 15px;
        font-size: 12px;
    }

    .send-button {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .chat-header {
        padding: 16px 14px 14px;
    }

    .chat-header h3 {
        font-size: 15px;
    }
}


[type=button]:focus,
[type=button]:hover,
[type=submit]:focus,
[type=submit]:hover,
button:focus,
button:hover {
    background-color: transparent !important;
    color: #fff !important;
    text-decoration: none !important;
}