/* --- Enhanced Modern Gantt Chart CSS with Pro Features --- */

/* Main Container */
.gantt-container {
  overflow-x: auto;
  background: linear-gradient(120deg, #f8fafc 67%, #eaf4ff 100%);
  border-radius: 18px;
  box-shadow: 0 3px 28px rgba(44,62,80,0.13), 0 0 0 1.5px #eaf4ff;
  padding: 1.1rem 1.1rem 2rem 1.1rem;
  margin: 1.6em 0 2.1em 0;
  position: relative;
  border: 2.5px solid #eaf4ff;
  transition: box-shadow 0.22s, border-color 0.16s;
}
.gantt-container:before {
  content: "📊 Gantt Chart";
  position: absolute;
  left: 1.3em;
  top: -1.8em;
  font-size: 1.18em;
  color: #3173c2;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.23em 1.09em;
  background: #eaf4ff;
  border-radius: 11px 11px 0 0;
  box-shadow: 0 2px 10px #c3dafc33;
  pointer-events: none;
}
.gantt-container:hover {
  box-shadow: 0 18px 48px rgba(44,62,80,0.21);
  border-color: #b0c4e9;
}

/* Header Row */
.gantt-header-row {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.15em;
  background: linear-gradient(90deg, #e0eafc 85%, #e7f7ff 100%);
  color: #2d4063;
  border-radius: 10px 10px 0 0;
  padding: 0.7em 0 0.7em 0.4em;
  position: sticky;
  left: 0;
  top: 0;
  z-index: 3;
  user-select: none;
  width: 100%;
  box-shadow: 0 2px 7px #e0eafc33;
  border-bottom: 2.5px solid #b0c4e9;
  letter-spacing: 0.02em;
}
.gantt-header-label {
  position: relative;
  min-width: 80px;
  max-width: 220px;
  padding-right: 0.95em;
  text-align: left;
  flex-shrink: 0;
  flex-grow: 0;
  background: transparent;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  font-family: 'Segoe UI', Arial, sans-serif;
  transition: background 0.14s;
}
.gantt-header-label.sortable:hover {
  background: #eaf4ff;
  cursor: pointer;
}
.gantt-header-label.sorted-asc:after {
  content: "▲";
  font-size: 0.78em;
  margin-left: 0.21em;
  vertical-align: middle;
  color: #4a90e2;
}
.gantt-header-label.sorted-desc:after {
  content: "▼";
  font-size: 0.78em;
  margin-left: 0.21em;
  vertical-align: middle;
  color: #4a90e2;
}

/* Header Resizer */
.gantt-header-resizer {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 8px; cursor: col-resize;
  z-index: 9;
  background: transparent;
  transition: background 0.2s;
  border-radius: 4px;
}
.gantt-header-resizer:hover, .resizing-col {
  background: #b7cef9;
}

/* Date Labels (Weeks) */
.gantt-date-labels {
  display: flex;
  align-items: center;
  background: #eaf4ff;
  border-radius: 0 0 12px 12px;
  user-select: none;
  margin-bottom: 0.2rem;
  position: relative;
  border-bottom: 1.5px solid #dbeafe;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  box-shadow: 0 1px 6px #eaf4ff33;
}

.gantt-date {
  min-width: 68px;
  max-width: 180px;
  text-align: center;
  font-size: 1.05rem;
  color: #5b6b85;
  font-weight: 600;
  letter-spacing: 0.01em;
  user-select: none;
  position: relative;
  overflow: hidden;
  background: #f4f9fe;
  white-space: normal;
  word-break: break-word;
  border-right: 1.5px solid #e3e8ee;
  font-family: 'Segoe UI', Arial, sans-serif;
  transition: background 0.13s;
}
.gantt-date.today {
  background: linear-gradient(90deg, #f72585 10%, #eaf4ff 90%);
  color: #fff;
  font-weight: 800;
  border-bottom: 2px solid #f72585;
}
.gantt-date:last-child { border-right: 0; }

.gantt-week-resizer {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 8px; cursor: col-resize;
  z-index: 9;
  background: transparent;
  transition: background 0.2s;
  border-radius: 4px;
}
.gantt-week-resizer:hover, .resizing-week {
  background: #b7cef9;
}

/* Row styling */
.gantt-row {
  display: flex;
  align-items: stretch;
  position: relative;
  min-height: 40px;
  height: var(--gantt-row-height, 40px);
  background: transparent;
  transition: height 0.18s;
  border-bottom: 1.5px dashed #e3e8ee;
  animation: fadeInRow 0.7s;
}
@keyframes fadeInRow {
  from { opacity: 0; transform: translateY(18px);}
  to { opacity: 1; transform: translateY(0);}
}

.gantt-row.highlight {
  background: #eaf4ff;
  box-shadow: 0 1px 8px #eaf4ff44;
}

/* Row Resizer */
.gantt-row-resizer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 8px; cursor: row-resize;
  z-index: 9;
  background: transparent;
  transition: background 0.2s;
  border-radius: 5px;
}
.gantt-row-resizer:hover, .resizing-row {
  background: #b7cef9;
}

/* Label Columns */
.gantt-label {
  position: relative;
  font-weight: 700;
  font-size: 1.05rem;
  padding-right: 1.2rem;
  color: #2d4063;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  background: #fff;
  border-radius: 7px;
  border-right: 1px solid #e3e8ee;
  z-index: 1;
  flex-shrink: 0;
  flex-grow: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  transition: background 0.15s, color 0.13s;
}
.gantt-label:nth-child(1) { font-weight: 800; color: #234079; padding-left: 0.4em;}
.gantt-label:nth-child(2) { color: #234079; }
.gantt-label:nth-child(3) { color: #f59e42; font-weight: 700;}

/* Gantt Bar */
.gantt-bar {
  height: 22px;
  border-radius: 9px;
  position: absolute;
  transition: width 0.22s, left 0.22s, background 0.16s;
  z-index: 2;
  box-shadow: 0 2px 12px rgba(44, 62, 80, 0.12);
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 1.04rem;
  font-weight: 800;
  padding-left: 16px;
  cursor: pointer;
  opacity: 0.98;
  outline: none;
  border: none;
  border-bottom: 2.5px solid #fff2;
  letter-spacing: 0.01em;
  filter: drop-shadow(0px 1.5px 4px #eaf4ff99);
  box-sizing: border-box;
  animation: fadeInBar 0.85s;
}
@keyframes fadeInBar {
  from { opacity: 0; transform: scaleX(0.8);}
  to { opacity: 1; transform: scaleX(1);}
}
.gantt-bar span { pointer-events: none; font-size: 0.98em; }
.gantt-bar:focus, .gantt-bar:hover {
  filter: brightness(1.15) drop-shadow(0 0 10px #60a5fa);
  opacity: 1;
  z-index: 3;
  outline: 2.5px solid #4a90e2;
  background-blend-mode: multiply;
  border-bottom: 2.5px solid #4a90e2;
}

/* Colorful Bar Palette Based On Example */
.gantt-bar.color-blue { background: linear-gradient(90deg, #2a79c7 85%, #165caa 100%);}
.gantt-bar.color-orange { background: linear-gradient(90deg, #f59e42 82%, #f9b64d 100%);}
.gantt-bar.color-green { background: linear-gradient(90deg, #43aa8b 70%, #309d73 100%);}
.gantt-bar.color-red { background: linear-gradient(90deg, #ef476f 78%, #f44336 100%);}
.gantt-bar.color-purple { background: linear-gradient(90deg, #845ef7 70%, #6a3fcc 100%);}
.gantt-bar.color-gray { background: linear-gradient(90deg, #90a4ae 75%, #b0bec5 100%);}

/* Progress bar overlay (for percent complete) */
.gantt-bar[data-progress]:after {
  content: attr(data-progress) '%';
  position: absolute;
  right: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 0.87em;
  opacity: 0.87;
  letter-spacing: 0.02em;
  background: rgba(0,0,0,0.08);
  border-radius: 6px;
  padding: 0.1em 0.5em;
}

/* Milestone marker */
.gantt-bar.gantt-milestone {
  background: linear-gradient(90deg, #f72585 75%, #f59e42 100%);
  border-radius: 50%;
  width: 22px !important;
  min-width: 22px;
  max-width: 22px;
  left: calc(var(--milestone-left, 0) * 1px) !important;
  top: 9px !important;
  box-shadow: 0 0 16px #f7258570;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  color: #fff;
  font-size: 1.33em;
  font-weight: 900;
}
.gantt-bar.gantt-milestone span {
  font-size: 1.18em;
  font-weight: bold;
  letter-spacing: 0.04em;
  padding-left: 0;
}

/* Dependency arrow (for future SVG/canvas) */
.gantt-arrow {
  position: absolute;
  height: 2.5px;
  background: linear-gradient(90deg, #4a90e2 60%, #3173c2 100%);
  z-index: 5;
  border-radius: 2px;
  pointer-events: none;
  transition: background 0.12s;
  opacity: 0.87;
}

/* Custom Bar Tooltip (JS: .gantt-tooltip as sibling) */
.gantt-tooltip {
  position: absolute;
  left: 40px;
  top: -2.7em;
  background: #29487d;
  color: #fff;
  padding: 0.44em 1em;
  border-radius: 9px;
  font-size: 0.98em;
  font-weight: 400;
  white-space: pre-line;
  z-index: 10;
  box-shadow: 0 3px 14px #29487d33;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s;
  font-family: 'Segoe UI', Arial, sans-serif;
}
.gantt-bar:hover + .gantt-tooltip,
.gantt-bar:focus + .gantt-tooltip {
  opacity: 1;
}

/* Dotted grid lines for chart accuracy */
.gantt-row:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 100%;
  border-bottom: 1px dotted #c0d2e6;
  z-index: 0;
  pointer-events: none;
}

/* Today vertical line (JS: .gantt-today-line at the right place) */
.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #f72585 0%, #845ef7 100%);
  border-radius: 3px;
  z-index: 10;
  left: var(--today-line-left, 0);
  box-shadow: 0 0 8px #f7258590;
  pointer-events: none;
}

/* Row hover, selection, and accessibility */
.gantt-row:hover .gantt-label,
.gantt-row.selected .gantt-label {
  background: #eaf4ff !important;
  color: #234079 !important;
  font-weight: 800;
  box-shadow: 0 2px 10px #b0c4e9;
  z-index: 2;
}

/* Row fade highlight (for editing etc, add .fade-highlight JS) */
.gantt-row.fade-highlight {
  animation: highlightFade 2s;
}
@keyframes highlightFade {
  0% { background: #fffbe7; }
  100% { background: transparent; }
}

/* Print-friendly */
@media print {
  .gantt-container, .gantt-header-row, .gantt-row, .gantt-label, .gantt-bar, .gantt-date-labels, .gantt-date {
    box-shadow: none !important;
    background: #fff !important;
    color: #222 !important;
  }
  .gantt-bar { color: #000 !important; }
}

/* Responsive */
@media (max-width: 1100px) {
  .gantt-header-label, .gantt-label { min-width: 65px; max-width: 120px; font-size: 0.98em;}
  .gantt-date { min-width: 40px; max-width: 65px; }
}
@media (max-width: 660px) {
  .gantt-header-label, .gantt-label { min-width: 38px; max-width: 65px; font-size: 0.91em;}
  .gantt-date { min-width: 18px; max-width: 34px; font-size: 0.85em;}
  .gantt-bar { font-size: 0.9em; height: 16px; padding-left: 5px; }
}

/* Accessibility: focus indicator */
.gantt-label:focus, .gantt-bar:focus {
  outline: 2.5px solid #f72585;
  background: #fbeff7;
  color: #222 !important;
}