/* LTI Asistente Virtual - Modern Premium UI */

:root {
    --lti-av-primary: #004a99; /* Deep Security Blue */
    --lti-av-accent: #2ecc71;  /* Success Green */
    --lti-av-bg: rgba(255, 255, 255, 0.95);
    --lti-av-text: #1d1d1f;    /* Apple-style text */
    --lti-av-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --lti-av-glass: blur(12px) saturate(180%);
    --lti-av-radius: 20px;
    --lti-av-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Floating Launcher */
#lti-av-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--lti-av-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--lti-av-shadow);
    z-index: 99999;
    transition: var(--lti-av-transition);
}

#lti-av-launcher:hover {
    transform: scale(1.1) rotate(5deg);
}

#lti-av-launcher svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* Chat Window */
#lti-av-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: var(--lti-av-bg);
    backdrop-filter: var(--lti-av-glass);
    -webkit-backdrop-filter: var(--lti-av-glass);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--lti-av-radius);
    box-shadow: var(--lti-av-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99998;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: var(--lti-av-transition);
}

#lti-av-window.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.lti-av-header {
    padding: 24px;
    background: var(--lti-av-primary);
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.lti-av-header img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.lti-av-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.lti-av-header p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Messages Area */
.lti-av-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lti-av-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.lti-av-message.bot {
    background: #f1f1f1;
    color: var(--lti-av-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.lti-av-message.user {
    background: var(--lti-av-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Option Buttons */
.lti-av-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.lti-av-option {
    padding: 10px 18px;
    background: white;
    border: 1px solid var(--lti-av-primary);
    color: var(--lti-av-primary);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--lti-av-transition);
}

.lti-av-option:hover {
    background: var(--lti-av-primary);
    color: white;
}

/* Input Area */
.lti-av-footer {
    padding: 20px;
    background: white;
    border-top: 1px solid #efefef;
    display: flex;
    gap: 10px;
}

.lti-av-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--lti-av-transition);
}

.lti-av-input:focus {
    border-color: var(--lti-av-primary);
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.1);
}

.lti-av-send {
    background: var(--lti-av-primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product Cards */
.lti-av-product-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.lti-av-product-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background: #f9f9f9;
}

.lti-av-product-info {
    padding: 15px;
}

.lti-av-product-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.lti-av-product-price {
    color: var(--lti-av-primary);
    font-weight: 700;
    margin-bottom: 10px;
}

.lti-av-add-to-cart {
    width: 100%;
    padding: 10px;
    background: var(--lti-av-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.lti-av-message.typing {
    display: flex;
    gap: 4px;
    padding: 15px 20px;
}

.lti-av-message.typing::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #aaa;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

/* Mobile Optimizations */
@media screen and (max-width: 480px) {
    #lti-av-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}
