/* AI Chatbot Widget Styles - Enhanced Modern Design */
#ai-chatbot-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#ai-chatbot-widget.ai-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

#ai-chatbot-widget.ai-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

#ai-chatbot-widget.ai-chatbot-top-right {
    top: 20px;
    right: 20px;
}

#ai-chatbot-widget.ai-chatbot-top-left {
    top: 20px;
    left: 20px;
}

#ai-chatbot-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

#ai-chatbot-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#ai-chatbot-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), 0 6px 12px rgba(0, 0, 0, 0.15);
}

#ai-chatbot-button:hover::before {
    opacity: 1;
}

#ai-chatbot-button:active {
    transform: scale(1.05);
}

#ai-chatbot-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    height: 550px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

/* Posicionamiento adaptativo de la ventana según la ubicación del widget */
#ai-chatbot-widget.ai-chatbot-bottom-right #ai-chatbot-window {
    bottom: 80px;
    right: 0;
}

#ai-chatbot-widget.ai-chatbot-bottom-left #ai-chatbot-window {
    bottom: 80px;
    left: 0;
}

#ai-chatbot-widget.ai-chatbot-top-right #ai-chatbot-window {
    top: 80px;
    right: 0;
}

#ai-chatbot-widget.ai-chatbot-top-left #ai-chatbot-window {
    top: 80px;
    left: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Size variations */
#ai-chatbot-widget.ai-chatbot-small #ai-chatbot-window {
    width: 300px;
}

#ai-chatbot-widget.ai-chatbot-medium #ai-chatbot-window {
    width: 350px;
}

#ai-chatbot-widget.ai-chatbot-large #ai-chatbot-window {
    width: 400px;
}

#ai-chatbot-header {
    padding: 24px;
    color: var(--chatbot-header, #ffffff);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#ai-chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--chatbot-header-title, #ffffff) !important;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#ai-chatbot-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

#ai-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

#ai-chatbot-close:active {
    transform: rotate(90deg) scale(0.95);
}

#ai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--chatbot-bg, #ffffff);
    scroll-behavior: smooth;
    border: none;
    border-radius: 0;
    margin: 0;
    margin-bottom: 0;
}

