/* ═══════════════════════════════════════════════════════
   Newsy AI — sidebar chat card
   Sits below the TOC inside .na-sidebar (sticky)
   ═══════════════════════════════════════════════════════ */

/* ── Chat card ─────────────────────────────────────────── */
.nc-card {
  margin-top: 0.875rem;
  background: linear-gradient(160deg, rgba(255,0,127,0.07) 0%, rgba(13,13,20,0.95) 55%);
  border: 1px solid rgba(255,0,127,0.18);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35),
              0 0 0 1px rgba(255,255,255,0.03) inset;
}

/* ── Collapsed trigger ─────────────────────────────────── */
.nc-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.2s;
}

.nc-trigger:hover {
  background: rgba(255,0,127,0.06);
}

.nc-trigger-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff007f 0%, #cc0066 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255,0,127,0.35);
}

.nc-trigger-icon .material-symbols-outlined {
  font-size: 0.95rem;
  color: #fff;
}

.nc-trigger-text {
  flex: 1;
  min-width: 0;
}

.nc-trigger-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.nc-trigger-sub {
  font-size: 0.68rem;
  color: rgba(248,245,253,0.38);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nc-trigger-chevron {
  font-size: 1.1rem;
  color: rgba(248,245,253,0.25);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), background 0.2s, color 0.2s;
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.nc-card.open .nc-trigger-chevron {
  transform: rotate(180deg);
  background: rgba(255,0,127,0.12);
  color: rgba(248,245,253,0.6);
}


/* ── Expanded panel ────────────────────────────────────── */
.nc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid transparent;
}

.nc-card.open .nc-panel {
  grid-template-rows: 1fr;
  border-top-color: rgba(255,255,255,0.06);
}

.nc-panel-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Messages area ─────────────────────────────────────── */
.nc-messages {
  height: 260px;
  overflow-y: auto;
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  scroll-behavior: smooth;
}

.nc-messages::-webkit-scrollbar { width: 3px; }
.nc-messages::-webkit-scrollbar-track { background: transparent; }
.nc-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
}

/* ── Welcome state ─────────────────────────────────────── */
.nc-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 0.5rem 0.25rem;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.nc-welcome-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,0,127,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.1rem;
}

.nc-welcome-icon .material-symbols-outlined {
  font-size: 1.1rem;
  color: #ff007f;
}

.nc-welcome-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.nc-welcome-sub {
  font-size: 0.72rem;
  color: rgba(248,245,253,0.38);
  line-height: 1.5;
  margin: 0;
}

/* starter chips */
.nc-starters {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  margin-top: 0.5rem;
}

.nc-starter-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  font-size: 0.71rem;
  color: rgba(248,245,253,0.55);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  line-height: 1.35;
}

.nc-starter-chip:hover {
  background: rgba(255,0,127,0.08);
  border-color: rgba(255,0,127,0.25);
  color: rgba(248,245,253,0.85);
}

/* ── Message bubbles ───────────────────────────────────── */
.nc-msg {
  display: flex;
}

.nc-msg--user      { justify-content: flex-end; }
.nc-msg--assistant { justify-content: flex-start; }

.nc-bubble {
  max-width: 88%;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  font-size: 0.76rem;
  line-height: 1.55;
  word-break: break-word;
}

.nc-msg--user .nc-bubble {
  background: #ff007f;
  color: #fff;
  border-bottom-right-radius: 3px;
}

.nc-msg--assistant .nc-bubble {
  background: rgba(255,255,255,0.06);
  color: rgba(248,245,253,0.85);
  border-bottom-left-radius: 3px;
}

/* ── Typing dots ───────────────────────────────────────── */
.nc-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.15rem 0;
}

.nc-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(248,245,253,0.35);
  animation: nc-bounce 1.3s ease-in-out infinite;
}

.nc-dots span:nth-child(2) { animation-delay: 0.18s; }
.nc-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes nc-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* ── Input row ─────────────────────────────────────────── */
.nc-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.nc-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  color: #f8f5fd;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.76rem;
  line-height: 1.4;
  resize: none;
  outline: none;
  max-height: 100px;
  transition: border-color 0.2s;
}

.nc-input::placeholder { color: rgba(248,245,253,0.25); }

.nc-input:focus {
  border-color: rgba(255,0,127,0.45);
}

.nc-send {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ff007f;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
}

.nc-send:hover:not(:disabled) {
  background: #e0006e;
  transform: scale(1.06);
}

.nc-send:disabled {
  background: rgba(255,255,255,0.07);
  color: rgba(248,245,253,0.2);
  cursor: not-allowed;
  transform: none;
}

.nc-send .material-symbols-outlined { font-size: 0.95rem; }

/* ── Mobile bottom sheet ───────────────────────────────── */
@media (max-width: 960px) {
  .nc-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: #0d0d14;
  }

  .nc-card.open {
    transform: translateY(0);
  }


  .nc-panel {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .nc-messages {
    height: auto;
    flex: 1;
  }

  .nc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
  }

  .nc-overlay.visible {
    display: block;
  }
}

/* ── Footer ────────────────────────────────────────────── */
.nc-footer {
  text-align: center;
  font-size: 0.6rem;
  color: rgba(248,245,253,0.18);
  padding: 0.3rem 0.75rem 0.45rem;
  background: rgba(0,0,0,0.15);
  letter-spacing: 0.03em;
}
