/* ── Demo Page Styles ─────────────────────────────────────────────── */

.demo-hero {
  padding: 60px 0 40px;
  text-align: center;
}

.demo-hero h1 {
  font-size: 2.8rem;
  font-weight: 900;
}

.demo-hero p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ── NPC Cards ───────────────────────────────────────────────────── */

.npc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.npc-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.npc-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.npc-card-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.npc-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.npc-role-badge {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.npc-faction {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

.npc-demographics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
}

.npc-demographics span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.npc-quote {
  font-style: italic;
  color: var(--cyan);
  font-size: 13px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(34, 211, 238, 0.03);
}

.npc-card-body {
  padding: 16px 20px;
}

/* ── Trait Pills ─────────────────────────────────────────────────── */

.trait-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.trait-pill {
  background: var(--bg-3);
  color: var(--text);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.speech-badge {
  background: rgba(163, 113, 247, 0.12);
  color: var(--purple);
  border-color: rgba(163, 113, 247, 0.25);
}

/* ── OCEAN Bars ──────────────────────────────────────────────────── */

.ocean-section {
  margin-bottom: 14px;
}

.ocean-section h6 {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.ocean-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12px;
}

.ocean-bar .label {
  width: 16px;
  font-weight: 700;
  color: var(--text-muted);
}

.ocean-bar .track {
  flex: 1;
  height: 6px;
  background: var(--bg-0);
  border-radius: 3px;
  overflow: hidden;
}

.ocean-bar .fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.ocean-bar .value {
  width: 28px;
  text-align: right;
  color: var(--text-muted);
  font-size: 11px;
}

.ocean-o .fill { background: var(--cyan); }
.ocean-c .fill { background: var(--accent); }
.ocean-e .fill { background: var(--gold); }
.ocean-a .fill { background: var(--pink); }
.ocean-n .fill { background: var(--red); }

/* ── Features / Distinguishing ────────────────────────────────────── */

.features-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.feature-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-1);
  padding: 2px 8px;
  border-radius: 8px;
}

/* ── Tabs ─────────────────────────────────────────────────────────── */

.npc-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 0 -20px;
  padding: 0 20px;
}

.npc-tab {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.npc-tab:hover {
  color: var(--text);
}

.npc-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.npc-tab-content {
  display: none;
  padding-top: 14px;
}

.npc-tab-content.active {
  display: block;
}

/* ── Schedule Timeline ────────────────────────────────────────────── */

.schedule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  position: relative;
}

.schedule-item + .schedule-item {
  border-top: 1px solid rgba(48, 54, 61, 0.5);
}

.schedule-time {
  color: var(--accent);
  font-weight: 600;
  min-width: 50px;
  font-size: 12px;
}

.schedule-activity {
  color: var(--text);
  flex: 1;
}

.schedule-location {
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

/* ── Psychology ───────────────────────────────────────────────────── */

.psych-section {
  margin-bottom: 12px;
}

.psych-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stress-bar {
  height: 8px;
  background: var(--bg-0);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.stress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.stress-low { background: var(--green); }
.stress-med { background: var(--gold); }
.stress-high { background: var(--red); }

.psych-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fear-tag {
  font-size: 11px;
  background: rgba(218, 54, 51, 0.1);
  color: var(--red);
  padding: 2px 8px;
  border-radius: 8px;
}

.ambition-tag {
  font-size: 11px;
  background: rgba(210, 153, 34, 0.1);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 8px;
}

.goal-item {
  font-size: 13px;
  color: var(--text-light);
  padding: 4px 0;
}

.goal-item i {
  color: var(--accent);
  margin-right: 4px;
}

/* ── Talk Button ──────────────────────────────────────────────────── */

.npc-card-footer {
  padding: 12px 20px 16px;
}

.btn-talk {
  width: 100%;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.25);
  padding: 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-talk:hover {
  background: rgba(74, 222, 128, 0.2);
  border-color: var(--accent);
}

/* ── Chat Panel ──────────────────────────────────────────────────── */

.chat-overlay {
  position: fixed;
  top: 0;
  right: -460px;
  width: 460px;
  height: 100vh;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

.chat-overlay.open {
  right: 0;
}

.chat-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.chat-backdrop.open {
  display: block;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.chat-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
}

.chat-close:hover {
  color: var(--text);
}

.chat-hint {
  padding: 8px 20px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-0);
  text-align: center;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-msg.player {
  align-self: flex-end;
  background: var(--accent-glow);
  color: var(--text);
  border-bottom-right-radius: 4px;
}

.chat-msg.npc {
  align-self: flex-start;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-msg .emotion-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--cyan);
  margin-top: 6px;
}

.chat-msg .action-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--purple);
  margin-top: 2px;
}

.chat-msg .trade-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--gold);
  margin-top: 2px;
}

.chat-input-area {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.chat-input:focus {
  border-color: var(--accent);
}

.chat-send {
  background: var(--accent);
  color: var(--bg-0);
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.chat-send:hover {
  filter: brightness(1.1);
}

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

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .npc-grid {
    grid-template-columns: 1fr;
  }

  .chat-overlay {
    width: 100vw;
    right: -100vw;
  }

  .demo-hero h1 {
    font-size: 2rem;
  }
}
