/* OkoBot Widget Styles */

#okobot-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Botón flotante */
#okobot-button {
    position: fixed;
    width: 55px;
    height: 55px;
    background: var(--okobot-primary-color, #c54902);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(197, 73, 2, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 9998;
}

.okobot-position-bottom-right #okobot-button {
    bottom: 20px;
    right: 20px;
}

.okobot-position-bottom-left #okobot-button {
    bottom: 20px;
    left: 20px;
}

#okobot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(197, 73, 2, 0.6);
}

#okobot-button svg {
    width: 25px;
    height: 25px;
    fill: white;
}

/* Contenedor del chat */
#okobot-container {
    position: fixed;
    bottom: 90px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

.okobot-position-bottom-right #okobot-container {
    right: 20px;
}

.okobot-position-bottom-left #okobot-container {
    left: 20px;
}

#okobot-container.open {
    display: flex;
}

/* Header */
#okobot-header {
    background: linear-gradient(135deg, var(--okobot-primary-color, #c54902) 0%, color-mix(in srgb, var(--okobot-primary-color, #c54902) 80%, white) 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.okologotxt{
  color: white;
  -webkit-text-stroke: 1px #c54902;
}
#okobot-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

#okobot-header p {
    font-size: 12px;
    opacity: 0.9;
    margin: 4px 0 0 0;
}
.okobot-message-content strong {
    font-weight: 600;
    color: inherit;
}

.okobot-message-content em {
    font-style: italic;
}
#okobot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

#okobot-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mensajes */
#okobot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

.okobot-message {
    margin-bottom: 16px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.okobot-message-bot {
    display: flex;
    gap: 8px;
}

.okobot-message-user {
    display: flex;
    justify-content: flex-end;
}

.okobot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--okobot-primary-color, #c54902);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.okobot-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 75%;
    line-height: 1.5;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.okobot-message-user .okobot-message-content {
    background: var(--okobot-primary-color, #c54902);
    color: white;
}

.okobot-sources {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.7;
}

.okobot-sources a {
    color: var(--okobot-primary-color, #c54902);
    text-decoration: none;
    display: block;
    margin-top: 4px;
}

.okobot-sources a:hover {
    text-decoration: underline;
}

.okobot-loading {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.okobot-loading span {
    width: 8px;
    height: 8px;
    background: var(--okobot-primary-color, #c54902);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.okobot-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.okobot-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Input */
#okobot-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

#okobot-input-form {
    display: flex;
    flex-direction: column;
    gap: 0; /* Sin espacio entre elementos */
}
#okobot-input-form > div {
    display: flex;
    gap: 8px;
    align-items: center; /* Centra verticalmente */
}

#okobot-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: border-color 0.2s;
}

#okobot-input:focus {
    border-color: var(--okobot-primary-color);
}

#okobot-send {
    background: var(--okobot-primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
    white-space: nowrap;
    flex-shrink: 0; /* Evita que el botón se encoja */
}

#okobot-send:hover {
    opacity: 0.9;
}
#okobot-send:hover:not(:disabled) {
    background: color-mix(in srgb, var(--okobot-primary-color, #c54902) 80%, black);
}

#okobot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
    #okobot-container {
        width: 100% !important;
        height: 100% !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 0;
    }
}
/* Tooltip de atención */
.okobot-tooltip {
    position: fixed;
    background: white;
    color: #333;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 250px;
    z-index: 999998;
    animation: okobot-tooltip-bounce 0.5s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Posición según ubicación del botón */
.okobot-position-bottom-right .okobot-tooltip {
    bottom: 90px;
    right: 30px;
}

.okobot-position-bottom-left .okobot-tooltip {
    bottom: 90px;
    left: 30px;
}

.okobot-position-top-right .okobot-tooltip {
    top: 90px;
    right: 30px;
}

.okobot-position-top-left .okobot-tooltip {
    top: 90px;
    left: 30px;
}

/* Flecha del tooltip apuntando al botón */
.okobot-position-bottom-right .okobot-tooltip::after,
.okobot-position-bottom-left .okobot-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

.okobot-position-bottom-right .okobot-tooltip::after {
    right: 25px;
}

.okobot-position-bottom-left .okobot-tooltip::after {
    left: 25px;
}

.okobot-position-top-right .okobot-tooltip::after,
.okobot-position-top-left .okobot-tooltip::after {
    content: '';
    position: absolute;
    top: -8px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white;
}

.okobot-position-top-right .okobot-tooltip::after {
    right: 25px;
}

.okobot-position-top-left .okobot-tooltip::after {
    left: 25px;
}

/* Contenido del tooltip */
.okobot-tooltip-content {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Botón cerrar tooltip */
.okobot-tooltip-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 1;
    transition: color 0.2s;
}

.okobot-tooltip-close:hover {
    color: #333;
}

/* Animación de aparición */
@keyframes okobot-tooltip-bounce {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    50% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .okobot-tooltip {
        max-width: 200px;
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .okobot-position-bottom-right .okobot-tooltip,
    .okobot-position-bottom-left .okobot-tooltip {
        bottom: 80px;
    }
}