/* ==========================================================================
   Top Progress Bar & Phase Dropdown
   Sticky progress indicator at the top of the content area
   ========================================================================== */

/* --- Container --- */
.progress-bar-container {
  position: sticky;
  top: 0;
  z-index: 999;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--bg-secondary, #282c34);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.3));
  cursor: pointer;
  user-select: none;
  transition: var(--transition-colors, background-color 0.3s ease);
}

/* --- Track --- */
.progress-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary, #2d3748);
  border-radius: 4px;
  overflow: hidden;
  margin-right: 12px;
  position: relative;
}

/* --- Fill --- */
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent, #61dafb);
  transition: width 0.5s ease, background-color 0.5s ease;
  min-width: 0;
}

/* Gradient variant for higher completion */
.progress-bar-fill[data-progress="high"] {
  background: linear-gradient(90deg, var(--accent, #61dafb), var(--success, #4ecdc4));
}

/* --- Text --- */
.progress-bar-text {
  font-size: 12px;
  color: var(--text-muted, #718096);
  white-space: nowrap;
  min-width: 90px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

/* --- Dropdown Chevron --- */
.progress-bar-chevron {
  margin-left: 8px;
  font-size: 10px;
  color: var(--text-muted, #718096);
  transition: transform 0.3s ease, color 0.3s ease;
}

.progress-bar-container.open .progress-bar-chevron {
  transform: rotate(180deg);
}

/* ==========================================================================
   Phase Dropdown
   ========================================================================== */

.progress-dropdown-wrapper {
  position: relative;
}

.progress-dropdown {
  position: absolute;
  top: 36px;
  left: 0;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  background: var(--bg-secondary, #282c34);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.4));
  z-index: 998;
  transition: max-height 0.3s ease;
}

.progress-dropdown.open {
  max-height: 500px;
  overflow-y: auto;
}

/* --- Phase Row --- */
.progress-phase-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  gap: 12px;
  transition: background-color 0.2s ease;
}

.progress-phase-row:last-child {
  border-bottom: none;
}

.progress-phase-row:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.06));
}

.progress-phase-row a {
  color: var(--text-primary, #e0e0e0);
  text-decoration: none;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-phase-row a:hover {
  color: var(--accent, #61dafb);
}

/* --- Phase Bar (mini bar inside each row) --- */
.phase-bar {
  width: 120px;
  height: 6px;
  background: var(--bg-tertiary, #2d3748);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.phase-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent, #61dafb);
  transition: width 0.4s ease;
}

/* --- Phase Percentage --- */
.phase-percentage {
  font-size: 11px;
  color: var(--text-muted, #718096);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Offset sidebar toggle & content for sticky progress bar
   ========================================================================== */

.sidebar-toggle {
  top: 44px !important;
}

.sidebar {
  padding-top: 44px !important;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .sidebar-toggle {
    top: 36px !important;
  }

  .sidebar {
    padding-top: 36px !important;
  }
  .progress-bar-container {
    height: 28px;
    padding: 0 10px;
  }

  .progress-bar-text {
    display: none;
  }

  .progress-bar-track {
    height: 6px;
    margin-right: 8px;
  }

  .progress-dropdown {
    top: 28px;
  }

  .progress-phase-row {
    padding: 6px 10px;
    font-size: 12px;
  }

  .phase-bar {
    width: 80px;
    height: 4px;
  }
}
