/* ===== GLOBAL ===== */
body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  margin: 0;
  padding: 0;
}

/* ===== TIMELINE ===== */
.timeline {
  max-width: 900px;
  margin: 60px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px 80px;
  position: relative;
}

/* CENTER LINE */
.timeline::after {
  content: '';
  position: absolute;
  width: 4px;
  background: linear-gradient(180deg, #2563eb, #60a5fa);
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 10px;
  z-index: 1;
}

/* ===== ITEMS ===== */
.timeline-item {
  display: flex;
  position: relative;
}

/* alignment */
.timeline-item:nth-child(odd) {
  justify-content: flex-end;
}

.timeline-item:nth-child(even) {
  justify-content: flex-start;
}

/* ===== DOT ===== */
.timeline-item::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #2563eb;
  border-radius: 50%;
  top: 30px;
  z-index: 2;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

.timeline-item:nth-child(odd)::after {
  right: -7px;
}

.timeline-item:nth-child(even)::after {
  left: -7px;
}

/* ===== CARD ===== */
.card {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;

  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);

  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  transition: all 0.3s ease;

  opacity: 0;
  transform: translateY(30px);
}

.card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.card.show {
  opacity: 1;
  transform: translateY(0);
}

/* gradient border */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #ec4899, #f59e0b);
  z-index: 0;

  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.card * {
  position: relative;
  z-index: 1;
}

/* ===== AVATAR ===== */
.avatar,
.avatar-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  flex-shrink: 0;
}

.avatar {
  object-fit: cover;
}

.avatar-placeholder {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* ===== TEXT ===== */
.card h4 {
  font-size: 15px;
  font-weight: 600;
}

.card p {
  font-size: 13px;
  color: #6b7280;
}

/* ===== POPUP ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  z-index: 999;
}

.overlay.active {
  display: flex;
}

.popup-card {
  position: relative;
  background: #fff;
  padding: 22px;
  border-radius: 16px;
  width: 90%;
  max-width: 320px;
  text-align: center;
  animation: popup 0.3s ease;
}

.popup-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 10px;
}

@keyframes popup {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ===== CLOSE BUTTON ===== */
.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  background: #f3f4f6;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #fee2e2;
  color: red;
}

/* ===== FOOTER ===== */
.footer {
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #d1d5db;
  text-align: center;
  padding: 20px;
  margin-top: 60px;
  font-size: 14px;
}

.footer span {
  color: #60a5fa;
  font-weight: 600;
}

/* ===== HEADINGS ===== */
.timeline-heading {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  padding-bottom: 10px;
}

.left-heading {
  grid-column: 1;
  text-align: right;
  padding-right: 20px;
}

.right-heading {
  grid-column: 2;
  text-align: left;
  padding-left: 20px;
}

/* =========================
   RESPONSIVE DESIGN
========================= */

/* Tablet */
@media (max-width: 1024px) {
  .timeline {
    gap: 40px 60px;
  }

  .card {
    max-width: 280px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .timeline {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .timeline::after {
    left: 18px;
    transform: none;
  }

  .timeline-item {
    justify-content: flex-start !important;
    padding-left: 40px;
  }

  .timeline-item::after {
    left: 10px !important;
    right: auto !important;
  }

  .card {
    max-width: 100%;
  }

  .left-heading,
  .right-heading {
    grid-column: auto;
    text-align: center;
    padding: 0;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .timeline {
    margin: 30px auto;
    gap: 20px;
  }

  .card {
    padding: 14px;
    gap: 10px;
  }

  .card h4 {
    font-size: 14px;
  }

  .card p {
    font-size: 12px;
  }

  .timeline::after {
    width: 3px;
  }

  .timeline-item::after {
    width: 10px;
    height: 10px;
  }
}