/* ==========================================================================
   QUZGO WORLD HISTORY TIME MACHINE — STYLES (style.css)
   Token-driven stylesheet for timeline navigator, independence cards & quiz.
   ========================================================================== */

.history-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-3) var(--space-12);
}

/* Header & Hero */
.history-hero {
  text-align: center;
  margin-bottom: var(--space-8);
}

.history-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.history-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: var(--space-2);
  color: var(--text);
}

.history-subtitle {
  color: var(--text-muted);
  font-size: var(--text-base);
  max-width: 680px;
  margin: 0 auto;
}

/* Tabs Bar */
.history-tabs-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  background: var(--bg-deep);
  padding: var(--space-2);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.history-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.history-tab-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.history-tab-btn.active {
  background: var(--accent);
  color: var(--bg-deep);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* Epoch Navigation Bar */
.epoch-bar-wrapper {
  margin-bottom: var(--space-6);
}

.epoch-nav {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scrollbar-width: thin;
}

.epoch-pill-btn {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--duration-fast) ease;
}

.epoch-pill-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.epoch-pill-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.history-search-row {
  margin-top: var(--space-3);
  display: flex;
  justify-content: flex-end;
}

.history-search {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: var(--text);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--duration-fast) ease;
}

.history-search:focus {
  border-color: var(--accent);
}

/* Timeline Layout */
.timeline-container {
  position: relative;
  margin-top: var(--space-6);
}

.timeline-item {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  position: relative;
}

.timeline-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.timeline-marker {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.timeline-line {
  width: 2px;
  background: var(--border);
  flex-grow: 1;
  margin-top: var(--space-1);
}

.timeline-content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
  flex-grow: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: transform var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

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

.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.timeline-year-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-md);
}

.timeline-location-tag {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
  color: var(--text);
}

.timeline-headline {
  font-size: var(--text-sm);
  color: var(--info);
  font-weight: 600;
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

.timeline-impact-box {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text);
}

.timeline-impact-box strong {
  display: block;
  color: var(--secondary);
  margin-bottom: var(--space-1);
}

.timeline-fact-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text-muted);
}

.timeline-fact-box strong {
  display: block;
  color: var(--primary-light);
  margin-bottom: var(--space-1);
}

/* Independence Showcase Grid */
.independence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.independence-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.ind-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.ind-flag-icon {
  font-size: 2rem;
}

.ind-year-badge {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-md);
}

.ind-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  margin-bottom: var(--space-1);
  color: var(--text);
}

.ind-location {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.ind-headline {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.ind-impact {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}

/* Chrono-Quiz Card */
.chrono-quiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  max-width: 680px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.chrono-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.chrono-question {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: var(--space-6);
  text-align: center;
  min-height: 70px;
}

.chrono-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.btn-chrono-option {
  padding: var(--space-4);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.btn-chrono-option:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.btn-chrono-next {
  width: 100%;
  padding: var(--space-3);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-lg);
  color: var(--bg-deep);
  font-weight: 800;
  font-size: var(--text-base);
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.empty-history-state {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
}

.empty-history-state span {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-2);
}

.hidden { display: none !important; }
