/* ================================================
   THE ARCHIVE - INFO PANEL STYLES (REBUILT)
   Clean, bug-free panel with shader background
   ================================================ */

/* ===== MAIN PANEL CONTAINER ===== */
#infoPanel {
  position: fixed;
  left: -400px;
  top: 48px;
  bottom: 80px;
  width: 380px;
  z-index: 2;

  transition: left 0.5s ease;
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: all;

  /* Theme colors (Earth - blue by default) */
  --panel-accent: rgba(77, 153, 204, 1);
  --panel-accent-light: rgba(77, 153, 204, 0.3);
  --panel-accent-bg: rgba(77, 153, 204, 0.15);

  /* Smooth scrolling on mobile */
  -webkit-overflow-scrolling: touch;

  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#infoPanel::-webkit-scrollbar {
  display: none;
}

/* Panel visible state */
#infoPanel.visible {
  left: 0;
}

/* Move timeline when panel opens */
#timeline.panel-open {
  padding-left: 100px;
  transition: padding-left 0.5s ease;
}

/* ===== THEME COLORS ===== */

/* Moon theme (light grey) */
#infoPanel[data-body="moon"] {
  --panel-accent: rgba(200, 200, 200, 1);
  --panel-accent-light: rgba(200, 200, 200, 0.3);
  --panel-accent-bg: rgba(200, 200, 200, 0.15);
}

/* Mars theme (orange/red) */
#infoPanel[data-body="mars"] {
  --panel-accent: rgba(204, 102, 51, 1);
  --panel-accent-light: rgba(204, 102, 51, 0.3);
  --panel-accent-bg: rgba(204, 102, 51, 0.15);
}

/* ===== SHADER CANVAS BACKGROUND ===== */
#infoPanel canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ===== PANEL CONTENT WRAPPER ===== */
#infoPanelContent {
  position: relative;
  z-index: 1;
  min-height: 100%;
}

/* ===== PANEL HEADER ===== */
.panel-header {
  padding: 30px;
  border-bottom: 1px solid rgba(77, 153, 204, 0.15);
  background: rgba(0, 0, 0, 0.2);
}

.panel-title {
  font-size: 1.8em;
  font-weight: 300;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 8px;
}

.panel-date {
  font-size: 1em;
  opacity: 0.85;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
}

/* ===== BREADCRUMB NAVIGATION ===== */
.panel-breadcrumb {
  font-size: 0.85em;
  opacity: 0.9;
  margin-bottom: 15px;
  letter-spacing: 0.8px;
  color: var(--panel-accent);
  font-weight: 500;
}

.breadcrumb-item {
  display: inline;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.7;
}

.breadcrumb-item:hover {
  color: rgba(255, 255, 255, 1);
  text-decoration: underline;
  opacity: 1;
}

.breadcrumb-item.current {
  font-weight: 600;
  opacity: 1;
  cursor: default;
  color: rgba(255, 255, 255, 0.95);
}

.breadcrumb-item.current:hover {
  text-decoration: none;
}

.breadcrumb-item.future {
  opacity: 0.3;
  cursor: not-allowed;
  color: rgba(150, 150, 150, 0.5);
}

.breadcrumb-item.future:hover {
  text-decoration: none;
}

.breadcrumb-separator {
  margin: 0 10px;
  opacity: 0.6;
  color: rgba(255, 255, 255, 0.8);
}

/* ===== PANEL CONTENT ===== */
.panel-content {
  padding: 30px;
  background: rgba(0, 0, 0, 0.2);
  padding-bottom: 60px;
}

.panel-section {
  margin-bottom: 30px;
}

.panel-section-title {
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.9);
  /*margin-bottom: 15px;*/
  font-weight: 500;
}

.panel-description {
  line-height: 1.7;
  opacity: 0.95;
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.9);
}

/* ===== CLOSE BUTTON ===== */
.panel-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(74, 157, 157, 0.3);
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition: all 0.3s;

  font-size: 28px;
  line-height: 0;
  color: white;
  padding: 0;
  user-select: none;
  z-index: 10;
}

.panel-close:hover {
  background: rgba(74, 157, 157, 0.3);
  transform: rotate(90deg);
}

/* ===== EVENT ITEMS ===== */
.event-item {
  padding: 12px;
  /*margin-bottom: 10px;*/
  background: var(--panel-accent-bg);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.event-item:hover {
  background: var(--panel-accent-light);
  border-left-color: rgba(255, 255, 255, 0.8);
  transform: translateX(5px);
}

.event-name {
  font-weight: 500;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.95);
}

.event-location {
  font-size: 0.85em;
  opacity: 0.8;
  color: rgba(255, 255, 255, 0.8);
}

/* ===== SUBDIVISION ITEMS (DRILL-DOWN) ===== */
.subdivision-item {
  padding: 15px;
  margin-bottom: 10px;
  background: var(--panel-accent-bg);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  border-left: 3px solid var(--panel-accent-light);

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subdivision-item:hover {
  background: var(--panel-accent-light);
  border-left-color: var(--panel-accent);
  transform: translateX(5px);
}

.subdivision-info {
  flex: 1;
}

.subdivision-name {
  font-weight: 500;
  font-size: 1.05em;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.95);
}

.subdivision-date {
  font-size: 0.9em;
  opacity: 0.75;
  color: rgba(255, 255, 255, 0.75);
}

.subdivision-arrow {
  font-size: 1.5em;
  opacity: 0.5;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s;
}

.subdivision-item:hover .subdivision-arrow {
  opacity: 1;
  transform: translateX(5px);
}

/* ===== SCROLL INDICATOR ===== */
/* Simple gradient at bottom when content is scrollable */
#infoPanel.scrollable::after {
  content: '';
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.8) 0%,
      rgba(0, 0, 0, 0.4) 50%,
      transparent 100%);
  pointer-events: none;
  z-index: 5;
  display: block;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  #infoPanel {
    width: 100%;
    left: -100%;
    top: 60px;
    bottom: 100px;
  }

  #infoPanel.visible {
    left: 0;
  }

  .panel-header {
    padding: 20px;
  }

  .panel-content {
    padding: 20px;
    padding-bottom: 40px;
  }

  .panel-title {
    font-size: 1.5em;
  }

  #timeline.panel-open {
    padding-left: 0;
  }
}

/* ===== SMALL SCREENS ===== */
@media (max-width: 480px) {
  .panel-header {
    padding: 15px;
  }

  .panel-content {
    padding: 15px;
    padding-bottom: 30px;
  }

  .panel-title {
    font-size: 1.3em;
    letter-spacing: 1px;
  }

  .panel-date {
    font-size: 0.9em;
  }

  .panel-close {
    width: 35px;
    height: 35px;
    top: 15px;
    right: 15px;
    font-size: 24px;
  }
}