/* =========================================================
   CENTUAL PREMIUM - 08 PROJECTS
   Timeline Component, Project Cards, Sophisticated Animations
   Inspired by modern corporate design with smooth transitions
   ========================================================= */

/* ========================================
   PAGE ENTRANCE ANIMATION
   ======================================== */
.projects-page {
  /* Visible by default for graceful degradation */
  opacity: 1;
}

/* Staggered section reveals - visible by default */
.projects-page .section {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* ========================================
   TIMELINE COMPONENT
   ======================================== */
.timeline-wrapper {
  position: relative;
  padding: var(--space-3xl) 0;
}

.timeline-container {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.timeline {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* Timeline track (horizontal line) */
.timeline-track {
  position: absolute;
  top: 28px;
  left: 56px;
  right: 56px;
  height: 4px;
  background: rgba(27, 20, 100, 0.15);
  border-radius: 2px;
  z-index: 1;
  overflow: hidden;
}

/* Progress fill with gradient */
.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg,
    var(--centual-primary) 0%,
    var(--centual-secondary) 100%
  );
  border-radius: 2px;
  width: 0;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* The moving ball/indicator */
.timeline-ball {
  position: absolute;
  top: -10px;
  left: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg,
    var(--centual-primary) 0%,
    var(--centual-secondary) 100%
  );
  border: 4px solid white;
  border-radius: 50%;
  box-shadow:
    0 4px 16px rgba(27, 20, 100, 0.3),
    0 0 0 4px rgba(27, 20, 100, 0.1);
  z-index: 10;
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: grab;
}

.timeline-ball:hover {
  transform: scale(1.15);
  box-shadow:
    0 6px 24px rgba(27, 20, 100, 0.4),
    0 0 0 8px rgba(27, 20, 100, 0.1);
}

.timeline-ball:active {
  cursor: grabbing;
  transform: scale(1.1);
}

/* Pulse animation for ball */
.timeline-ball::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--centual-primary);
  opacity: 0;
  animation: ballPulse 2s ease-out infinite;
}

@keyframes ballPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.4;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* Individual stage nodes */
.timeline-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  flex: 1;
  max-width: 180px;
  padding: 0 var(--space-sm);
}

.timeline-node {
  width: 56px;
  height: 56px;
  background: white;
  border: 3px solid var(--centual-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 4px 12px rgba(27, 20, 100, 0.15);
}

.timeline-node-icon {
  width: 24px;
  height: 24px;
  color: var(--centual-primary);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}

/* Stage label */
.timeline-label {
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.4;
  max-width: 140px;
}

/* Hover state */
.timeline-stage:hover .timeline-node {
  border-color: var(--centual-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(27, 20, 100, 0.15);
}

.timeline-stage:hover .timeline-node-icon {
  color: var(--centual-primary);
  opacity: 1;
  transform: scale(1.1);
}

.timeline-stage:hover .timeline-label {
  color: var(--centual-primary);
}

/* Active state */
.timeline-stage.is-active .timeline-node {
  border-color: var(--centual-primary);
  background: var(--centual-primary);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 32px rgba(27, 20, 100, 0.25);
}

.timeline-stage.is-active .timeline-node-icon {
  color: white;
  opacity: 1;
}

.timeline-stage.is-active .timeline-label {
  color: var(--centual-primary);
  font-weight: 600;
}

/* Completed state */
.timeline-stage.is-completed .timeline-node {
  border-color: var(--centual-secondary);
  background: var(--centual-secondary);
}

.timeline-stage.is-completed .timeline-node-icon {
  color: white;
  opacity: 1;
}

/* Checkmark for completed */
.timeline-stage.is-completed .timeline-node::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 7px;
  border-left: 3px solid white;
  border-bottom: 3px solid white;
  transform: rotate(-45deg);
  top: 40%;
}

.timeline-stage.is-completed .timeline-label {
  color: var(--centual-secondary);
}

/* Future/locked state - visible but dimmed */
.timeline-stage.is-future .timeline-node {
  opacity: 0.5;
}

.timeline-stage.is-future .timeline-label {
  opacity: 0.5;
}

/* ========================================
   TIMELINE DETAIL PANEL
   ======================================== */
.timeline-detail {
  margin-top: var(--space-3xl);
  background: white;
  border-radius: 20px;
  padding: var(--space-2xl);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
  /* Visible by default */
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 240px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.timeline-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.timeline-detail-number {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg,
    var(--centual-primary) 0%,
    var(--centual-secondary) 100%
  );
  color: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-2xl);
  flex-shrink: 0;
}

