/* ===============================
   Professional Trending Timeline
   Premium Design with Smooth Effects
================================ */

/* Base Container */
.pp-trending-timeline {
  position: relative;
  width: 100%;
  padding: 100px 0;
  overflow: hidden;
}

/* Main Timeline Container */
.timeline-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
}

/* Vertical Timeline Line with Glow */
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(99, 102, 241, 0.2) 5%,
    rgba(99, 102, 241, 0.2) 95%,
    transparent 100%
  );
  transform: translateX(-50%);
  z-index: 1;
}

.timeline-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(99, 102, 241, 0.4),
    rgba(168, 85, 247, 0.4)
  );
  filter: blur(4px);
  opacity: 0.5;
  z-index: -1;
}

/* Timeline Items */
.timeline-item {
  position: relative;
  width: calc(50% - 80px);
  margin-bottom: 80px;
  opacity: 0.4;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 2;
}

.timeline-item:nth-child(odd) {
  margin-left: auto;
}

.timeline-item:nth-child(even) {
  margin-right: auto;
}

/* Floating Card Effect */
.timeline-content {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  border: 1px solid rgba(255, 255, 255, 0.9);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Glass Morphism Effect */
.timeline-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(248, 250, 252, 0.9) 100%
  );
  border-radius: 24px;
  z-index: -1;
}

/* Accent Border */
.timeline-content::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(
    45deg,
    transparent 0%,
    rgba(99, 102, 241, 0.1) 50%,
    transparent 100%
  );
  border-radius: 25px;
  z-index: -2;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Timeline Node */
.timeline-node {
  position: absolute;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 1),
    0 0 0 8px rgba(99, 102, 241, 0.1), 0 8px 32px rgba(99, 102, 241, 0.2);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.timeline-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.timeline-item:nth-child(odd) .timeline-node {
  left: calc(100% + 56px);
}

.timeline-item:nth-child(even) .timeline-node {
  right: calc(100% + 56px);
}

/* Connection Line */
.timeline-connector {
  position: absolute;
  top: 50%;
  height: 2px;
  width: 56px;
  background: linear-gradient(
    90deg,
    rgba(203, 213, 225, 0.3),
    rgba(203, 213, 225, 0.6)
  );
  transform: translateY(-50%);
  transition: all 0.4s ease;
}

.timeline-item:nth-child(odd) .timeline-connector {
  left: 100%;
}

.timeline-item:nth-child(even) .timeline-connector {
  right: 100%;
}

/* Date Badge */
.timeline-date {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  padding: 8px 20px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid rgba(99, 102, 241, 0.12);
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

/* Title */
.timeline-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  line-height: 1.3;
  background: linear-gradient(135deg, #1e293b, #475569);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: all 0.3s ease;
}

/* Description */
.timeline-description {
  color: #64748b;
  line-height: 1.7;
  font-size: 1.05rem;
  margin-bottom: 0;
  transition: all 0.3s ease;
}

/* Tag for Trend Indicator */
.timeline-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  padding: 4px 12px;
  border-radius: 12px;
  margin-left: 12px;
  vertical-align: middle;
}

.timeline-tag::before {
  content: "▲";
  font-size: 8px;
}

/* Active State */
.timeline-item.active {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item.active .timeline-content {
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15),
    0 4px 20px rgba(99, 102, 241, 0.08), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transform: translateY(-5px);
}

.timeline-item.active .timeline-content::after {
  opacity: 1;
}

.timeline-item.active .timeline-node {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 1),
    0 0 0 10px rgba(99, 102, 241, 0.2), 0 12px 48px rgba(99, 102, 241, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.timeline-item.active .timeline-node::before {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  transform: translate(-50%, -50%) scale(1.2);
}

.timeline-item.active .timeline-connector {
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.6),
    rgba(168, 85, 247, 0.8)
  );
  width: 70px;
}

.timeline-item.active .timeline-date {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  transform: translateY(-2px);
}

