/* 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: 60px;
    height: 60px;
    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: 30px;
    height: 30px;
    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%, black) 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#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-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;
    gap: 8px;
}

#okobot-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#okobot-input:focus {
    border-color: var(--okobot-primary-color, #c54902);
}

#okobot-send {
    background: var(--okobot-primary-color, #c54902);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

#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;
    }
}