/* ================================
        STRETCHY TIMELINE 
================================ */
/* ============================================================
   LIGHT THEME VARIABLES
============================================================ */
:root {
  --bg: #ffffff;
  --line-month: #606060;
  --line-week: #adadad;
  --line-day: #f2f2f2;
  --text-label: #444;
  --text-lane: #333;
  --lane-height: 80px;
}

/* ============================================================
   WRAPPER LAYOUT
============================================================ */
.timeline-wrapper {
  display: grid;
  grid-template-columns: 160px 1fr;
  height: auto;
  overflow: visible;
  background: var(--bg);
  border: 1px solid #e5e5e5;
  position: relative;
  z-index: 20;
}

/* ============================================================
   LEFT COLUMN (USER NAMES)
============================================================ */
.timeline-left {
  background: var(--bg);
  border-right: 1px solid #e5e5e5;
  padding-top: 28px; /* aligns with labels + lanes */
  overflow-y: auto;
  height: auto;
}

.timeline-user {
  height: var(--lane-height);
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-size: 18px;
  color: var(--text-lane);
  border-bottom: 1px solid #f0f0f0;
}

.timeline-user.clickable {
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.timeline-user.clickable:hover {
  color: var(--accent-color);
  background: rgba(0,0,0,0.05);
}

/* ============================================================
   RIGHT COLUMN (SCROLLABLE TIMELINE)
============================================================ */
.timeline-right {
  position: relative;
  overflow: auto;
  background: var(--bg);
  height:auto;

}

/* ============================================================
   LABELS (MONTH / WEEK / DAY / HOUR)
============================================================ */
.timeline-labels {
  position: sticky;
  top: 0;
  height: 30px;
  background: var(--bg);
  border-bottom: 1px solid #e5e5e5;
  z-index: 40;
  transition: opacity 0.25s ease;
}

.timeline-labels div {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-label);
  white-space: nowrap;
  pointer-events: none;
  transition: left 0.25s ease, opacity 0.2s ease;
}

/* ============================================================
   HOUR CELLS (HIDDEN IN LIGHT THEME)
============================================================ */
.hour-cell {
  background: transparent !important;
  border-right: none !important;
  pointer-events: none;
}

/* ============================================================
   GRID LINES (MONTH → WEEK → DAY)
============================================================ */
.grid {
  z-index: 5; /* was 1 */
  transition: transform 0.25s ease;
}

.grid-lines {
  position: absolute;
  top: 28px; /* below labels */
  left: 0;
  width: 100%;
  height: calc(100% - 28px);
  pointer-events: none;
  z-index: 10;
  transition: left 0.25s ease;
}

.grid-lines div {
  position: absolute;
  top: 0;
  height: 100%;
  border-right: 1px solid var(--line-day);
}

.grid-lines .week {
  border-right-color: var(--line-week);
}

.grid-lines .month {
  border-right-color: var(--line-month);
}

/* ============================================================
   LANES (BAR ROWS)
============================================================ */
.timeline-lanes {
  position: absolute;
  top: 28px; /* match labels */
  left: 0;
  width: 100%;
  height: calc(100% - 28px);
  pointer-events: none;
  z-index: 20;
}

.lane {
  position: relative;
  height: var(--lane-height);
  border-bottom: 1px solid #f0f0f0;
}

/* ============================================================
   LANES (BAR ROWS)
============================================================ */

.timeline-popup {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.timeline-popup.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-popup.fade-out {
  opacity: 0;
  transform: translateY(8px);
}
/* ============================================================
   TASK BARS
============================================================ */
.task-bar {
  position: absolute;
  top: 8px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  pointer-events: auto; /* bars must be clickable */
  transition: left 0.25s ease, width 0.25s ease;
  z-index: 20;
  
}

.task-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.task-bar.selected {
  transform: scale(1.02);
box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 30;
}

.task-bar.fallback {
  background: transparent;
  border: 2px dashed currentColor;
}


/* ============================================================
   ZOOM BAR
============================================================ */
.zoom-bar-wrapper {
  margin-top: 10px;
  height: 20px;
}

.zoom-bar {
  position: relative;
  height: 18px;
  background: var(--color-text-light);
  width: var(--zoom-bar-width);
  margin: 0 auto;
  border-radius: 3px;
  transition: width 0.25s ease;
}

.zoom-handle {
  position: absolute;
  
  width: 18px;
  height: 18px;
  background: var(--color-text-muted);
  cursor: ew-resize;
  border-radius: 32px;
  z-index: 5; /* ensures both handles show */
}

.zoom-handle.left {
  left: -5px; /* ensures visibility */
}

.zoom-handle.right {
  right: -5px;
}

/* ============================================================
   VISIBILITY CONTROL
============================================================ */
.hide-month .month {
  opacity: 0;
}

.hide-week .week {
  opacity: 0;
}

.hide-day .grid-lines div:not(.week):not(.month) {
  opacity: 0;
}

.hide-hour .hour-cell {
  opacity: 0;
}

/* ============================================================
    TIMELINE HEADER
============================================================ */

.timeline-header {
  height: 120px;
  background: var(--bg);
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 16px;
  font-size: 38px;
  font-weight: 600;
  color: #333;
  position: sticky;
  top: 0;
  z-index: 10;
}

.timeline-header-title {
  pointer-events: none;
}

/* ============================================================
    TIMELINE HORIZONTAL LINES
============================================================ */

.timeline-top-line {
  position: absolute;
  top: 28px;               /* same height as labels */
  left: 160px;             /* width of left column */
  right: 0;
  height: 1px;
  background: #e5e5e5;     /* or var(--line-color) */
  z-index: 7;              /* above grid, below labels */
  pointer-events: none;
}

.horizontal-lines {
  position: absolute;
  top: 28px;                   /* below labels */
  left: 160px;                 /* width of left column */
  right: 0;
  height: calc(100% - 28px);
  pointer-events: none;
  z-index: 6;                  /* above lanes, below labels */
}

.horizontal-lines div {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--lane-height);
  border-bottom: 1px solid #f0f0f0;
}

/* ============================================================
    ZOOM PRESET TOUCH UI
============================================================ */

.zoom-presets {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.zoom-presets button {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #d0d0d0;
  background: #fafafa;
  font-size: 14px;
  color: #444;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.zoom-presets button:hover {
  background: #f0f0f0;
}

.zoom-presets button:active {
  background: #e8e8e8;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
/*  TODAY LINE */
.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-blue);
  z-index: 50;         /* above everything */
  pointer-events: none;
  opacity: 0.9;
}
.today-flag {
  position: absolute;
  top: -1px; 
  height: 30px;
  align-items: center;
  padding: 5px 10px;
  background: var(--color-blue);
  color: white;
  font-size: 13px;
  box-shadow: var(--shadow-2);
  opacity: 0.95;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  transform: translateX(-50%);
}
