/* ============================================
   AMAZONIA — asistente.css
   Módulo 3: Asistente de Consultoría
   Chat con base de conocimiento local.
   Interfaz conversacional con el personaje SVG.
   ============================================ */

/* ── Contenedor principal ───────────────── */
.asistente-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ── Cabecera del asistente ──────────────── */
.asistente-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0,230,118,0.07) 0%, rgba(41,121,255,0.05) 100%);
    border: 1px solid rgba(0,230,118,0.15);
    border-radius: 20px;
}

.asistente-avatar {
    width: 68px;
    height: 68px;
    background: #090d23;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(0,230,118,0.25);
    overflow: visible;
    position: relative;
}

.asistente-avatar svg {
    width: 56px;
    height: 60px;
}

.asistente-avatar-glow {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,230,118,0.15) 0%, transparent 70%);
    animation: pulseGlow 3s ease-in-out infinite;
    pointer-events: none;
}

.asistente-header-texto h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.2rem;
}

.asistente-header-texto p {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.45;
}

.asistente-estado {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-top: 0.3rem;
}

.asistente-estado-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ── Sugerencias rápidas ─────────────────── */
.asistente-sugerencias {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.asistente-sugerencias-label {
    width: 100%;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
    margin-bottom: 0.1rem;
}

.sugerencia-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.sugerencia-chip:hover {
    background: rgba(0,230,118,0.1);
    border-color: rgba(0,230,118,0.35);
    color: var(--color-primary);
}

.sugerencia-chip i {
    font-size: 0.7rem;
    color: var(--color-primary);
}

/* ── Área de chat ────────────────────────── */
.asistente-chat {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;
    overflow: hidden;
}

.chat-mensajes {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.5rem;
    min-height: 360px;
    max-height: 520px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-mensajes::-webkit-scrollbar {
    width: 4px;
}
.chat-mensajes::-webkit-scrollbar-track {
    background: transparent;
}
.chat-mensajes::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
}

/* ── Burbuja de mensaje ──────────────────── */
.chat-msg {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    animation: fadeInUp 0.2s ease both;
}

.chat-msg.usuario {
    flex-direction: row-reverse;
}

.chat-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    align-self: flex-end;
}

.chat-msg.asistente .chat-msg-avatar {
    background: #090d23;
    border: 1px solid rgba(0,230,118,0.25);
    color: var(--color-primary);
}

.chat-msg.usuario .chat-msg-avatar {
    background: rgba(41,121,255,0.15);
    border: 1px solid rgba(41,121,255,0.3);
    color: var(--color-secondary);
}

.chat-msg-burbuja {
    max-width: 78%;
    padding: 0.85rem 1.1rem;
    border-radius: 18px;
    font-size: 0.875rem;
    line-height: 1.6;
}

.chat-msg.asistente .chat-msg-burbuja {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-bottom-left-radius: 6px;
    color: var(--color-text-primary);
}

.chat-msg.usuario .chat-msg-burbuja {
    background: rgba(41,121,255,0.15);
    border: 1px solid rgba(41,121,255,0.25);
    border-bottom-right-radius: 6px;
    color: var(--color-text-primary);
    text-align: right;
}

.chat-msg-burbuja strong {
    color: var(--color-primary);
    font-weight: 700;
}

.chat-msg-burbuja ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-msg-burbuja li {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* ── Typing indicator ────────────────────── */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chat-typing-dots {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
}

.chat-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0.5;
    animation: typingBounce 1.4s ease-in-out infinite;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40%           { transform: translateY(-6px); opacity: 1; }
}

/* ── Input area ──────────────────────────── */
.chat-input-area {
    display: flex;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.02);
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 0.7rem 1rem;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    font-family: var(--font-family-base);
    resize: none;
    min-height: 44px;
    max-height: 120px;
    line-height: 1.5;
    transition: border-color 0.2s;
    outline: none;
}

.chat-input::placeholder {
    color: var(--color-text-muted);
}

.chat-input:focus {
    border-color: rgba(0,230,118,0.4);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--color-primary);
    border: none;
    color: #000;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, background 0.15s;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.08);
    background: #1eff8a;
}

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Temas explorar ──────────────────────── */
.asistente-temas {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.asistente-temas-titulo {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
}

.temas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.6rem;
}

.tema-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.tema-chip:hover {
    background: rgba(0,230,118,0.08);
    border-color: rgba(0,230,118,0.25);
    color: var(--color-text-primary);
}

.tema-chip i {
    font-size: 0.85rem;
    color: var(--color-primary);
    width: 16px;
    text-align: center;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
    .asistente-container { padding: 1.5rem 1rem 3rem; }
    .chat-mensajes { min-height: 280px; max-height: 400px; }
    .chat-msg-burbuja { max-width: 88%; font-size: 0.84rem; }
    .temas-grid { grid-template-columns: repeat(2, 1fr); }
    .asistente-sugerencias .sugerencia-chip { font-size: 0.73rem; padding: 0.4rem 0.75rem; }
    .asistente-header { gap: 0.9rem; padding: 1.1rem; }
    .asistente-avatar { width: 54px; height: 54px; }
    .asistente-avatar svg { width: 44px; height: 48px; }
}