.timeline-detail-title {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.timeline-detail-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-xl);
  max-width: 800px;
}

.timeline-detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.timeline-detail-deliverables {
  background: var(--centual-subtle);
  border-radius: 16px;
  padding: var(--space-xl);
}

.timeline-detail-deliverables h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.timeline-detail-deliverables h4::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg,
    var(--centual-primary) 0%,
    var(--centual-secondary) 100%
  );
  border-radius: 2px;
}

.timeline-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-detail-list li {
  padding: var(--space-sm) 0;
  padding-left: var(--space-xl);
  position: relative;
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.6;
}

.timeline-detail-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: var(--centual-secondary);
  border-radius: 50%;
}

/* Project-specific comment */
.timeline-detail-comment {
  background: linear-gradient(135deg,
    rgba(27, 20, 100, 0.03) 0%,
    rgba(27, 20, 100, 0.08) 100%
  );
  border-radius: 16px;
  padding: var(--space-xl);
  border-left: 4px solid var(--centual-primary);
}

.timeline-detail-comment h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--centual-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.timeline-detail-comment p {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-primary);
  line-height: 1.7;
}

/* Dates */
.timeline-detail-dates {
  margin-top: var(--space-xl);
  display: flex;
  gap: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-light);
}

.timeline-date-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.timeline-date-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 500;
}

.timeline-date-value {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

/* ========================================
   STAGE VALUE CARDS
   ======================================== */
.stage-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-lg);
}

.stage-card {
  background: white;
  border-radius: 20px;
  padding: var(--space-xl);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stage-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--centual-primary) 0%,
    var(--centual-secondary) 100%
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stage-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.04);
}

.stage-card:hover::before {
  transform: scaleX(1);
}

.stage-card-icon {
  width: 56px;
  height: 56px;
  background: var(--centual-subtle);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  color: var(--centual-primary);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stage-card:hover .stage-card-icon {
  background: var(--centual-primary);
  color: white;
  transform: scale(1.05);
}

.stage-card-icon svg {
  width: 28px;
  height: 28px;
}

.stage-card-number {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  font-size: var(--text-4xl);
  font-weight: 800;
  background: linear-gradient(135deg,
    rgba(27, 20, 100, 0.06) 0%,
    rgba(27, 20, 100, 0.02) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stage-card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

.stage-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stage-card-list li {
  padding: var(--space-xs) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  line-height: 1.5;
}

.stage-card-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--centual-secondary);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.5em;
}

/* ========================================
   PROJECT ACCESS SECTION
   ======================================== */
.project-access {
  background: linear-gradient(135deg,
    var(--centual-subtle) 0%,
    rgba(255, 255, 255, 0.8) 100%
  );
  border-radius: 24px;
  padding: var(--space-3xl);
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.project-access::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle,
    rgba(27, 20, 100, 0.03) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.project-access-icon {
  width: 72px;
  height: 72px;
  background: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-xl);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  color: var(--centual-primary);
}

.project-access-icon svg {
  width: 36px;
  height: 36px;
}

.project-access-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.project-access-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-size: var(--text-lg);
  line-height: 1.6;
}

.project-access-form {
  display: flex;
  gap: var(--space-md);
  max-width: 440px;
  margin: 0 auto;
  position: relative;
}

.project-access-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  font-size: var(--text-base);
  font-family: var(--font-primary);
  background: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-access-input:focus {
  outline: none;
  border-color: var(--centual-primary);
  box-shadow: 0 0 0 4px rgba(27, 20, 100, 0.1);
}

.project-access-input.is-error {
  border-color: #e53e3e;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.project-access-error {
  position: absolute;
  bottom: -32px;
  left: 0;
  right: 0;
  color: #e53e3e;
  font-size: var(--text-sm);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease-out;
}

