/* ========== MILESTONE LAYOUT - Header, panels ========== */

/* ========== ASSEMBLY LINE HEADER ========== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  padding: var(--spacing-sm) var(--spacing-xl);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Project title */
.header h1 {
  font-size: var(--font-lg);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

/* ========== VIEW TOGGLE ========== */
.view-toggle-group {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.view-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.view-toggle-btn--active {
  background: var(--accent-subtle);
  color: var(--accent-bright);
}

.view-toggle-btn--active:hover {
  background: var(--accent-subtle);
  color: var(--accent-bright);
}

/* ========== MAIN CONTAINER ========== */
.milestone-container {
  height: calc(100vh - 52px);
  overflow: hidden;
}

/* ========== TIMELINE VIEW ========== */
.timeline-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.timeline-header {
  display: flex;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  min-height: 40px;
  overflow-x: auto;
  scrollbar-width: none;
}

.timeline-header::-webkit-scrollbar {
  display: none;
}

.timeline-body {
  flex: 1;
  overflow: auto;
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.timeline-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-3xl);
}

.timeline-empty__icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  opacity: 0.5;
  margin-bottom: var(--spacing-lg);
}

.timeline-empty__title {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.timeline-empty__text {
  font-size: var(--font-sm);
  color: var(--text-muted);
  max-width: 300px;
  line-height: var(--leading-relaxed);
}

/* ========== LIST VIEW - Two Panel Layout ========== */
.list-view {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* ========== MILESTONE PANEL (LEFT) ========== */
.milestone-panel {
  flex: 0 0 320px;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
}

.milestone-panel__header {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.milestone-panel__title {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text-primary);
}

.milestone-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-sm);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.milestone-panel__footer {
  padding: var(--spacing-sm) var(--spacing-lg);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--spacing-sm);
}

.milestone-add-btn {
  flex: 1;
  padding: var(--spacing-sm);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.milestone-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.milestone-stats {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
}

/* ========== DETAIL PANEL (RIGHT) ========== */
.detail-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-panel__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-3xl);
  color: var(--text-muted);
}

.detail-panel__icon {
  width: 48px;
  height: 48px;
  opacity: 0.5;
  margin-bottom: var(--spacing-lg);
}

.detail-panel__empty h3 {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.detail-panel__empty p {
  font-size: var(--font-sm);
  line-height: var(--leading-relaxed);
}

.detail-panel__content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-xl);
}

/* ========== FLOATING ACTION BUTTON ========== */
.fab {
  position: fixed;
  bottom: var(--spacing-xl);
  right: var(--spacing-xl);
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  z-index: 50;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg), 0 0 30px var(--accent-glow);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .header {
    flex-wrap: wrap;
  }

  .header-right {
    flex-wrap: wrap;
  }

  .list-view {
    flex-direction: column;
    height: auto;
  }

  .milestone-panel {
    flex: none;
    max-width: none;
    height: 40vh;
    min-height: 300px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .detail-panel {
    min-height: 50vh;
  }
}

@media (max-width: 640px) {
  .header-left {
    flex-wrap: wrap;
    width: 100%;
  }

  .header-right {
    width: 100%;
    justify-content: flex-start;
  }

  .stat-item__label {
    display: none;
  }

  .action-group {
    display: none;
  }

  .view-toggle-btn span:not(:empty) {
    display: none;
  }

  .milestone-panel {
    flex: 0 0 auto;
    min-width: 0;
    height: 35vh;
  }

  .fab {
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 44px;
    height: 44px;
  }
}