.timeline-item.active .timeline-title {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Animated Scrolling Tracker */
.timeline-tracker {
  position: absolute;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 50%;
  z-index: 4;
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 12px rgba(99, 102, 241, 0.15),
    0 20px 60px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 6px solid rgba(255, 255, 255, 0.95);
  transition: top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s ease;
  overflow: hidden;
}

.timeline-tracker::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timeline-tracker::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    transparent 0deg,
    rgba(255, 255, 255, 0.3) 180deg,
    transparent 360deg
  );
  animation: rotate 3s linear infinite;
  opacity: 0.6;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Progress Glow Line */
.timeline-progress {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 0;
  background: linear-gradient(
    to bottom,
    rgba(99, 102, 241, 0.8),
    rgba(168, 85, 247, 0.8)
  );
  transform: translateX(-50%);
  z-index: 1;
  transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), 0 0 40px rgba(99, 102, 241, 0.2);
}

/* Hover Effects */
.timeline-content:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(99, 102, 241, 0.15),
    0 10px 30px rgba(99, 102, 241, 0.1);
}

.timeline-content:hover::after {
  opacity: 1;
}

.timeline-item:hover .timeline-node {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 1),
    0 0 0 10px rgba(99, 102, 241, 0.2), 0 12px 48px rgba(99, 102, 241, 0.3);
}

/* ===============================
   MOBILE RESPONSIVE - Enhanced
================================ */
@media (max-width: 1200px) {
  .timeline-container {
    padding: 0 30px;
  }

  .timeline-item {
    width: calc(50% - 60px);
  }
}

@media (max-width: 992px) {
  .pp-trending-timeline {
    padding: 80px 0;
  }

  .timeline-line,
  .timeline-progress {
    left: 60px;
  }

  .timeline-tracker {
    left: 60px;
  }

  .timeline-item {
    width: calc(100% - 100px);
    margin-left: 100px !important;
    margin-right: 0 !important;
  }

  .timeline-node {
    left: -76px !important;
    right: auto !important;
  }

  .timeline-connector {
    left: -56px !important;
    right: auto !important;
    width: 56px;
  }

  .timeline-content {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .timeline-container {
    padding: 0 20px;
  }

  .timeline-line,
  .timeline-progress {
    left: 40px;
  }

  .timeline-tracker {
    left: 40px;
    width: 40px;
    height: 40px;
    border-width: 4px;
  }

  .timeline-item {
    width: calc(100% - 80px);
    margin-left: 80px !important;
    margin-bottom: 60px;
  }

  .timeline-node {
    left: -60px !important;
    width: 20px;
    height: 20px;
  }

  .timeline-connector {
    left: -40px !important;
    width: 40px;
  }

  .timeline-content {
    padding: 28px;
    border-radius: 20px;
  }

  .timeline-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 576px) {
  .pp-trending-timeline {
    padding: 60px 0;
  }

  .timeline-line,
  .timeline-progress {
    left: 30px;
  }

  .timeline-tracker {
    left: 30px;
    width: 36px;
    height: 36px;
  }

  .timeline-item {
    width: calc(100% - 60px);
    margin-left: 60px !important;
    margin-bottom: 50px;
  }

  .timeline-node {
    left: -46px !important;
    width: 18px;
    height: 18px;
  }

  .timeline-connector {
    left: -30px !important;
    width: 30px;
  }

  .timeline-content {
    padding: 24px;
    border-radius: 18px;
  }

  .timeline-title {
    font-size: 1.2rem;
  }

  .timeline-description {
    font-size: 1rem;
  }
}

/* Animation Classes */
.timeline-item.animate-in {
  animation: floatIn 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes floatIn {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  100% {
    opacity: 0.4;
    transform: translateY(30px) scale(1);
  }
}

.timeline-item.active.animate-in {
  animation: floatInActive 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes floatInActive {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Staggered animations */
.timeline-item {
  animation-delay: calc(var(--item-index, 0) * 0.1s);
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Loading animation for tracker */
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 0 12px rgba(99, 102, 241, 0.15),
      0 20px 60px rgba(99, 102, 241, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 0 16px rgba(99, 102, 241, 0.2),
      0 25px 80px rgba(99, 102, 241, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

.timeline-tracker.loading {
  animation: pulse-glow 2s ease-in-out infinite;
}
