/* ==========================================================================
   CyFun Tool - Roadmap Module Styles
   ========================================================================== */

/* --- Page Wrapper (wider than .profile's 800px) --- */
.roadmap-page {
  max-width: 1200px;
}

/* --- Visual Summary Cards --- */
.roadmap-visuals {
  display: grid;
  grid-template-columns: 1fr 160px 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.roadmap-visual-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.roadmap-visual-card__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

/* Completion card */
.roadmap-completion__pct {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  line-height: 1;
}

.roadmap-completion__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.roadmap-completion__bar {
  width: 100%;
  height: 8px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.roadmap-completion__bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
  min-width: 2px;
}

.roadmap-overdue-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 3px var(--space-sm);
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-danger);
  font-weight: var(--weight-semibold);
  align-self: flex-start;
}

/* Status chart card */
.roadmap-chart-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.roadmap-visual-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.roadmap-legend-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.roadmap-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Priority bars card */
.roadmap-priority-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
  justify-content: center;
}

.roadmap-priority-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.roadmap-priority-bar-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-family: var(--font-mono);
  min-width: 18px;
}

.roadmap-priority-bar-track {
  flex: 1;
  height: 10px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.roadmap-priority-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
  min-width: 0;
}

.roadmap-priority-bar-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-width: 20px;
  text-align: right;
}

/* --- Filter Tabs --- */
.roadmap-filters {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
}

.roadmap-filter-btn {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  background: none;
  cursor: pointer;
}

.roadmap-filter-btn:hover {
  color: var(--color-text);
}

.roadmap-filter-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* --- Action Item List --- */
.roadmap-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.roadmap-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.roadmap-item:hover {
  background: var(--color-bg-alt);
}

.roadmap-item--done {
  opacity: 0.6;
}

.roadmap-item--done .roadmap-item__action {
  text-decoration: line-through;
}

.roadmap-item--progress {
  border-left: 3px solid var(--color-warning);
}

.roadmap-item__status {
  font-size: var(--text-xs);
  padding: 2px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
  min-width: 90px;
  margin-top: 3px;
  flex-shrink: 0;
}

.roadmap-item__req {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  min-width: 76px;
  flex-shrink: 0;
  padding-top: 3px;
}

.roadmap-item__req-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
  flex-shrink: 0;
  padding-top: 3px;
}

.roadmap-item__priority {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  padding-top: 3px;
}

.roadmap-item__action {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  padding: 2px 4px;
  min-width: 0;
  resize: none;
  line-height: 1.45;
  overflow: hidden;
}

.roadmap-item__action:focus {
  outline: none;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px var(--color-primary-border);
  overflow: auto;
}

.roadmap-item__owner {
  width: 100px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  padding: 2px 4px;
  margin-top: 3px;
  text-align: right;
  flex-shrink: 0;
}

.roadmap-item__owner:focus {
  outline: none;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px var(--color-primary-border);
}

/* --- Due Date --- */
.roadmap-item__due {
  width: 120px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  padding: 2px 4px;
  margin-top: 3px;
  flex-shrink: 0;
}
.roadmap-item__due:focus {
  outline: none;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px var(--color-primary-border);
}

/* --- Overdue Items --- */
.roadmap-item--overdue {
  border-left: 3px solid var(--color-danger);
  background: var(--color-danger-bg);
}
.roadmap-item--overdue .roadmap-item__due {
  color: var(--color-danger);
  font-weight: var(--weight-bold);
}

/* --- Progress History --- */

.roadmap-history__selectors {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.roadmap-history__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.roadmap-history__select {
  font-size: var(--text-sm);
  padding: 4px var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  max-width: 260px;
}

.roadmap-history__arrow {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.roadmap-history__summary {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
}

.roadmap-history__summary-label {
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  margin-right: var(--space-xs);
}

.roadmap-history__delta {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

.roadmap-history__delta--pos { color: var(--color-success); }
.roadmap-history__delta--neg { color: var(--color-danger); }

.roadmap-history__pill {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.roadmap-history__pill--pos { background: var(--color-success-bg); color: var(--color-success); border: 1px solid var(--color-success-border, var(--color-success)); }
.roadmap-history__pill--neg { background: var(--color-danger-bg);  color: var(--color-danger);  border: 1px solid var(--color-danger-border); }
.roadmap-history__pill--neu { background: var(--color-bg-alt);     color: var(--color-text-muted); border: 1px solid var(--color-border); }

.roadmap-history__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.roadmap-history__table thead th {
  text-align: left;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 2px solid var(--color-border);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.roadmap-history__func-row td {
  padding: var(--space-sm) var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
}

.roadmap-history__func-row:hover td {
  background: var(--color-bg-alt);
}

.roadmap-history__toggle-icon {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-right: var(--space-xs);
  transition: transform var(--transition-fast);
}

.roadmap-history__num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
  width: 70px;
}

.roadmap-history__req-row > td {
  padding: 0;
  background: var(--color-bg-alt);
}

.roadmap-history__req-body {
  padding: var(--space-sm) var(--space-md) var(--space-md) var(--space-xl);
}

.roadmap-history__req-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
}

.roadmap-history__req-table thead th {
  text-align: left;
  padding: 4px var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.roadmap-history__req-table tbody tr td {
  padding: 5px var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.roadmap-history__req-table tbody tr:last-child td {
  border-bottom: none;
}

/* --- CAB Checklist --- */
.cab-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.cab-checklist__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: var(--text-sm);
}

.cab-checklist__item:hover {
  background: var(--color-bg-alt);
}

.cab-checklist__check {
  cursor: pointer;
  flex-shrink: 0;
}

.cab-checklist__check:checked + .cab-checklist__text {
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.cab-checklist__text {
  flex: 1;
}
