/*
 * ============================================================================
 * TIMELINE OVERLAY COMPONENT v1.0
 * ============================================================================
 * 
 * PURPOSE:
 *   Provides all styling for the inline timeline within the Casefile overlay.
 *   Used by slice system and main game for displaying timeline events.
 *
 * STRUCTURE (DO NOT MODIFY):
 *   - DOM nesting (.eg-timelineInline > .tl-viewport > .tl-canvas > markers)
 *   - Grid layout for event cards (1fr 340px)
 *   - Marker positioning (absolute within canvas)
 *
 * SAFE TO CUSTOMIZE:
 *   - Colors (gold accent: rgba(214, 170, 95, ...))
 *   - Spacing (padding, margins, gaps)
 *   - Font sizes
 *   - Shadows and borders
 *   - Animation timing
 *   - Hover effects
 *
 * TO MODIFY INTENTIONALLY:
 *   1. Make your changes in this file
 *   2. Test with multiple slices
 *   3. Document what you changed and why
 *
 * ============================================================================
 */

/* ============================================================================
   INLINE TIMELINE HOST (within Casefile)
   ============================================================================ */

#evergreenOverlay .eg-timelineInline {
  width: 100%;
}

/* Day label controls (Thursday/Friday tabs) */
#evergreenOverlay .eg-timelineInline .tl-day-label-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

#evergreenOverlay .eg-timelineInline .tl-day {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(214, 170, 95, 0.86);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(214, 170, 95, 0.16);
  background: rgba(0, 0, 0, 0.16);
}

#evergreenOverlay .eg-timelineInline .tl-day.active {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(214, 170, 95, 0.36);
  background: rgba(214, 170, 95, 0.14);
}

/* ============================================================================
   TIMELINE VIEWPORT (scrollable container)
   ============================================================================ */

#evergreenOverlay .eg-timelineInline .tl-viewport {
  position: relative;
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(214, 170, 95, 0.18);
  overflow: auto;
  background:
    radial-gradient(900px 520px at 22% 0%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0) 58%),
    radial-gradient(900px 520px at 70% 70%, rgba(214, 170, 95, 0.06), rgba(0, 0, 0, 0) 60%),
    rgba(0, 0, 0, 0.18);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
}

#evergreenOverlay .eg-timelineInline .tl-viewport.dragging {
  cursor: grabbing;
}

#evergreenOverlay .eg-timelineInline .tl-canvas {
  position: relative;
  height: 100%;
  min-height: 520px;
}

/* ============================================================================
   TIMELINE ELEMENTS (background structure)
   ============================================================================ */

/* Baseline (horizontal center line) */
#evergreenOverlay .eg-timelineInline .baseline {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: rgba(214, 170, 95, 0.14);
  transform: translateY(-1px);
}

/* Friday shading */
#evergreenOverlay .eg-timelineInline .friday-shade {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.03);
}

/* Midnight marker line */
#evergreenOverlay .eg-timelineInline .midnight-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(214, 170, 95, 0.14);
}

#evergreenOverlay .eg-timelineInline .midnight-label {
  position: absolute;
  top: 14px;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(214, 170, 95, 0.78);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Sunset (Night) marker */
#evergreenOverlay .eg-timelineInline .sunset-band {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 140px;
  background: rgba(255, 197, 106, 0.06);
}

#evergreenOverlay .eg-timelineInline .sunset-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 197, 106, 0.18);
}

#evergreenOverlay .eg-timelineInline .sunset-label {
  position: absolute;
  top: 46px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 197, 106, 0.86);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================================
   LANES (horizontal tracks for events)
   ============================================================================ */

#evergreenOverlay .eg-timelineInline .lane {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(214, 170, 95, 0.10);
}

#evergreenOverlay .eg-timelineInline .lane.claimedLane {
  top: 40%;
}

#evergreenOverlay .eg-timelineInline .lane.provenLane {
  top: 60%;
}

#evergreenOverlay .eg-timelineInline .laneLabel {
  position: absolute;
  left: 18px;
  transform: translateY(-50%);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}

/* ============================================================================
   TIMELINE ITEMS (dots/spans - legacy, kept for compatibility)
   ============================================================================ */

#evergreenOverlay .eg-timelineInline .tl-item {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

#evergreenOverlay .eg-timelineInline .tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
}

#evergreenOverlay .eg-timelineInline .tl-dot.proven {
  border-color: rgba(214, 170, 95, 0.88);
  box-shadow: 0 10px 25px rgba(214, 170, 95, 0.22);
}

#evergreenOverlay .eg-timelineInline .tl-dot.claimed {
  border-color: rgba(255, 255, 255, 0.36);
}

#evergreenOverlay .eg-timelineInline .tl-itemLabel {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

/* ============================================================================
   MARKERS (modern event indicators with labels)
   ============================================================================ */

