/*
 * 🎨 Estilos Modernizados - Random AI (v2.0.0)
 * Color principal: #9B62DF | Inspiración: UI Limpia y Profesional
 */

/* --- Botón Flotante (FAB) --- */
#random-ai-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background-image: url('https://random.ar/wp-content/uploads/2025/10/cropped-Recurso-1.png');
    background-color: #9B62DF; 
    background-position: center;
    background-repeat: no-repeat;
    background-size: 60%;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(155, 98, 223, 0.4);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#random-ai-fab:hover { transform: scale(1.1) rotate(5deg); }

/* --- Ventana Principal --- */
#random-ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 600px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

/* --- Cabecera --- */
.random-ai-header {
    background: linear-gradient(135deg, #9B62DF 0%, #7d48c9 100%);
    color: white;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.random-ai-title { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.3px; }

.random-ai-header-buttons { display: flex; gap: 10px; }
.random-ai-header-buttons a, #random-ai-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white !important;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}
.random-ai-header-buttons a:hover { background: rgba(255,255,255,0.3); }

/* --- Contenedor de Mensajes --- */
.random-ai-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fdfdfd;
    display: flex;
    flex-direction: column;
}

/* Burbujas de Chat (Nuevas Clases) */
.rai-msg {
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.45;
    max-width: 85%;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.rai-user {
    align-self: flex-end;
    background: #9B62DF;
    color: white;
    border-bottom-right-radius: 4px;
}

.rai-bot {
    align-self: flex-start;
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

/* --- Opciones (Pills) --- */
.rai-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.rai-opt-btn {
    background: white;
    border: 1.5px solid #9B62DF;
    color: #9B62DF;
    padding: 7px 15px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.rai-opt-btn:hover { background: #9B62DF; color: white; }

/* --- Grilla de Productos (Modernizada) --- */
.product-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
}

.product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    transition: 0.3s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.08); }

.product-card img { width: 100%; border-radius: 8px; margin-bottom: 8px; }

.product-name { font-size: 0.8rem; font-weight: bold; margin-bottom: 8px; color: #444; height: 2.4em; overflow: hidden; }

.product-link {
    background: #1d2327;
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    padding: 6px;
    display: block;
    border-radius: 6px;
}

/* --- Área de Entrada --- */
.random-ai-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
}

#random-ai-input {
    flex-grow: 1;
    border: 1.5px solid #eee;
    border-radius: 25px;
    padding: 10px 18px;
    outline: none;
    transition: 0.3s;
}
#random-ai-input:focus { border-color: #9B62DF; }

#random-ai-send {
    background: #9B62DF;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Móviles */
@media (max-width: 480px) {
    #random-ai-chat-window { bottom: 0; right: 0; width: 100%; height: 100%; border-radius: 0; }
}