.project-access-error.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   PROJECT DETAIL PAGE
   ======================================== */
.project-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.project-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--centual-subtle);
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--centual-primary);
  margin-bottom: var(--space-lg);
}

.project-status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--centual-secondary);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.project-summary {
  background: white;
  border-radius: 24px;
  padding: var(--space-2xl);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border-light);
}

.project-meta-item {
  text-align: center;
  padding: var(--space-lg);
  background: var(--centual-subtle);
  border-radius: 16px;
  transition: all 0.3s ease-out;
}

.project-meta-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.project-meta-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}

.project-meta-value {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.project-meta-value.status-active {
  color: var(--centual-primary);
}

/* Next Steps */
.next-steps {
  background: white;
  border-radius: 24px;
  padding: var(--space-2xl);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.next-steps-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.next-steps-title::before {
  content: '';
  width: 4px;
  height: 28px;
  background: linear-gradient(180deg,
    var(--centual-primary) 0%,
    var(--centual-secondary) 100%
  );
  border-radius: 2px;
}

.next-steps-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl);
}

.next-steps-list li {
  padding: var(--space-lg);
  background: var(--centual-subtle);
  border-radius: 12px;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  transition: all 0.3s ease-out;
  cursor: default;
}

.next-steps-list li:hover {
  transform: translateX(8px);
  background: linear-gradient(90deg,
    var(--centual-subtle) 0%,
    rgba(27, 20, 100, 0.06) 100%
  );
}

.next-steps-list li::before {
  content: '';
  width: 32px;
  height: 32px;
  background: var(--centual-primary);
  border-radius: 10px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
  background-size: 16px;
  background-position: center;
  background-repeat: no-repeat;
}

.next-steps-contact {
  padding: var(--space-xl);
  background: linear-gradient(135deg,
    rgba(27, 20, 100, 0.03) 0%,
    rgba(27, 20, 100, 0.08) 100%
  );
  border-radius: 16px;
  text-align: center;
}

.next-steps-contact p {
  margin: 0 0 var(--space-lg);
  color: var(--text-secondary);
  font-size: var(--text-lg);
}

/* ========================================
   INTRO TEXT ANIMATION
   ======================================== */
.intro-text {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 720px;
  margin: 0 auto var(--space-3xl);
  text-align: center;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 1024px) {
  .stage-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .project-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-label {
    font-size: var(--text-xs);
    max-width: 100px;
  }

  .timeline-node {
    width: 48px;
    height: 48px;
  }

  .timeline-detail-content {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 768px) {
  .timeline-wrapper {
    padding: var(--space-2xl) 0;
  }

  /* Vertical timeline on mobile */
  .timeline {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .timeline-track {
    top: 28px;
    bottom: 28px;
    left: 27px;
    right: auto;
    width: 3px;
    height: calc(100% - 56px);
  }

  .timeline-progress {
    width: 100% !important;
    height: 0%;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .timeline-ball {
    left: 17px !important;
    top: 0;
    transition: top 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .timeline-stage {
    flex-direction: row;
    align-items: center;
    gap: var(--space-lg);
    max-width: none;
    width: 100%;
    padding: var(--space-md) 0;
    padding-left: 72px;
  }

  .timeline-node {
    position: absolute;
    left: 0;
    width: 56px;
    height: 56px;
  }

  .timeline-label {
    text-align: left;
    max-width: none;
    margin-top: 0;
    font-size: var(--text-base);
  }

  .stage-cards-grid {
    grid-template-columns: 1fr;
  }

  .project-meta {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .project-access-form {
    flex-direction: column;
  }

  .project-access-form .btn {
    width: 100%;
  }

  .timeline-detail {
    padding: var(--space-xl);
  }

  .timeline-detail-dates {
    flex-direction: column;
    gap: var(--space-md);
  }

  .timeline-detail-header {
    flex-direction: column;
    text-align: center;
  }

  .timeline-detail-title {
    font-size: var(--text-2xl);
  }
}

@media (max-width: 480px) {
  .project-meta {
    grid-template-columns: 1fr;
  }

  .stage-card {
    padding: var(--space-lg);
  }

  .project-access {
    padding: var(--space-xl);
  }
}
