/* chronicle-dark.css – Dark theme layout (identical to light/high) */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* Header icon and title styling */

.header-icon {
  width: 2rem;
  height: 2rem;
  vertical-align: middle;
  margin-right: 0.5rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

body.theme-dark .header h1 .header-title {
  display: inline-block;
  vertical-align: middle;
  font-size: inherit;
  line-height: 1.2;
  color: #e6e6f0 !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  border-left: 6px solid #c97e5a;
  padding-left: 1rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--footer-border);
}
.footer-col h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}
.footer-col ul {
  list-style: none;
  padding: 0;
}
.footer-col li {
  margin-bottom: 0.4rem;
}
.footer-col a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.archive-home-link {
  margin-left: auto;
  text-decoration: none;
  font-weight: 500;
  padding: 0.3rem 1rem;
  border-radius: 2rem;
  background: var(--btn-bg);
  color: var(--btn-text);
}
.archive-home-link:hover {
  filter: brightness(0.95);
}

body.theme-dark {
  font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
  transition: background-color 0.2s ease, color 0.2s ease;
  padding: 2rem 1.5rem;
  background: var(--bg-body);
  color: var(--text-body);
}

body.theme-dark .container {
  max-width: 1400px;
  margin: 0 auto;
}

body.theme-dark .header h1 span {
  background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

body.theme-dark .event-card,
body.theme-dark .deep-event-card {
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

body.theme-dark .filter-panel,
body.theme-dark .table-wrapper,
body.theme-dark .deep-table,
body.theme-dark .arrow-scroll,
body.theme-dark .deep-arrow-scroll,
body.theme-dark .deep-timeline-section,
body.theme-dark .view-mode-bar,
body.theme-dark .lang-selector,
body.theme-dark .events-lang-selector,
body.theme-dark .campaign-selector,
body.theme-dark .theme-selector {
  background: var(--panel-bg);
}

body.theme-dark .tag-check,
body.theme-dark .type-btn,
body.theme-dark .reset-btn,
body.theme-dark .demo-add-btn {
  background: var(--btn-bg);
  border: var(--btn-border);
  color: var(--btn-text);
}

body.theme-dark .type-btn.active,
body.theme-dark .view-btn.active {
  background: var(--btn-active-bg);
  color: var(--btn-active-text);
}

body.theme-dark .timeline-table th {
  background: var(--table-header-bg);
  color: var(--table-header-text);
}

body.theme-dark .deep-table th {
  background: var(--deep-table-header-bg);
  color: var(--deep-table-header-text);
}

body.theme-dark .tag-badge,
body.theme-dark .mini-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
}

body.theme-dark .event-year,
body.theme-dark .node-year,
body.theme-dark .deep-node-year {
  background: var(--year-bg);
  color: var(--year-text);
}

body.theme-dark .info-hint {
  background: var(--hint-bg);
  color: var(--hint-text);
}

body.theme-dark .deep-hint {
  background: var(--deep-hint-bg);
  color: var(--deep-hint-text);
}

body.theme-dark .view-btn {
  color: var(--btn-text);
  background: transparent;
  border: none;
}

body.theme-dark .arrow-btn {
  background: var(--arrow-btn-bg);
  color: var(--arrow-btn-text);
  border: var(--arrow-btn-border);
}

body.theme-dark .point-circle {
  border: 2px solid white;
}

body.theme-dark .arrow-node.campaign-point .point-circle {
  background: var(--point-campaign);
}

body.theme-dark .arrow-node.global-point .point-circle {
  background: var(--point-global);
}

body.theme-dark .deep-point-circle {
  background: var(--deep-point);
  border: 2px solid #fef3e4;
  box-shadow: 0 0 0 2px var(--deep-point);
}

body.theme-dark .toast-msg {
  background: var(--toast-bg);
  color: var(--toast-text);
}

/* Tooltip with pointer-events fix */
body.theme-dark .floating-tooltip {
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  border-left: 5px solid var(--tooltip-border);
  position: fixed;
  z-index: 100000;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.3);
  width: 280px;
  pointer-events: none;
  transition: opacity 0.12s;
  opacity: 0;
}

body.theme-dark .floating-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
}

body.theme-dark footer {
  border-top: 1px solid var(--footer-border);
}

body.theme-dark .header {
  margin-bottom: 2rem;
}

body.theme-dark h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: inline-block;
  border-left: 6px solid #c97e5a;
  padding-left: 1rem;
}

body.theme-dark .sub {
  margin-top: 0.5rem;
  font-weight: 400;
  font-size: 1rem;
}

body.theme-dark .lang-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.75rem;
  align-items: center;
}

