/* ============================================================
   nsqkGPT — chat
   Reusa tokens y topbar de era.css. Estética alineada con la
   sheet de canciones (catalog.css): acento por canción, portada
   con glow, títulos en Bricolage, links en pills.
   ============================================================ */

.chat-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg, #0a0a0a);
}

/* ---------- Header ---------- */
.chat-hero {
    padding: 110px 20px 18px;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.chat-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--fg-faint, rgba(255,255,255,0.35));
    margin-bottom: 12px;
}

.chat-hero-eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #36d399;
    box-shadow: 0 0 10px #36d399;
}

.chat-hero-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: clamp(30px, 8vw, 46px);
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.chat-hero-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--fg-dim, rgba(255,255,255,0.6));
    font-weight: 300;
}

/* ---------- Thread ---------- */
.chat-thread {
    flex: 1;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 8px 16px 150px;
    display: flex;
    flex-direction: column;
}

.msg {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    width: 100%;
    animation: msg-in 0.45s var(--ease, cubic-bezier(0.25,0.8,0.25,1)) both;
}

.msg.user { flex-direction: row-reverse; }

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

.msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.msg.user .msg-avatar { display: none; }

.msg-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 80%;
    min-width: 0;
}

.msg.user .msg-col { align-items: flex-end; }

.msg-bubble {
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.6;
    border-radius: 18px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.msg.bot .msg-bubble {
    background: var(--glass-bg, rgba(20,20,20,0.55));
    border: 1px solid var(--glass-border, rgba(255,255,255,0.12));
    border-top-left-radius: 6px;
    color: var(--fg, #fff);
}

.msg.user .msg-bubble {
    background: #ffffff;
    color: #0a0a0a;
    border-top-right-radius: 6px;
    font-weight: 500;
}

.msg-name {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-faint, rgba(255,255,255,0.35));
    margin-bottom: 2px;
}

/* ---------- Typing (3 puntos estilo WhatsApp) ---------- */
.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 15px 18px;
    border-radius: 18px;
    border-top-left-radius: 6px;
    background: var(--glass-bg, rgba(20,20,20,0.55));
    border: 1px solid var(--glass-border, rgba(255,255,255,0.12));
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fg-dim, rgba(255,255,255,0.6));
    animation: typing-blink 1.4s infinite both;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-blink {
    0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
    30%           { opacity: 1;    transform: translateY(-3px); }
}

/* ---------- Card de canción (estética sheet) ---------- */
.songcard {
    --accent: #ffffff;
    background: #0c0c0c;
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid var(--accent);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.3s var(--ease, ease), transform 0.3s var(--ease, ease);
}

.songcard:hover { transform: translateY(-2px); }

.songcard-top {
    display: flex;
    gap: 14px;
    padding: 14px;
    align-items: center;
}

.songcard-cover {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #171717;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 28%, transparent);
}

.songcard-info { min-width: 0; }

.songcard-album {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.songcard-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: clamp(18px, 5vw, 22px);
    line-height: 1.05;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.songcard-artists {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-dim, rgba(255,255,255,0.6));
}

.songcard-funfact {
    margin: 0 14px 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255,255,255,0.78);
    font-weight: 300;
}

.songcard-funfact b {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-faint, rgba(255,255,255,0.35));
    margin-bottom: 6px;
}

.songcard-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 14px 14px;
}

.songcard-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    font-weight: 500;
    color: var(--fg, #fff);
    transition: background 0.25s var(--ease, ease), border-color 0.25s var(--ease, ease);
}

.songcard-link:hover {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.songcard-link span { color: var(--fg-faint, rgba(255,255,255,0.35)); font-size: 11px; }

.songcard-lyrics {
    background: var(--accent);
    color: var(--accent-text, #060606);
    border-color: transparent;
    font-weight: 600;
}
.songcard-lyrics span { color: inherit; opacity: 0.7; }
.songcard-lyrics:hover { filter: brightness(0.95); background: var(--accent); }

/* ---------- "Era por humor" (flujo de crisis) ---------- */
.crisis-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.crisis-btn {
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--fg-dim, rgba(255,255,255,0.6));
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.25s var(--ease, ease), color 0.25s var(--ease, ease);
}
.crisis-btn:hover { background: rgba(255,255,255,0.1); color: var(--fg, #fff); }

/* ---------- Barra de entrada ---------- */
.chat-inputbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, rgba(8,8,8,0.85) 30%, rgba(8,8,8,0.95));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.chat-suggestions {
    max-width: 780px;
    margin: 0 auto 10px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.chat-suggestions::-webkit-scrollbar { display: none; }

.chat-chip {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--fg-dim, rgba(255,255,255,0.6));
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.25s var(--ease, ease), color 0.25s var(--ease, ease);
}
.chat-chip:hover { background: rgba(255,255,255,0.1); color: var(--fg, #fff); }

.chat-form {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: rgba(22,22,22,0.9);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 24px;
    padding: 7px 7px 7px 18px;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--fg, #fff);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    resize: none;
    max-height: 120px;
    padding: 9px 0;
    outline: none;
}
.chat-input::placeholder { color: var(--fg-faint, rgba(255,255,255,0.35)); }

.chat-send {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #0a0a0a;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s var(--ease, ease), opacity 0.25s var(--ease, ease);
}
.chat-send:hover { transform: scale(1.06); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

@media (min-width: 480px) {
    .songcard-cover { width: 88px; height: 88px; }
}
