/* Poyco Asistente Virtual - Chat Styles */

#poyco-asistente-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#poyco-asistente-widget.poyco-asistente-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

#poyco-asistente-widget.poyco-asistente-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Botón flotante */
.poyco-asistente-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
}

.poyco-asistente-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.poyco-asistente-toggle svg {
    width: 28px;
    height: 28px;
    transition: all 0.3s ease;
}

.poyco-asistente-toggle .poyco-icon-close {
    display: none;
    position: absolute;
}

.poyco-asistente-toggle.active .poyco-icon-chat {
    display: none;
}

.poyco-asistente-toggle.active .poyco-icon-close {
    display: block;
}

/* Ventana de chat */
.poyco-asistente-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.poyco-asistente-position-bottom-right .poyco-asistente-window {
    right: 0;
}

.poyco-asistente-position-bottom-left .poyco-asistente-window {
    left: 0;
}

.poyco-asistente-window.active {
    display: flex;
}

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

/* Header */
.poyco-asistente-header {
    padding: 16px 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.poyco-asistente-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.poyco-asistente-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    object-fit: cover;
}

.poyco-asistente-header-text {
    display: flex;
    flex-direction: column;
}

.poyco-asistente-header-text strong {
    font-size: 15px;
    font-weight: 600;
}

.poyco-asistente-status {
    font-size: 12px;
    opacity: 0.9;
}

.poyco-asistente-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.poyco-asistente-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.poyco-asistente-close svg {
    width: 20px;
    height: 20px;
}

/* Área de mensajes */
.poyco-asistente-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8f9fa;
}

.poyco-asistente-messages::-webkit-scrollbar {
    width: 6px;
}

.poyco-asistente-messages::-webkit-scrollbar-track {
    background: transparent;
}

.poyco-asistente-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

/* Mensajes */
.poyco-asistente-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.poyco-asistente-message-bot {
    justify-content: flex-start;
}

.poyco-asistente-message-user {
    justify-content: flex-end;
}

.poyco-asistente-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.poyco-asistente-message-bot .poyco-asistente-message-content {
    background: white;
    color: #2d3748;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.poyco-asistente-message-user .poyco-asistente-message-content {
    background: #FF5722;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Indicador de escritura */
.poyco-asistente-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: 60px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.poyco-asistente-typing span {
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Input */
.poyco-asistente-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

#poyco-asistente-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.poyco-asistente-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.poyco-asistente-input:focus {
    border-color: #FF5722;
}

.poyco-asistente-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
    flex-shrink: 0;
}

.poyco-asistente-send:hover:not(:disabled) {
    transform: scale(1.05);
}

.poyco-asistente-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.poyco-asistente-send svg {
    width: 18px;
    height: 18px;
}

/* Mensaje de error */
.poyco-asistente-error {
    background: #fee;
    color: #c33;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin: 8px 0;
    border-left: 3px solid #c33;
}

/* Responsive */
@media (max-width: 480px) {
    .poyco-asistente-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }
    
    #poyco-asistente-widget.poyco-asistente-position-bottom-right {
        right: 10px;
    }
    
    #poyco-asistente-widget.poyco-asistente-position-bottom-left {
        left: 10px;
    }
}
