/* ==========================================================================
   DERYA & CHARLES — GANTT ENGINE STYLING
   Aesthetic: Aramızda Ebru Navy & Venetian Gold
   Features: Auto-sizing left column to longest text, clean horizontal milestones
   ========================================================================== */

.gantt-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Controls Bar */
.gantt-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.35rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.gantt-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.gantt-filter-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition-fast);
}

.gantt-filter-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.gantt-filter-btn.active {
  background: rgba(197, 160, 89, 0.16);
  border-color: var(--gold-border);
  color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(229, 193, 88, 0.15);
}

.gantt-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.zoom-btn-group {
  display: flex;
  background: var(--bg-tertiary);
  padding: 0.2rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.zoom-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
}

.zoom-btn.active {
  background: var(--bg-secondary);
  color: var(--gold-bright);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Gantt Chart Container */
.gantt-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.gantt-chart-viewport {
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  min-height: 520px;
}

.gantt-main-table {
  display: flex;
  width: max-content;
  min-width: 100%;
}

/* Left Pane: Dynamically sizes to longest text */
.gantt-left-pane {
  position: sticky;
  left: 0;
  z-index: 20;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-medium);
  width: max-content;
  min-width: 480px;
  flex-shrink: 0;
  box-shadow: 4px 0 16px rgba(4, 9, 16, 0.5);
}

.gantt-right-pane {
  flex: 1;
  position: relative;
  background: var(--bg-primary);
}

/* Header Rows */
.gantt-header-row {
  display: flex;
  height: 52px;
  border-bottom: 1px solid var(--border-medium);
  background: var(--bg-tertiary);
  position: sticky;
  top: 0;
  z-index: 25;
}

.gantt-left-header {
  padding: 0.85rem 1.25rem;
  font-family: var(--font-classical);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.gantt-timeline-header {
  display: flex;
  height: 100%;
}

.timeline-cell {
  border-right: 1px solid rgba(197, 160, 89, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  user-select: none;
}

.timeline-cell.month-header {
  font-family: var(--font-serif-title);
  font-weight: 600;
  color: var(--gold-bright);
  background: rgba(197, 160, 89, 0.04);
}

.timeline-cell.current-period {
  background: rgba(97, 175, 239, 0.06);
  color: #7dd3fc;
}

/* Swimlane Group Headers */
.gantt-swimlane-header {
  height: 38px;
  box-sizing: border-box;
  background: rgba(16, 28, 42, 0.96);
  border-bottom: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-subtle);
  padding: 0 1.25rem;
  font-family: var(--font-serif-title);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: sticky;
  left: 0;
  z-index: 15;
}

/* Task Rows in Left Pane */
.gantt-row {
  display: flex;
  height: 44px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast);
}

.gantt-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.gantt-left-row {
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
}

.task-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap; /* Ensures no awkward text truncation */
}

.task-order-num {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.task-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-parchment);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.task-name:hover {
  color: var(--gold-bright);
}

/* Gantt Bar Elements */
.gantt-bar {
  position: absolute;
  top: 9px;
  height: 26px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  padding: 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #0a1118;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
  z-index: 5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  z-index: 8;
}

/* Workstream Color Coding (Muted & Harmonious) */
.gantt-bar.ws-move {
  background: linear-gradient(135deg, #1d404c, #61afef);
  color: #fbf7ee;
  border: 1px solid rgba(97, 175, 239, 0.5);
}

.gantt-bar.ws-marriage {
  background: linear-gradient(135deg, #5c2b64, #c678dd);
  color: #fbf7ee;
  border: 1px solid rgba(198, 120, 221, 0.5);
}

.gantt-bar.ws-relationship {
  background: linear-gradient(135deg, #5a2027, #e06c75);
  color: #fbf7ee;
  border: 1px solid rgba(224, 108, 117, 0.5);
}

.gantt-bar.ws-pr {
  background: linear-gradient(135deg, #8f6c2c, #e5c158);
  color: #0a1118;
  font-weight: 600;
  border: 1px solid #fef3c7;
}

.gantt-bar.ws-owp {
  background: linear-gradient(135deg, #1e523f, #52c49c);
  color: #fbf7ee;
  border: 1px solid rgba(82, 196, 156, 0.5);
}

.gantt-bar.ws-status {
  background: linear-gradient(135deg, #5c3818, #e5a060);
  color: #fbf7ee;
  border: 1px solid rgba(229, 160, 96, 0.5);
}

.gantt-bar.critical-path {
  box-shadow: 0 0 14px rgba(229, 193, 88, 0.45);
  border: 1.5px solid var(--gold-bright);
}

/* Milestone: Clean Horizontal Annotation Badge */
.gantt-milestone-marker {
  position: absolute;
  top: 9px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.22), rgba(16, 28, 42, 0.95));
  border: 1px solid var(--gold-bright);
  box-shadow: 0 0 14px rgba(229, 193, 88, 0.3);
  cursor: pointer;
  z-index: 10;
  transform: none !important; /* Strictly horizontal, not angled */
  white-space: nowrap;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.gantt-milestone-marker:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 0 20px rgba(229, 193, 88, 0.5);
}

.milestone-star {
  color: var(--gold-bright);
  font-size: 0.85rem;
  line-height: 1;
}

.milestone-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-bright);
  white-space: nowrap;
}

/* Today & Expiry Anchor Grid Lines */
.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(97, 175, 239, 0.7);
  z-index: 12;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(97, 175, 239, 0.5);
}

.today-line::after {
  content: 'TODAY';
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #1d404c;
  color: #fbf7ee;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(97, 175, 239, 0.4);
}

.anchor-wp-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  border-left: 2px dashed rgba(224, 108, 117, 0.7);
  z-index: 12;
  pointer-events: none;
}

.anchor-wp-line::after {
  content: 'JAN 17 2027 (WORK PERMIT)';
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(224, 108, 117, 0.2);
  color: #fca5a5;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(224, 108, 117, 0.4);
}

/* SVG Dependency Overlay */
.gantt-svg-overlay {
  position: absolute;
  top: 52px;
  left: 0;
  width: 100%;
  height: calc(100% - 52px);
  pointer-events: none;
  z-index: 4;
}

.dependency-path {
  fill: none;
  stroke: rgba(197, 160, 89, 0.35);
  stroke-width: 1.5;
  stroke-dasharray: 4 2;
}

.dependency-path.critical {
  stroke: var(--gold-bright);
  stroke-width: 2;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 4px rgba(229, 193, 88, 0.5));
}

.dependency-arrow {
  fill: var(--gold-base);
}
