.netlogyc-chatbot-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.netlogyc-chatbot-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.netlogyc-chatbot-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

.netlogyc-chatbot-container.top-right {
    top: 20px;
    right: 20px;
}

.netlogyc-chatbot-container.top-left {
    top: 20px;
    left: 20px;
}

.netlogyc-welcome-message {
    position: absolute;
    bottom: 70px;
    background: #333;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    max-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 999998;
    text-align: center;
    line-height: 1.4;
}

.netlogyc-welcome-message.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    cursor: pointer;
}

.netlogyc-welcome-message::after {
    content: '';
    position: absolute;
    border: 6px solid transparent;
    border-top-color: #333;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
}

/* Posicionamiento del mensaje de bienvenida para diferentes posiciones */
.netlogyc-chatbot-container.bottom-right .netlogyc-welcome-message {
    right: 0;
}

.netlogyc-chatbot-container.bottom-left .netlogyc-welcome-message {
    left: 0;
}

.netlogyc-chatbot-container.top-right .netlogyc-welcome-message {
    bottom: auto;
    top: 70px;
}

.netlogyc-chatbot-container.top-right .netlogyc-welcome-message::after {
    bottom: auto;
    top: -12px;
    border-top-color: transparent;
    border-bottom-color: #333;
}

.netlogyc-chatbot-container.top-left .netlogyc-welcome-message {
    bottom: auto;
    top: 70px;
}

.netlogyc-chatbot-container.top-left .netlogyc-welcome-message::after {
    bottom: auto;
    top: -12px;
    border-top-color: transparent;
    border-bottom-color: #333;
}

.netlogyc-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 0;
}

.netlogyc-chatbot-button:hover {
    transform: scale(1.1);
}

.netlogyc-chatbot-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.netlogyc-chatbot-button .icon-fallback {
    display: none;
    font-size: 24px;
}

.netlogyc-chatbot-button:has(img[src=""]) .icon-fallback,
.netlogyc-chatbot-button:has(img:not([src])) .icon-fallback {
    display: block;
}

.netlogyc-chatbot-button:has(img[src=""]) img,
.netlogyc-chatbot-button:has(img:not([src])) img {
    display: none;
}

.netlogyc-chatbot-widget {
    position: absolute;
    width: 350px;
    /* La altura ahora se controla desde JavaScript con estilo inline */
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

/* Posicionamiento correcto de la ventana para todas las posiciones */
.netlogyc-chatbot-container.bottom-right .netlogyc-chatbot-widget {
    bottom: 70px;
    right: 0;
    left: auto;
}

.netlogyc-chatbot-container.bottom-left .netlogyc-chatbot-widget {
    bottom: 70px;
    left: 0;
    right: auto;
}

.netlogyc-chatbot-container.top-right .netlogyc-chatbot-widget {
    top: 70px;
    right: 0;
    left: auto;
    bottom: auto;
}

.netlogyc-chatbot-container.top-left .netlogyc-chatbot-widget {
    top: 70px;
    left: 0;
    right: auto;
    bottom: auto;
}

.netlogyc-chatbot-widget.active {
    display: flex;
}

.netlogyc-chatbot-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.netlogyc-chatbot-title {
    font-weight: 600;
    font-size: 16px;
}

.netlogyc-chatbot-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 30px;
    height: 30px;
}

.netlogyc-chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.netlogyc-chatbot-close svg {
    width: 20px;
    height: 20px;
}

.netlogyc-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0; /* Permite que el contenedor se reduzca */
}

.netlogyc-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
}

.netlogyc-message.bot {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.netlogyc-message.user {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.netlogyc-chatbot-input {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0; /* Evita que se reduzca */
}

.netlogyc-chatbot-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

.netlogyc-chatbot-input input:focus {
    border-color: #007cba;
}

.netlogyc-chatbot-send {
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    font-weight: bold;
    font-size: 16px;
    /* El color se aplica dinámicamente desde JavaScript */
}

.netlogyc-chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #f8f9fa;
}

.netlogyc-chatbot-send:active {
    transform: scale(0.95);
}

.netlogyc-typing-indicator {
    display: none;
    align-self: flex-start;
    padding: 12px 16px;
    background: #f1f1f1;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.netlogyc-typing-indicator.active {
    display: block;
}

.netlogyc-typing-dots {
    display: flex;
    gap: 4px;
}

.netlogyc-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: netlogyc-typing 1.4s infinite ease-in-out;
}

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

@keyframes netlogyc-typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.netlogyc-chatbot-watermark {
    padding: 10px;
    text-align: center;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #888;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    flex-shrink: 0; /* Evita que se reduzca */
}

.netlogyc-chatbot-watermark a {
    color: #888;
    text-decoration: none;
    pointer-events: auto;
}

.netlogyc-chatbot-watermark a:hover {
    text-decoration: underline;
}

/* Protección adicional contra manipulación */
.netlogyc-chatbot-watermark[data-protected="true"] {
    position: relative;
}

.netlogyc-chatbot-watermark[data-protected="true"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

@media (max-width: 768px) {
    .netlogyc-chatbot-widget {
        width: 100vw;
        height: 100vh !important; /* En móviles ocupa toda la pantalla */
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 0;
    }
    
    .netlogyc-chatbot-container {
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
    }
    
    .netlogyc-welcome-message {
        max-width: 150px;
        font-size: 12px;
        padding: 10px 12px;
    }
}