/* =============================================
   TIJDLIJN / GANTT VIEW
   ============================================= */

.timeline-view {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Lege staat */
.timeline-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-secondary);
}

.timeline-empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

.timeline-empty-text {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-empty-sub {
  font-size: var(--font-size-sm);
}

/* Wrapper: sidebar + chart naast elkaar */
.timeline-wrapper {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* === SIDEBAR (links: taaknamen) === */
.timeline-sidebar {
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 2px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.timeline-sidebar-header {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.timeline-sidebar-body {
  overflow: hidden;
  flex: 1;
}

/* Status groep rij */
.timeline-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline-status-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

/* Taak rij */
.timeline-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px 0 28px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
}

.timeline-task-row:hover {
  background: var(--accent-light);
}

.timeline-task-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  flex: 1;
}

.timeline-task-date {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* === RESIZE HANDLE (tussen sidebar en chart) === */
.timeline-resize-handle {
  width: 5px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  transition: background 0.15s;
  margin-left: -3px;
  margin-right: -2px;
}

.timeline-resize-handle:hover,
.timeline-wrapper.sidebar-resizing .timeline-resize-handle {
  background: var(--accent);
  opacity: 0.5;
}

.timeline-wrapper.sidebar-resizing .timeline-resize-handle {
  opacity: 0.7;
}

/* === CHART AREA (rechts: Gantt bars) === */
.timeline-chart-area {
  flex: 1;
  overflow: auto;
  position: relative;
}

.timeline-chart-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* Maand rij */
.timeline-month-row {
  position: relative;
  height: 24px;
  border-bottom: 1px solid var(--border-light);
}

.timeline-month-label {
  position: absolute;
  top: 0;
  height: 24px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: capitalize;
  border-right: 1px solid var(--border-light);
}

/* Dag rij */
.timeline-day-row {
  position: relative;
  height: 32px;
}

.timeline-day-cell {
  position: absolute;
  top: 0;
  height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-light);
}

.timeline-day-cell.weekend {
  background: rgba(0, 0, 0, 0.025);
}

.timeline-day-cell.today {
  background: var(--accent-light);
}

.timeline-day-name {
  font-size: 9px;
  color: var(--text-light);
  text-transform: uppercase;
  line-height: 1;
}

.timeline-day-num {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1;
}

.timeline-day-cell.today .timeline-day-num {
  color: var(--accent);
  font-weight: 700;
}

/* Chart body */
.timeline-chart-body {
  position: relative;
  min-height: 100%;
}

/* Grid lijnen */
.timeline-gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px solid var(--border-light);
}

.timeline-gridline.weekend {
  background: rgba(0, 0, 0, 0.02);
}

.timeline-gridline.today {
  background: rgba(0, 102, 255, 0.05);
}

/* Vandaag lijn */
.timeline-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), rgba(0,102,255,0.3));
  box-shadow: 0 0 8px rgba(0,102,255,0.3);
  z-index: 2;
  pointer-events: none;
}

.timeline-today-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0,102,255,0.4);
}

/* Chart rijen */
.timeline-chart-row {
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

.timeline-chart-row.status-row {
  background: var(--bg-primary);
}

/* Gantt bars */
.timeline-bar {
  position: absolute;
  top: 7px;
  height: 30px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  padding: 0 10px;
  opacity: 0.9;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.15);
  z-index: 1;
}

.timeline-bar:hover {
  opacity: 1;
  transform: scaleY(1.1);
  z-index: 2;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.2);
}

.timeline-bar.overdue {
  animation: pulse-bar 2s infinite;
}

.timeline-bar.urgent {
  box-shadow: 0 0 0 2px var(--warning);
}

@keyframes pulse-bar {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.6; }
}

.timeline-bar-text {
  font-size: var(--font-size-xs);
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-weight: 500;
  pointer-events: none;
}

/* Drag handles */
.timeline-bar-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 3;
}

.timeline-bar-handle.left {
  left: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.timeline-bar-handle.right {
  right: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.timeline-bar:hover .timeline-bar-handle {
  opacity: 1;
  background: rgba(255, 255, 255, 0.35);
}

.timeline-bar-handle:hover {
  background: rgba(255, 255, 255, 0.6) !important;
}

/* Drag state */
.timeline-bar.dragging {
  opacity: 0.9;
  z-index: 10;
  box-shadow: var(--shadow-lg);
  transition: none;
}

/* Cursor op de bar zelf (move) */
.timeline-bar {
  cursor: grab;
}

.timeline-bar.dragging {
  cursor: grabbing;
}
