/* ═══════════════════════════════════════════════════════════════
   QUEST JOURNAL — Quest tracking, lore, and items
   Theme: dark medieval gold (#d4a545)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Journal Root ─── */
.qj-root {
  padding: 16px;
  overflow-y: auto;
  max-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 165, 69, 0.2) transparent;
}

/* ─── Sub-tabs (Quests / Lore / Items) ─── */
.qj-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(212, 165, 69, 0.15);
  padding-bottom: 8px;
}

.qj-tab-btn {
  background: none;
  border: 1px solid rgba(212, 165, 69, 0.15);
  color: rgba(212, 165, 69, 0.6);
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  transition: all 0.2s;
}

.qj-tab-btn:hover {
  color: #d4a545;
  background: rgba(212, 165, 69, 0.06);
}

.qj-tab-btn.active {
  color: #d4a545;
  background: rgba(212, 165, 69, 0.1);
  border-bottom-color: transparent;
}

/* ─── Section Headers ─── */
.qj-section-title {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: #d4a545;
  margin: 0 0 12px 0;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════
   QUEST CARDS
   ═══════════════════════════════════════════════════════════════ */

.qj-quest-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qj-quest-card {
  background: linear-gradient(135deg, rgba(20, 16, 10, 0.9), rgba(30, 24, 14, 0.85));
  border: 1px solid rgba(212, 165, 69, 0.12);
  border-radius: 6px;
  padding: 12px 14px;
  transition: border-color 0.2s;
}

.qj-quest-card:hover {
  border-color: rgba(212, 165, 69, 0.3);
}

.qj-quest-card.completed {
  opacity: 0.6;
  border-color: rgba(100, 180, 100, 0.2);
}

/* ─── Quest Header ─── */
.qj-quest-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.qj-quest-npc-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212, 165, 69, 0.3);
  flex-shrink: 0;
}

.qj-quest-npc-emoji {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212, 165, 69, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.qj-npc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  border: 2px solid rgba(212, 165, 69, 0.4);
  flex-shrink: 0;
}

.qj-quest-info {
  flex: 1;
  min-width: 0;
}

.qj-quest-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  color: #e8d5a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qj-quest-npc-name {
  font-family: 'Crimson Text', serif;
  font-size: 11px;
  color: rgba(212, 165, 69, 0.6);
}

.qj-quest-arc {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  color: rgba(212, 165, 69, 0.4);
  padding: 2px 8px;
  border: 1px solid rgba(212, 165, 69, 0.15);
  border-radius: 3px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── Quest Description ─── */
.qj-quest-desc {
  font-family: 'Crimson Text', serif;
  font-size: 13px;
  color: rgba(232, 213, 168, 0.7);
  line-height: 1.4;
  margin-bottom: 8px;
}

/* ─── Objectives ─── */
.qj-objectives {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.qj-objective {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Crimson Text', serif;
  font-size: 12px;
  color: rgba(232, 213, 168, 0.6);
  padding: 3px 0;
}

.qj-objective.done {
  color: rgba(100, 180, 100, 0.8);
  text-decoration: line-through;
  text-decoration-color: rgba(100, 180, 100, 0.3);
}

.qj-obj-check {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(212, 165, 69, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.qj-objective.done .qj-obj-check {
  background: rgba(100, 180, 100, 0.15);
  border-color: rgba(100, 180, 100, 0.4);
  color: #64b464;
}

.qj-obj-progress {
  font-size: 11px;
  color: rgba(212, 165, 69, 0.5);
  margin-left: auto;
}

/* ─── Rewards Preview ─── */
.qj-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(212, 165, 69, 0.08);
}

.qj-reward-tag {
  font-family: 'Crimson Text', serif;
  font-size: 11px;
  color: rgba(212, 165, 69, 0.7);
  background: rgba(212, 165, 69, 0.06);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(212, 165, 69, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   NPC CHAIN PROGRESS
   ═══════════════════════════════════════════════════════════════ */

.qj-chains {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.qj-chain-card {
  background: rgba(20, 16, 10, 0.8);
  border: 1px solid rgba(212, 165, 69, 0.1);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.qj-chain-npc {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  color: #e8d5a8;
}

.qj-chain-progress {
  font-family: 'Crimson Text', serif;
  font-size: 11px;
  color: rgba(212, 165, 69, 0.5);
  margin-left: auto;
}

.qj-chain-bar {
  width: 100%;
  height: 4px;
  background: rgba(212, 165, 69, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.qj-chain-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4a545, #ffd700);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════
   LORE ENTRIES
   ═══════════════════════════════════════════════════════════════ */

.qj-lore-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qj-lore-card {
  background: linear-gradient(135deg, rgba(15, 10, 25, 0.9), rgba(25, 18, 35, 0.85));
  border: 1px solid rgba(160, 120, 200, 0.15);
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.qj-lore-card:hover {
  border-color: rgba(160, 120, 200, 0.35);
}

.qj-lore-card.expanded {
  border-color: rgba(160, 120, 200, 0.3);
}

.qj-lore-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qj-lore-icon {
  font-size: 16px;
}

.qj-lore-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  color: #b8a0d4;
  flex: 1;
}

.qj-lore-category {
  font-family: 'Crimson Text', serif;
  font-size: 10px;
  color: rgba(160, 120, 200, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.qj-lore-text {
  font-family: 'Crimson Text', serif;
  font-size: 13px;
  color: rgba(200, 185, 220, 0.8);
  line-height: 1.5;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(160, 120, 200, 0.1);
  display: none;
}

.qj-lore-card.expanded .qj-lore-text {
  display: block;
}

/* ─── Available Quest Highlight ─── */
.qj-available-badge {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  animation: qj-pulse-badge 2s ease-in-out infinite;
}

@keyframes qj-pulse-badge {
  0%, 100% { opacity: 0.8; }
  50%      { opacity: 1; }
}

/* ─── Empty States ─── */
.qj-empty {
  text-align: center;
  padding: 32px 16px;
  font-family: 'Crimson Text', serif;
  font-size: 14px;
  color: rgba(212, 165, 69, 0.3);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

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

  .qj-quest-arc {
    display: none;
  }
}

@media (max-width: 480px) {
  .qj-root {
    padding: 10px;
  }

  .qj-quest-card {
    padding: 10px;
  }
}
