/* Project Milestones Styles */
.project-milestones {
  background: var(--color-white);
  border-radius: 15px;
  padding: 30px;
  margin: 30px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Header */
.milestones-header {
  margin-bottom: 30px;
}

.milestones-header h3 {
  font-size: var(--font-20);
  font-weight: 700;
  color: var(--typo-secondary);
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.milestones-header h3::before {
  content: "🎯";
  font-size: 24px;
}

/* Overall Progress */
.overall-progress {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-plight);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-label {
  font-size: var(--font-16);
  font-weight: 600;
  color: var(--typo-secondary);
}

.progress-value {
  font-size: var(--font-16);
  font-weight: 700;
  color: var(--color-primary);
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #d6610e);
  border-radius: 6px;
  transition: width 0.8s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Loading State */
.milestones-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px;
  text-align: center;
}

.milestones-loading .spinner-border {
  width: 2rem;
  height: 2rem;
  border-width: 0.25em;
  border-color: var(--color-primary);
  border-right-color: transparent;
  animation: spinner-border 0.75s linear infinite;
  margin-bottom: 15px;
}

.milestones-loading p {
  color: var(--text-color);
  font-size: var(--font-small);
  margin: 0;
}

/* Error State */
.milestones-error {
  text-align: center;
  padding: 40px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
}

.milestones-error h4 {
  color: #dc2626;
  margin-bottom: 10px;
  font-size: var(--font-16);
}

.milestones-error p {
  color: #991b1b;
  font-size: var(--font-small);
  margin: 0;
}

/* Milestones Container */
.milestones-container {
  position: relative;
}

/* Milestone Item */
.milestone-item {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  position: relative;
}

.milestone-item:last-child {
  margin-bottom: 0;
}

/* Timeline */
.milestone-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.milestone-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 3px solid var(--color-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 2;
  position: relative;
}

.milestone-line {
  width: 2px;
  height: 60px;
  background: var(--border-color);
  margin-top: 10px;
}

.milestone-item:last-child .milestone-line {
  display: none;
}

/* Milestone Content */
.milestone-content {
  flex: 1;
  background: var(--bg-light);
  border-radius: 12px;
  padding: 25px;
  border-left: 4px solid var(--color-primary);
  transition: all 0.3s ease;
}

.milestone-content:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.milestone-item.completed .milestone-content {
  border-left-color: #22c55e;
}

.milestone-item.in_progress .milestone-content {
  border-left-color: #f59e0b;
}

.milestone-item.cancelled .milestone-content {
  border-left-color: #ef4444;
}

/* Milestone Header */
.milestone-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  gap: 15px;
}

.milestone-header h4 {
  font-size: var(--font-18);
  font-weight: 600;
  color: var(--typo-secondary);
  margin: 0;
  line-height: 1.4;
}

.milestone-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.status-badge {
  font-size: var(--font-xs);
  padding: 4px 10px;
  border-radius: 15px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge.completed {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.status-badge.in_progress {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.status-badge.pending {
  background: rgba(107, 114, 128, 0.1);
  color: #4b5563;
}

.status-badge.cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.due-date {
  font-size: var(--font-xs);
  color: var(--text-color);
  font-weight: 500;
}

/* Milestone Description */
.milestone-description {
  font-size: var(--font-small);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0 0 20px 0;
}

/* Completion Info */
.completion-info {
  margin-bottom: 20px;
}

.completed-date {
  font-size: var(--font-small);
  color: #16a34a;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
}

/* Progress Section */
.milestone-progress {
  margin-bottom: 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-header span:first-child {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--typo-secondary);
}

.progress-header span:last-child {
  font-size: var(--font-small);
  font-weight: 700;
  color: var(--color-primary);
}

.milestone-progress .progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
}

.milestone-progress .progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Deliverables */
.milestone-deliverables {
  margin-top: 20px;
}

.milestone-deliverables h5 {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--typo-secondary);
  margin: 0 0 12px 0;
}

.milestone-deliverables ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.milestone-deliverables li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: var(--font-small);
  color: var(--text-color);
  border-bottom: 1px solid #f3f4f6;
}

.milestone-deliverables li:last-child {
  border-bottom: none;
}

.milestone-deliverables li.completed {
  color: #16a34a;
}

.deliverable-status {
  font-size: 14px;
  min-width: 20px;
}

/* Project Completion Summary */
.project-completion-summary {
  margin-top: 40px;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 2px solid #22c55e;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
}

.completion-header h4 {
  font-size: var(--font-20);
  font-weight: 700;
  color: #16a34a;
  margin: 0 0 10px 0;
}

.completion-header p {
  font-size: var(--font-16);
  color: #15803d;
  margin: 0 0 25px 0;
}

.completion-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stat-value {
  font-size: var(--font-24);
  font-weight: 700;
  color: #16a34a;
}

.stat-label {
  font-size: var(--font-small);
  color: #15803d;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 991px) {
  .milestone-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .milestone-meta {
    flex-direction: row;
    align-items: center;
    gap: 15px;
  }
  
  .completion-stats {
    gap: 25px;
  }
}

@media (max-width: 767px) {
  .project-milestones {
    padding: 20px;
    margin: 20px 0;
  }
  
  .milestone-item {
    gap: 15px;
  }
  
  .milestone-marker {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .milestone-content {
    padding: 20px;
  }
  
  .milestone-header h4 {
    font-size: var(--font-16);
  }
  
  .overall-progress {
    padding: 15px;
  }
  
  .completion-stats {
    flex-direction: column;
    gap: 15px;
  }
  
  .project-completion-summary {
    padding: 20px;
    margin-top: 30px;
  }
}

@media (max-width: 576px) {
  .milestone-item {
    gap: 10px;
  }
  
  .milestone-marker {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .milestone-content {
    padding: 15px;
  }
  
  .milestone-header {
    gap: 8px;
  }
  
  .milestone-meta {
    gap: 10px;
  }
  
  .status-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* Animation */
@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

/* Print Styles */
@media print {
  .project-milestones {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .milestone-content:hover {
    transform: none;
    box-shadow: none;
  }
  
  .milestone-marker {
    box-shadow: none;
  }
  
  .progress-fill::after {
    display: none;
  }
}