#evergreenOverlay .eg-timelineInline .marker {
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  cursor: pointer;
  transition: transform 0.15s ease;
}

#evergreenOverlay .eg-timelineInline .marker:hover {
  transform: translateX(-50%) translateY(-50%) scale(1.08);
}

#evergreenOverlay .eg-timelineInline .marker.provenLane {
  top: 38%;
}

#evergreenOverlay .eg-timelineInline .marker.claimedLane {
  top: 62%;
}

/* Marker button (clickable area) */
#evergreenOverlay .eg-timelineInline .marker-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Marker label (event title) */
#evergreenOverlay .eg-timelineInline .marker .label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(214, 170, 95, 0.28);
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: all 0.15s ease;
}

#evergreenOverlay .eg-timelineInline .marker-button:hover .label {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(214, 170, 95, 0.45);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

/* Marker stem (connects label to node) */
#evergreenOverlay .eg-timelineInline .marker .stem {
  width: 2px;
  height: 18px;
  background: linear-gradient(to bottom, 
    rgba(214, 170, 95, 0.75) 0%, 
    rgba(214, 170, 95, 0.35) 100%);
}

#evergreenOverlay .eg-timelineInline .marker.proven .stem {
  background: linear-gradient(to bottom, 
    rgba(106, 255, 197, 0.75) 0%, 
    rgba(106, 255, 197, 0.35) 100%);
}

/* Marker node (dot on timeline) */
#evergreenOverlay .eg-timelineInline .marker .node {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(214, 170, 95, 0.85);
  background: radial-gradient(circle at 30% 30%, 
    rgba(255, 255, 255, 0.25), 
    rgba(214, 170, 95, 0.65));
  box-shadow: 
    0 0 0 4px rgba(214, 170, 95, 0.15),
    0 6px 14px rgba(0, 0, 0, 0.45);
  transition: all 0.15s ease;
}

#evergreenOverlay .eg-timelineInline .marker.proven .node {
  border-color: rgba(106, 255, 197, 0.85);
  background: radial-gradient(circle at 30% 30%, 
    rgba(255, 255, 255, 0.35), 
    rgba(106, 255, 197, 0.75));
  box-shadow: 
    0 0 0 4px rgba(106, 255, 197, 0.18),
    0 6px 14px rgba(0, 0, 0, 0.45);
}

#evergreenOverlay .eg-timelineInline .marker-button:hover .node {
  transform: scale(1.15);
  box-shadow: 
    0 0 0 6px rgba(214, 170, 95, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.55);
}

#evergreenOverlay .eg-timelineInline .marker.proven .marker-button:hover .node {
  box-shadow: 
    0 0 0 6px rgba(106, 255, 197, 0.25),
    0 8px 18px rgba(0, 0, 0, 0.55);
}

/* ============================================================================
   EVENT OVERLAY (detail card backdrop)
   ============================================================================ */

#evergreenOverlay .eg-timelineInline .tl-eventOverlay {
  position: absolute;
  inset: 0;
  display: none;
}

body.timelineCardOpen #evergreenOverlay .eg-timelineInline .tl-eventOverlay {
  display: block;
}

#evergreenOverlay .eg-timelineInline .tl-eventOverlay .backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  border-radius: 16px;
}

/* ============================================================================
   EVENT CARD (detail view)
   
   EASY TO CUSTOMIZE:
   - width: Change the 780px value to make wider/narrower
   - Grid: Change "1fr 340px" to adjust text/image split
   ============================================================================ */

#evergreenOverlay .eg-timelineInline .tl-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(780px, 94%);        /* ← CHANGE WIDTH HERE */
  max-width: 820px;
  border-radius: 18px;
  border: 1px solid rgba(214, 170, 95, 0.18);
  background: rgba(0, 0, 0, 0.86);
  box-shadow: 0 22px 85px rgba(0, 0, 0, 0.75);
  padding: 18px 20px 16px;
  color: var(--text);
}

/* Card body layout (text + image) */
#evergreenOverlay .eg-timelineInline .tl-cardBody {
  display: grid;
  grid-template-columns: 1fr 340px;  /* ← CHANGE SPLIT HERE */
  gap: 20px;
  align-items: start;
}

/* Image/thumbnail sizing */
#evergreenOverlay .eg-timelineInline .tl-thumbWrap {
  width: 340px;                      /* ← CHANGE IMAGE WIDTH HERE */
  max-width: 340px;
}

/* Mobile: stack vertically */
@media (max-width: 880px) {
  #evergreenOverlay .eg-timelineInline .tl-cardBody {
    grid-template-columns: 1fr;
  }
  #evergreenOverlay .eg-timelineInline .tl-thumbWrap {
    width: 100%;
    max-width: 100%;
  }
}

/* ============================================================================
   END OF TIMELINE OVERLAY COMPONENT
   ============================================================================ */
