/* ============================================
   EXPERIENCE / TIMELINE SECTION ENHANCEMENTS
   ============================================ */

/* Timeline Container */
#qualification {
  position: relative;
}

/* Enhanced Timeline Base */
.timeline {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Animated Connecting Line (SVG-style with CSS) */
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(
    180deg,
    #ef3724 0%,
    #ff6b5b 25%,
    #ef3724 50%,
    #ff6b5b 75%,
    #ef3724 100%
  );
  background-size: 100% 200%;
  animation: timelineGradient 3s ease infinite;
  border-radius: 3px;
  transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline.timeline-animated::before {
  height: 100%;
}

@keyframes timelineGradient {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}

/* Animated line glow effect */
.timeline::after {
  content: '';
  position: absolute;
  left: -2px;
  top: 0;
  width: 7px;
  height: 0;
  background: rgba(239, 55, 36, 0.3);
  filter: blur(4px);
  border-radius: 3px;
  transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.timeline.timeline-animated::after {
  height: 100%;
}

/* Timeline Items */
.timeline > li {
  position: relative;
  padding-left: 35px;
  margin-bottom: 40px;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation enhancement - only hide if JS will animate */
.timeline.timeline-animate-items > li {
  opacity: 0;
  transform: translateY(30px);
}

.timeline > li.timeline-visible,
.timeline.timeline-animate-items > li.timeline-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Stagger animation delay for items */
.timeline > li:nth-child(1) { transition-delay: 0.1s; }
.timeline > li:nth-child(2) { transition-delay: 0.2s; }
.timeline > li:nth-child(3) { transition-delay: 0.3s; }
.timeline > li:nth-child(4) { transition-delay: 0.4s; }
.timeline > li:nth-child(5) { transition-delay: 0.5s; }
.timeline > li:nth-child(6) { transition-delay: 0.6s; }
.timeline > li:nth-child(7) { transition-delay: 0.7s; }
.timeline > li:nth-child(8) { transition-delay: 0.8s; }

/* Timeline Dot with Pulse Animation */
.timeline > li::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 5px;
  width: 15px;
  height: 15px;
  background: linear-gradient(135deg, #ef3724, #ff6b5b);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(239, 55, 36, 0.2);
  z-index: 2;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(239, 55, 36, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 55, 36, 0);
    transform: scale(1.1);
  }
}

/* Inner pulse ring */
.timeline > li::after {
  content: '';
  position: absolute;
  left: -3px;
  top: 8px;
  width: 9px;
  height: 9px;
  background: #fff;
  border-radius: 50%;
  z-index: 3;
}

/* Year Badge with Glow */
.timeline .title {
  display: inline-block;
  padding: 8px 20px;
  background: linear-gradient(135deg, #ef3724, #ff6b5b);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 25px;
  margin-bottom: 15px;
  box-shadow: 0 4px 15px rgba(239, 55, 36, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  animation: yearGlow 2s ease-in-out infinite alternate;
  position: relative;
  overflow: hidden;
}

.timeline .title::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmerYear 3s infinite;
}

@keyframes shimmerYear {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes yearGlow {
  0% {
    box-shadow: 0 4px 15px rgba(239, 55, 36, 0.4);
  }
  100% {
    box-shadow: 0 4px 25px rgba(239, 55, 36, 0.6), 0 0 30px rgba(239, 55, 36, 0.2);
  }
}

/* Timeline Details Card */
.timeline .details {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(239, 55, 36, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Card hover lift effect */
.timeline .details:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(239, 55, 36, 0.15);
  border-color: rgba(239, 55, 36, 0.3);
}

/* Decorative corner accent */
.timeline .details::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, transparent 50%, rgba(239, 55, 36, 0.05) 50%);
  border-radius: 0 20px 0 0;
  transition: all 0.3s ease;
}

.timeline .details:hover::before {
  background: linear-gradient(135deg, transparent 50%, rgba(239, 55, 36, 0.1) 50%);
}

/* Company heading with logo */
.timeline .details h5 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  font-weight: 600;
  color: #333;
}

/* Company Logo Zoom on Hover */
.timeline .details h5 img {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 5px;
}

.timeline .details:hover h5 img {
  transform: scale(1.15);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Role/Position styling */
.timeline .details small.fg-theme {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 12px;
  background: rgba(239, 55, 36, 0.1);
  border-radius: 20px;
  margin-bottom: 15px;
}

/* Details paragraph styling */
.timeline .details p {
  color: #555;
  line-height: 1.7;
  margin-bottom: 10px;
}

/* Expandable/Collapsible Card System */
.timeline .details.expandable {
  max-height: 250px;
  overflow: hidden;
  position: relative;
}

.timeline .details.expandable::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: linear-gradient(transparent, #fff);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.timeline .details.expandable.expanded {
  max-height: none;
}

.timeline .details.expandable.expanded::after {
  opacity: 0;
}

.timeline-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  margin-top: 15px;
  background: transparent;
  border: 2px solid #ef3724;
  color: #ef3724;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 5;
}

.timeline-expand-btn:hover {
  background: linear-gradient(135deg, #ef3724, #ff6b5b);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(239, 55, 36, 0.3);
}

.timeline-expand-btn .arrow {
  transition: transform 0.3s ease;
}

.timeline-expand-btn.expanded .arrow {
  transform: rotate(180deg);
}

/* Section Headings */
#qualification h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 30px;
  padding-bottom: 10px;
}

#qualification h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #ef3724, #ff6b5b);
  border-radius: 3px;
}

/* Links in timeline */
.timeline .details a {
  color: #ef3724;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.timeline .details a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #ef3724;
  transition: width 0.3s ease;
}

.timeline .details a:hover::after {
  width: 100%;
}

.timeline .details a:hover {
  color: #ff6b5b;
}

/* Dot indicator in details */
.timeline .details .dot {
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #ef3724, #ff6b5b);
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  box-shadow: 0 2px 5px rgba(239, 55, 36, 0.3);
}

/* Responsive Timeline */
@media (max-width: 991px) {
  .timeline > li {
    padding-left: 30px;
  }

  .timeline .details {
    padding: 20px;
  }

  .timeline .title {
    font-size: 0.85rem;
    padding: 6px 15px;
  }
}

@media (max-width: 768px) {
  .timeline > li {
    padding-left: 25px;
    margin-bottom: 30px;
  }

  .timeline > li::before {
    width: 12px;
    height: 12px;
    left: -5px;
  }

  .timeline > li::after {
    width: 6px;
    height: 6px;
    left: -2px;
    top: 7px;
  }

  .timeline .details {
    padding: 15px;
  }

  .timeline .details h5 {
    font-size: 1rem;
  }

  .timeline .details h5 img {
    max-width: 60px;
    height: auto;
  }

  .timeline .details.expandable {
    max-height: 200px;
  }

  .details-width {
    width: 100%;
  }
}

/* Print styles for timeline */
@media print {
  .timeline > li {
    opacity: 1;
    transform: none;
  }

  .timeline::before,
  .timeline::after {
    display: none;
  }

  .timeline .details.expandable {
    max-height: none;
  }

  .timeline-expand-btn {
    display: none;
  }
}