.ai-chatbot-message {
    margin-bottom: 20px;
    display: flex;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 10px;
    align-items: flex-start;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-chatbot-message.user {
    justify-content: flex-end;
    position: relative;
    flex-direction: row;
}

.ai-chatbot-message.user::before {
    content: '';
    width: 36px;
    height: 36px;
    background: var(--chatbot-user-icon-bg, #0066cc);
    border-radius: 50%;
    margin-left: 10px;
    margin-top: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    order: 2;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    transition: all 0.3s ease;
}

.ai-chatbot-message.user:hover::before {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

.ai-chatbot-message-content {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ai-chatbot-message.bot .ai-chatbot-message-content {
    background: var(--chatbot-bot-bubble-bg, #f0f0f0) !important;
    color: var(--chatbot-bot-text-color, #333333) !important;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    order: 2;
}

.ai-chatbot-message.bot .ai-chatbot-message-content:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Ícono del bot */
.ai-chatbot-message.bot {
    justify-content: flex-start;
    flex-direction: row;
}

.ai-chatbot-message.bot::before {
    content: '';
    width: 36px;
    height: 36px;
    background: var(--chatbot-bot-icon-bg, #0066cc) !important;
    border-radius: 50%;
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    order: 1;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    /* Ícono por defecto: robot */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='10' x='3' y='11' rx='2'/%3E%3Ccircle cx='12' cy='5' r='2'/%3E%3Cpath d='m12 7 0 4'/%3E%3Cpath d='m8 9-2 0'/%3E%3Cpath d='m16 9 2 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    transition: all 0.3s ease;
}

.ai-chatbot-message.bot:hover::before {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.ai-chatbot-message.user .ai-chatbot-message-content {
    background: var(--chatbot-user-bubble-bg, #0066cc) !important;
    color: var(--chatbot-user-text-color, #ffffff) !important;
    border-bottom-right-radius: 6px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25), 0 1px 3px rgba(0, 0, 0, 0.1);
    order: 1;
}

.ai-chatbot-message.user .ai-chatbot-message-content:hover {
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.35), 0 2px 4px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.ai-chatbot-typing {
    display: flex;
    gap: 6px;
    padding: 14px 18px;
    background: white;
    border-radius: 20px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-chatbot-typing span {
    width: 8px;
    height: 8px;
    background: var(--chatbot-typing-indicator-color, #999999);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

#ai-chatbot-input-container {
    display: flex;
    padding: 20px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98), rgba(248, 249, 250, 0.95));
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    gap: 12px;
    backdrop-filter: blur(10px);
}

#ai-chatbot-input {
    flex: 1;
    border: 2px solid var(--chatbot-input-border-color, #e0e0e0);
    border-radius: 24px;
    padding: 14px 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    background-color: var(--chatbot-input-bg-color, #ffffff);
    color: var(--chatbot-input-text-color, #333333);
}

#ai-chatbot-input:focus {
    border-color: var(--chatbot-color, #0066cc);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15), 0 0 0 3px rgba(0, 102, 204, 0.1);
    transform: translateY(-1px);
}

#ai-chatbot-input::placeholder {
    color: var(--chatbot-placeholder-color, #999999);
    transition: color 0.3s ease;
}

#ai-chatbot-input:focus::placeholder {
    opacity: 0.7;
}

#ai-chatbot-send {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--chatbot-send-button-color, #0066cc) !important;
    color: white !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* Estilos específicos sobrescriben el base */
#ai-chatbot-send.ai-send-btn-glass {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

#ai-chatbot-send.ai-send-btn-neon {
    background: var(--chatbot-send-button-color, #0066cc) !important;
    box-shadow: 0 0 10px var(--chatbot-send-button-color, #0066cc), 0 0 20px var(--chatbot-send-button-color, #0066cc), 0 0 30px var(--chatbot-send-button-color, #0066cc) !important;
}

#ai-chatbot-send.ai-send-btn-animated {
    background: linear-gradient(45deg, var(--chatbot-send-button-color, #0066cc), #4a90e2, var(--chatbot-send-button-color, #0066cc)) !important;
    background-size: 200% 200% !important;
}

#ai-chatbot-send.ai-send-btn-gradient {
    background: linear-gradient(135deg, var(--chatbot-send-button-color, #0078d4), var(--chatbot-send-button-color-dark, #0052a3)) !important;
}

#ai-chatbot-send.ai-send-btn-shadow {
    background: var(--chatbot-send-button-color, #0066cc) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

#ai-chatbot-send:hover {
    background: var(--chatbot-send-button-color, #0078d4) !important;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

#ai-chatbot-send:active {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

#ai-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc !important;
}

/* Round Style (Default) */
.ai-send-btn-round {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

/* Square Style */
.ai-send-btn-square {
    width: 44px;
    height: 44px;
    border-radius: 8px;
}

/* Minimal Style */
.ai-send-btn-minimal {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--chatbot-send-button-color, #0066cc) !important;
    border: 2px solid var(--chatbot-send-button-color, #0066cc);
    color: #ffffff !important;
}

.ai-send-btn-minimal:hover {
    background: var(--chatbot-send-button-color, #0078d4) !important;
    color: #ffffff !important;
}

.ai-send-btn-minimal svg {
    stroke: #ffffff !important;
    fill: none !important;
}

.ai-send-btn-minimal:hover svg {
    stroke: #ffffff !important;
    fill: none !important;
}

/* Gradient Style */
.ai-send-btn-gradient {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-send-button-color, #0078d4), var(--chatbot-send-button-color-dark, #0052a3)) !important;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.ai-send-btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

/* Neon Style */
.ai-send-btn-neon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--chatbot-send-button-color, #0066cc) !important;
    box-shadow: 0 0 10px var(--chatbot-send-button-color, #0066cc), 0 0 20px var(--chatbot-send-button-color, #0066cc), 0 0 30px var(--chatbot-send-button-color, #0066cc) !important;
    animation: ai-chatbot-neon-pulse 2s ease-in-out infinite alternate;
}

.ai-send-btn-neon:hover {
    box-shadow: 0 0 15px var(--chatbot-color, #0066cc), 0 0 25px var(--chatbot-color, #0066cc), 0 0 35px var(--chatbot-color, #0066cc) !important;
    transform: scale(1.1);
}

@keyframes ai-chatbot-neon-pulse {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.3); }
}

/* Glass Style */
.ai-send-btn-glass {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

.ai-send-btn-glass:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
}

.ai-send-btn-glass svg {
    stroke: var(--chatbot-color, #0066cc) !important;
    fill: none !important;
}

/* Shadow Style */
.ai-send-btn-shadow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--chatbot-send-button-color, #0066cc) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    border: none !important;
}

.ai-send-btn-shadow:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

/* Animated Style */
.ai-send-btn-animated {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--chatbot-send-button-color, #0066cc), #4a90e2, var(--chatbot-send-button-color, #0066cc)) !important;
    background-size: 200% 200% !important;
    animation: ai-chatbot-animated-bg 3s ease infinite;
    border: none !important;
}

.ai-send-btn-animated:hover {
    animation-duration: 1s;
    transform: rotate(360deg);
    transition: transform 0.6s ease;
}

@keyframes ai-chatbot-animated-bg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Estilos específicos para íconos nuevos */
.ai-send-btn-neon svg,
.ai-send-btn-shadow svg,
.ai-send-btn-animated svg {
    fill: white !important;
    stroke: white !important;
}

/* Estilos específicos para glass style */
.ai-send-btn-glass svg {
    stroke: var(--chatbot-color, #0066cc) !important;
    fill: none !important;
}

/* Iconos que necesitan fill en lugar de stroke */
.ai-send-btn-round svg[fill],
.ai-send-btn-square svg[fill],
.ai-send-btn-minimal svg[fill],
.ai-send-btn-gradient svg[fill],
.ai-send-btn-neon svg[fill],
.ai-send-btn-shadow svg[fill],
.ai-send-btn-animated svg[fill] {
    fill: white !important;
    stroke: white !important;
}

/* Para glass style con iconos filled */
.ai-send-btn-glass svg[fill] {
    fill: var(--chatbot-color, #0066cc) !important;
    stroke: var(--chatbot-color, #0066cc) !important;
}

/* Efectos especiales para iconos */
/* Efecto especial para ícono de corazón */
button[class*="ai-send-btn-"]:has(svg[fill]) {
    overflow: visible;
}

button[class*="ai-send-btn-animated"]:has(svg[fill]) svg {
    animation: ai-chatbot-heartbeat 1.5s ease-in-out infinite;
}

/* Efecto especial para ícono de estrella */
button[class*="ai-send-btn-"]:has(svg polygon[points*="12,2"]) {
    animation: ai-chatbot-star-twinkle 2s ease-in-out infinite;
}

@keyframes ai-chatbot-star-twinkle {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5) drop-shadow(0 0 8px gold); }
}

/* Efecto especial para ícono de rayo */
button[class*="ai-send-btn-"]:has(svg polygon[points*="13,2"]) svg {
    animation: ai-chatbot-lightning-flash 1s ease-in-out infinite;
}

@keyframes ai-chatbot-lightning-flash {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0.7; filter: brightness(2); }
}

/* Efecto especial para cohete */
button[class*="ai-send-btn-animated"]:has(svg path[d*="rocket"]),
button[class*="ai-send-btn-animated"]:has(svg path[d*="12 15"]) {
    animation: ai-chatbot-rocket-launch 2s ease-in-out infinite;
}

@keyframes ai-chatbot-rocket-launch {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Scrollbar personalizado */
#ai-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#ai-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#ai-chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 480px) {
    #ai-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        max-height: 600px;
    }

    /* Override size classes on mobile */
    #ai-chatbot-widget.ai-chatbot-small #ai-chatbot-window,
    #ai-chatbot-widget.ai-chatbot-medium #ai-chatbot-window,
    #ai-chatbot-widget.ai-chatbot-large #ai-chatbot-window {
        width: calc(100vw - 40px);
    }
}

/* Error message */
.ai-chatbot-error {
    background: #fee;
    color: #c33;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin: 8px 0;
}

/* Timestamp */
.ai-chatbot-timestamp {
    font-size: 11px;
    color: var(--chatbot-timestamp-color, #999999) !important;
    margin-top: 4px;
    text-align: right;
}

/* Avatar Animations */
#ai-chatbot-button img,
.ai-chatbot-avatar-preview img {
    transition: all 0.3s ease;
}

/* Basic Animations */
.ai-chatbot-avatar-preview.pulse,
#ai-chatbot-button.pulse {
    animation: ai-chatbot-pulse 2s infinite;
}

.ai-chatbot-avatar-preview.bounce,
#ai-chatbot-button.bounce {
    animation: ai-chatbot-bounce 2s infinite;
}

.ai-chatbot-avatar-preview.rotate,
#ai-chatbot-button.rotate {
    animation: ai-chatbot-rotate 3s linear infinite;
}

.ai-chatbot-avatar-preview.rotate-3s,
#ai-chatbot-button.rotate-3s {
    animation: ai-chatbot-rotate-3s 6s ease-in-out infinite;
}

.ai-chatbot-avatar-preview.rotate-5s,
#ai-chatbot-button.rotate-5s {
    animation: ai-chatbot-rotate-5s 10s ease-in-out infinite;
}

.ai-chatbot-avatar-preview.rotate-10s,
#ai-chatbot-button.rotate-10s {
    animation: ai-chatbot-rotate-10s 20s ease-in-out infinite;
}

.ai-chatbot-avatar-preview.shake,
#ai-chatbot-button.shake {
    animation: ai-chatbot-shake 0.5s ease-in-out infinite;
}

.ai-chatbot-avatar-preview.heartbeat,
#ai-chatbot-button.heartbeat {
    animation: ai-chatbot-heartbeat 1.5s ease-in-out infinite;
}

/* Premium Effects */
.ai-chatbot-avatar-preview.glow,
#ai-chatbot-button.glow {
    animation: ai-chatbot-glow 2s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 10px gold);
}

.ai-chatbot-avatar-preview.rainbow,
#ai-chatbot-button.rainbow {
    animation: ai-chatbot-rainbow 3s linear infinite;
    filter: hue-rotate(0deg);
}

.ai-chatbot-avatar-preview.fire,
#ai-chatbot-button.fire {
    animation: ai-chatbot-fire 1s ease-in-out infinite alternate;
    filter: sepia(1) saturate(2) brightness(1.2) hue-rotate(15deg);
}

.ai-chatbot-avatar-preview.electric,
#ai-chatbot-button.electric {
    animation: ai-chatbot-electric 0.1s ease-in-out infinite alternate;
    filter: brightness(1.5) contrast(1.2);
}

.ai-chatbot-avatar-preview.neon,
#ai-chatbot-button.neon {
    animation: ai-chatbot-neon 2s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 5px #00ffff) drop-shadow(0 0 10px #00ffff) drop-shadow(0 0 15px #00ffff);
}

.ai-chatbot-avatar-preview.hologram,
#ai-chatbot-button.hologram {
    animation: ai-chatbot-hologram 2s ease-in-out infinite;
    filter: hue-rotate(0deg) brightness(1.2) contrast(1.1);
}

/* Animation Keyframes */
@keyframes ai-chatbot-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes ai-chatbot-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes ai-chatbot-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ai-chatbot-rotate-3s {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(360deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ai-chatbot-rotate-10s {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(360deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ai-chatbot-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes ai-chatbot-heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

@keyframes ai-chatbot-glow {
    0% { filter: drop-shadow(0 0 5px gold) brightness(1); }
    100% { filter: drop-shadow(0 0 20px gold) brightness(1.2); }
}

@keyframes ai-chatbot-rainbow {
    0% { filter: hue-rotate(0deg); }
    25% { filter: hue-rotate(90deg); }
    50% { filter: hue-rotate(180deg); }
    75% { filter: hue-rotate(270deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes ai-chatbot-fire {
    0% {
        filter: sepia(1) saturate(2) brightness(1.2) hue-rotate(15deg) contrast(1);
    }
    50% {
        filter: sepia(1) saturate(3) brightness(1.4) hue-rotate(25deg) contrast(1.2);
    }
    100% {
        filter: sepia(1) saturate(2) brightness(1.2) hue-rotate(15deg) contrast(1);
    }
}

@keyframes ai-chatbot-electric {
    0% {
        filter: brightness(1.5) contrast(1.2) saturate(1);
    }
    100% {
        filter: brightness(2) contrast(1.5) saturate(1.5);
    }
}

@keyframes ai-chatbot-neon {
    0% {
        filter: drop-shadow(0 0 5px #00ffff) drop-shadow(0 0 10px #00ffff) drop-shadow(0 0 15px #00ffff);
    }
    100% {
        filter: drop-shadow(0 0 10px #00ffff) drop-shadow(0 0 20px #00ffff) drop-shadow(0 0 30px #00ffff);
    }
}

@keyframes ai-chatbot-hologram {
    0% {
        filter: hue-rotate(0deg) brightness(1.2) contrast(1.1) saturate(1.2);
    }
    25% {
        filter: hue-rotate(90deg) brightness(1.1) contrast(1.2) saturate(1.1);
    }
    50% {
        filter: hue-rotate(180deg) brightness(1.3) contrast(1) saturate(1.3);
    }
    75% {
        filter: hue-rotate(270deg) brightness(1.1) contrast(1.2) saturate(1.1);
    }
    100% {
        filter: hue-rotate(360deg) brightness(1.2) contrast(1.1) saturate(1.2);
    }
}

/* Interactive Elements Styles */
.ai-chatbot-navigation-buttons {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.ai-chatbot-nav-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--chatbot-color, #0066cc), #4a90e2);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
    text-align: center;
    justify-content: center;
}

.ai-chatbot-nav-button:hover {
    background: linear-gradient(135deg, #0056b3, #357abd);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    color: white;
    text-decoration: none;
}

.ai-chatbot-nav-button:active {
    transform: translateY(0);
}

/* Mensajes de respuesta rápida como mensajes separados */
.ai-chatbot-quick-reply-message {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
}

.ai-chatbot-quick-reply-message .ai-chatbot-message-content {
    background: linear-gradient(135deg, var(--chatbot-color, #0066cc) 0%, #0052a3 100%) !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 18px !important;
    overflow: hidden;
}

.ai-chatbot-quick-reply-link {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.ai-chatbot-quick-reply-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: none;
}

.ai-chatbot-quick-reply-message .ai-chatbot-timestamp {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 10px !important;
    padding: 4px 12px !important;
    margin: 0 !important;
    text-align: center;
}

.ai-chatbot-quick-replies {
    margin-bottom: 16px;
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.ai-chatbot-quick-reply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--chatbot-color, #0066cc) 0%, #0052a3 100%);
    color: #ffffff;
    text-decoration: none;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.ai-chatbot-quick-reply:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.ai-chatbot-action-button {
    border: none;
    background: linear-gradient(135deg, var(--chatbot-color, #0066cc) 0%, #0052a3 100%);
    color: #ffffff;
    cursor: pointer;
}

.ai-chatbot-action-button:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

/* Enhanced message content styling */
.ai-chatbot-message-content strong {
    font-weight: 600;
    color: var(--chatbot-color, #0066cc);
}

.ai-chatbot-message-content a {
    color: var(--chatbot-color, #0066cc);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.ai-chatbot-message-content a:hover {
    border-bottom-color: var(--chatbot-color, #0066cc);
}

/* Professional message styling */
.ai-chatbot-message.bot .ai-chatbot-message-content {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-chatbot-message.bot.ai-chatbot-professional {
    margin-bottom: 16px;
}

.ai-chatbot-message.bot.ai-chatbot-professional .ai-chatbot-message-content {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Enhanced loading indicator */
.ai-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

.ai-chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chatbot-typing-indicator-color, #999999);
    opacity: 0.4;
    animation: ai-chatbot-typing-dot 1.4s infinite ease-in-out;
}

.ai-chatbot-typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-chatbot-typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes ai-chatbot-typing-dot {
    0%, 80%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #ai-chatbot-window {
        width: 95vw;
        height: 80vh;
        bottom: 70px;
        right: 2.5vw;
    }
    
    .ai-chatbot-navigation-buttons {
        grid-template-columns: 1fr;
    }
    
    .ai-chatbot-nav-button {
        min-height: 44px;
    }
    
    .ai-chatbot-quick-replies {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .ai-chatbot-quick-reply {
        text-align: center;
        justify-content: center;
        min-height: 44px;
        width: 100%;
        max-width: 280px;
    }
    
    .ai-chatbot-quick-reply-message {
        max-width: 90% !important;
    }
    
    .ai-chatbot-quick-reply-link {
        padding: 14px 20px !important;
        font-size: 14px !important;
    }
}

/* Animation for new buttons appearing */
.ai-chatbot-navigation-buttons,
.ai-chatbot-quick-replies {
    animation: ai-chatbot-slide-up 0.4s ease-out;
}

@keyframes ai-chatbot-slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced professional look */
.ai-chatbot-message.bot.ai-chatbot-enhanced {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.ai-chatbot-message.bot.ai-chatbot-enhanced .ai-chatbot-message-content {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    position: relative;
}

.ai-chatbot-message.bot.ai-chatbot-enhanced .ai-chatbot-message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--chatbot-color, #0066cc), #4a90e2);
    border-radius: 12px 12px 0 0;
}

/* Estilos para el ícono SVG - MÁXIMA PRIORIDAD */
#ai-chatbot-send svg,
button[id="ai-chatbot-send"] svg,
.ai-chatbot-widget #ai-chatbot-send svg,
#ai-chatbot-widget #ai-chatbot-send svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    stroke-width: 2 !important;
    pointer-events: none !important;
    position: relative !important;
    z-index: 1 !important;
    /* Asegurar que el SVG por defecto siempre sea visible */
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    /* PRODUCCIÓN: Forzar stroke y fill explícitos */
    stroke: currentColor !important;
    fill: none !important;
    /* Evitar cualquier override de transformaciones */
    transform: none !important;
    /* Asegurar tamaño fijo en cualquier contexto */
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
}

/* FORZAR VISIBILIDAD - Botón enviar principal */
#ai-chatbot-send {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: visible !important;
}

/* Colores por defecto para SVG - EL NUEVO SVG POR DEFECTO */
#ai-chatbot-send:not(.ai-send-btn-glass) svg {
    fill: none !important;
    stroke: #ffffff !important;
}

/* Específico para botón glass */
#ai-chatbot-send.ai-send-btn-glass svg {
    stroke: var(--chatbot-color, #0066cc) !important;
    fill: none !important;
}

/* Para iconos que necesitan fill */
#ai-chatbot-send svg[fill]:not([fill="none"]) {
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

#ai-chatbot-send.ai-send-btn-glass svg[fill]:not([fill="none"]) {
    fill: var(--chatbot-color, #0066cc) !important;
    stroke: var(--chatbot-color, #0066cc) !important;
}

/* Botones inline para enlaces dentro del texto */
.ai-chatbot-inline-button {
    display: inline-block !important;
    background: linear-gradient(135deg, var(--chatbot-color, #0066cc), #0052a3) !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    margin: 4px 8px 4px 0 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3) !important;
    position: relative !important;
    overflow: hidden !important;
}

.ai-chatbot-inline-button:hover {
    background: linear-gradient(135deg, #0052a3, var(--chatbot-color, #0066cc)) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.ai-chatbot-inline-button:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.3) !important;
}

/* Efecto de brillo al pasar el mouse */
.ai-chatbot-inline-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.ai-chatbot-inline-button:hover::before {
    left: 100%;
}

/* Asegurar que los botones se vean bien en dispositivos móviles */
@media (max-width: 768px) {
    .ai-chatbot-inline-button {
        padding: 6px 12px !important;
        font-size: 13px !important;
        margin: 3px 6px 3px 0 !important;
    }
}

/* Fallback si no hay SVG */
#ai-chatbot-send:empty::before,
#ai-chatbot-send:not(:has(svg))::before {
    content: "→" !important;
    font-size: 20px !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    font-weight: bold !important;
}