body.theme-dark .lang-selector,
body.theme-dark .events-lang-selector,
body.theme-dark .theme-selector {
  padding: 0.3rem 1rem;
  border-radius: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

body.theme-dark .filter-panel {
  border-radius: 2rem;
  padding: 1.2rem 1.8rem;
  margin: 1.8rem 0 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

body.theme-dark .filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

body.theme-dark .type-buttons {
  display: flex;
  gap: 0.6rem;
}

body.theme-dark .type-btn {
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.theme-dark .tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

body.theme-dark .tag-check {
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

body.theme-dark .reset-btn,
body.theme-dark .demo-add-btn {
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.theme-dark .view-mode-bar {
  display: flex;
  gap: 0.8rem;
  margin: 0 0 1.5rem 0;
  padding: 0.6rem 1.5rem;
  border-radius: 3rem;
  width: fit-content;
}

body.theme-dark .view-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1.3rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

body.theme-dark .view-container {
  display: none;
}

body.theme-dark .view-container.active-view {
  display: block;
}

body.theme-dark .timeline-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  justify-content: flex-end;
}

body.theme-dark .arrow-btn {
  width: 44px;
  height: 44px;
  border-radius: 60px;
  font-size: 1.3rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.theme-dark .timeline-scroll {
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 1rem;
  border-radius: 24px;
  margin-bottom: 0.5rem;
}

body.theme-dark .timeline-track {
  display: inline-flex;
  gap: 1.5rem;
  padding: 0.5rem 0.2rem 1rem 0.2rem;
}

body.theme-dark .event-card {
  width: 330px;
  border-radius: 1.5rem;
  overflow: hidden;
  transition: transform 0.2s ease;
  display: inline-flex;
  flex-direction: column;
  border-left: 8px solid;
  cursor: default;
}

body.theme-dark .event-card:hover {
  transform: translateY(-5px);
}

body.theme-dark .card-header {
  padding: 1rem 1.2rem 0.5rem;
}

body.theme-dark .event-year {
  font-size: 1.1rem;
  font-weight: 800;
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border-radius: 40px;
  margin-bottom: 0.6rem;
}

body.theme-dark .event-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0.5rem 0 0.4rem;
}

body.theme-dark .event-desc {
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 0 1.2rem 1rem;
}

body.theme-dark .tag-list {
  padding: 0.5rem 1.2rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body.theme-dark .tag-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

body.theme-dark .table-wrapper {
  overflow-x: auto;
  border-radius: 1.5rem;
  padding: 0.2rem;
}

body.theme-dark .timeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 700px;
}

body.theme-dark .timeline-table th {
  text-align: left;
  padding: 1rem 1rem;
  font-weight: 600;
}

body.theme-dark .timeline-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

body.theme-dark .table-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

body.theme-dark .mini-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

body.theme-dark .arrow-scroll {
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 2rem 0.5rem;
  border-radius: 2rem;
}

body.theme-dark .arrow-flex {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 0.5rem;
  min-width: 100%;
  border-top: 3px solid var(--border-heavy);
}

body.theme-dark .arrow-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 24px;
  cursor: default;
}

body.theme-dark .point-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

body.theme-dark .node-year {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}

body.theme-dark .tooltip-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

body.theme-dark .tooltip-year {
  font-size: 0.7rem;
  opacity: 0.8;
  margin-bottom: 0.3rem;
}

body.theme-dark .tooltip-desc {
  margin: 0.4rem 0;
  line-height: 1.3;
}

body.theme-dark .tooltip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

body.theme-dark .deep-timeline-section {
  margin-top: 3rem;
  border-radius: 2rem;
  padding: 1.5rem 1.2rem;
  border: 1px solid var(--border-light);
}

body.theme-dark .deep-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  gap: 1rem;
}

body.theme-dark .deep-header h2 {
  font-size: 1.7rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--deep-header-gradient-start), var(--deep-header-gradient-end));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

body.theme-dark .campaign-selector {
  padding: 0.4rem 1rem;
  border-radius: 3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

body.theme-dark .deep-view-container {
  display: none;
}

body.theme-dark .deep-view-container.active-deep-view {
  display: block;
}

body.theme-dark .deep-cards-scroll {
  overflow-x: auto;
  padding: 1rem 0.2rem;
}

body.theme-dark .deep-cards-track {
  display: inline-flex;
  gap: 1.2rem;
}

body.theme-dark .deep-event-card {
  width: 280px;
  border-radius: 1.2rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  border-left: 6px solid #b57648;
  display: inline-flex;
  flex-direction: column;
}

body.theme-dark .deep-event-card .card-header {
  padding: 0.9rem 1rem 0.3rem;
}

body.theme-dark .deep-event-card .event-title {
  font-size: 1.1rem;
  margin: 0.2rem 0;
}

body.theme-dark .deep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  border-radius: 1.2rem;
}

body.theme-dark .deep-table th {
  padding: 0.7rem 0.8rem;
  text-align: left;
}

body.theme-dark .deep-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border-light);
}

body.theme-dark .deep-arrow-scroll {
  overflow-x: auto;
  padding: 1rem 0;
}

body.theme-dark .deep-arrow-flex {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.2rem;
  min-width: 100%;
  border-top: 2px dashed var(--border-heavy);
}

body.theme-dark .deep-arrow-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 20px;
}

body.theme-dark .deep-point-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

body.theme-dark .deep-node-year {
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 6px;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}

body.theme-dark footer {
  margin-top: 3rem;
  font-size: 0.75rem;
  text-align: center;
  padding-top: 1.5rem;
}

body.theme-dark .toast-msg {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 8px 18px;
  border-radius: 40px;
  font-size: 0.8rem;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

body.theme-dark .empty-msg {
  text-align: center;
  padding: 3rem;
  font-size: 1.2rem;
  border-radius: 2rem;
  width: 100%;
}

body.theme-dark .info-hint,
body.theme-dark .deep-hint {
  font-size: 0.8rem;
  padding: 0.2rem 0.8rem;
  border-radius: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 700px) {
  body.theme-dark {
    padding: 1rem;
  }
  body.theme-dark .event-card {
    width: 280px;
  }
}

/* Loading overlay spinner */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(128, 128, 128, 0.2);
  border-radius: 50%;
  border-top-color: var(--loading-spinner-color, #3b82f6);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Highlight pulse */
@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(108, 92, 231, 0); }
  100% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
}
.highlight-pulse {
  animation: highlightPulse 1.5s ease-out;
  position: relative;
  z-index: 10;
}

.tooltip-copy-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.3rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  vertical-align: middle;
  color: inherit;
}
.tooltip-copy-link:hover {
  opacity: 1;
}