/**
 * STYLESHEET CHO GANTT TIMELINE VIEW
 */

.gantt-layout {
  display: flex;
  height: calc(100vh - 230px);
  min-height: 480px;
  background-color: #FFFFFF;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ===================== CỘT TRÁI CỐ ĐỊNH ===================== */
.gantt-left-pane {
  flex: 0 0 320px;
  width: 320px;
  border-right: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background-color: #FFFFFF;
  z-index: 20;
}

.gantt-left-header {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background-color: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.gantt-left-body {
  flex: 1;
  overflow-y: hidden;
}

.gantt-phase-left-row {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background-color: #F1F5F9;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  cursor: pointer;
}

.gantt-phase-left-row:hover {
  background-color: #E2E8F0;
}

.gantt-task-left-row {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.15s ease;
}

.gantt-task-left-row:hover {
  background-color: #F8FAFC;
}

.gantt-task-left-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--text-primary);
}

.gantt-task-left-assignee {
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

/* ===================== CỘT PHẢI: KHUNG TIMELINE ===================== */
.gantt-right-pane {
  flex: 1;
  overflow: auto;
  position: relative;
  background-color: #FFFFFF;
}

.gantt-timeline-canvas {
  position: relative;
  min-height: 100%;
}

.gantt-timeline-header {
  position: sticky;
  top: 0;
  height: 44px;
  display: flex;
  background-color: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.gantt-day-col-header {
  flex-shrink: 0;
  border-right: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-secondary);
}

.gantt-day-col-header.weekend {
  background-color: #F1F5F9;
  color: var(--text-light);
}

.gantt-day-col-header.today {
  background-color: #FEE2E2;
  color: #DC2626;
  font-weight: 700;
}

.gantt-day-num {
  font-weight: 700;
  line-height: 1.1;
}

.gantt-day-month {
  font-size: 9px;
  color: var(--text-muted);
}

/* Vạch đỏ Hôm nay */
.gantt-today-line {
  position: absolute;
  top: 44px;
  bottom: 0;
  width: 2px;
  background-color: #DC2626;
  z-index: 5;
  pointer-events: none;
}

.gantt-today-line::before {
  content: "Hôm nay";
  position: absolute;
  top: 4px;
  left: 4px;
  background-color: #DC2626;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Đường track hàng trong timeline */
.gantt-phase-track {
  height: 34px;
  background-color: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
}

.gantt-task-track {
  height: 38px;
  position: relative;
  border-bottom: 1px solid #F8FAFC;
  box-sizing: border-box;
}

.gantt-task-track:hover {
  background-color: rgba(248, 250, 252, 0.5);
}

/* Thanh Kế hoạch (Plan bar) */
.gantt-bar-plan-box {
  position: absolute;
  top: 4px;
  height: 12px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px dashed #3B82F6;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 4px;
  z-index: 2;
  transition: opacity 0.15s ease;
}

.gantt-bar-plan-box:hover {
  opacity: 0.85;
}

/* Thanh Thực tế (Real bar) */
.gantt-bar-real-box {
  position: absolute;
  bottom: 4px;
  height: 16px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: #FFFFFF;
  z-index: 3;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease;
}

.gantt-bar-real-box:hover {
  transform: scaleY(1.1);
}

.gantt-bar-real-box.bar-late {
  border: 2px solid #7F1D1D !important;
  box-shadow: 0 0 0 1px #FCA5A5;
}

.bar-tag {
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

/* Chú thích (Legend) */
.legend-bar-plan {
  display: inline-block;
  width: 16px;
  height: 10px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px dashed #3B82F6;
  border-radius: 2px;
}

.legend-bar-real {
  display: inline-block;
  width: 16px;
  height: 10px;
  background: #2563EB;
  border-radius: 2px;
}

.legend-bar-late {
  display: inline-block;
  width: 16px;
  height: 10px;
  background: #DC2626;
  border-radius: 2px;
}
