/* ====== Education Section ====== */
#education {
  background: linear-gradient(135deg, #0a1828 0%, #101820 50%, #16222a 100%);
  padding: 6rem 0 5rem 0;
  position: relative;
  overflow: hidden;
}

/* Advanced Background Effects */
#education::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 25% 25%,
      rgba(127, 255, 166, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 75% 75%,
      rgba(46, 204, 64, 0.06) 0%,
      transparent 50%
    ),
    linear-gradient(
      45deg,
      transparent 40%,
      rgba(127, 255, 166, 0.02) 50%,
      transparent 60%
    );
  animation: sectionAura 15s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes sectionAura {
  0% {
    opacity: 0.4;
  }
  100% {
    opacity: 0.8;
  }
}

.education-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.education-container h2 {
  color: #7fffa6;
  text-align: center;
  font-size: 3.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(127, 255, 166, 0.5);
  animation: titleGlow 3s ease-in-out infinite alternate;
  position: relative;
}

.education-container h2::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, transparent, #7fffa6, transparent);
  border-radius: 2px;
  animation: underlineGlow 2s ease-in-out infinite alternate;
}

@keyframes underlineGlow {
  0% {
    box-shadow: 0 0 5px rgba(127, 255, 166, 0.5);
  }
  100% {
    box-shadow: 0 0 20px rgba(127, 255, 166, 0.8);
  }
}

/* Enhanced Timeline */
.timeline {
  position: relative;
  margin: 0 auto;
  padding: 2rem 0;
  max-width: 800px;
}

/* Central Timeline Line */
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    #7fffa6 10%,
    #2ecc40 50%,
    #7fffa6 90%,
    transparent 100%
  );
  transform: translateX(-50%);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(127, 255, 166, 0.5);
  animation: timelinePulse 3s ease-in-out infinite;
}

@keyframes timelinePulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(127, 255, 166, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(127, 255, 166, 0.8);
  }
}

.timeline-item {
  margin-bottom: 4rem;
  position: relative;
  opacity: 0;
  animation: slideInTimeline 0.8s ease-out forwards;
}

.timeline-item:nth-child(1) {
  animation-delay: 0.2s;
}
.timeline-item:nth-child(2) {
  animation-delay: 0.4s;
}
.timeline-item:nth-child(3) {
  animation-delay: 0.6s;
}
.timeline-item:nth-child(4) {
  animation-delay: 0.8s;
}

@keyframes slideInTimeline {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Alternating Layout */
.timeline-item:nth-child(odd) {
  text-align: right;
  padding-right: calc(50% + 2rem);
}

.timeline-item:nth-child(even) {
  text-align: left;
  padding-left: calc(50% + 2rem);
}

/* Timeline Year Badges */
.timeline-year {
  display: inline-block;
  font-weight: bold;
  color: #101820;
  background: linear-gradient(135deg, #7fffa6 0%, #2ecc40 100%);
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(127, 255, 166, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.timeline-year::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.timeline-item:hover .timeline-year {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(127, 255, 166, 0.5);
}

.timeline-item:hover .timeline-year::before {
  left: 100%;
}

/* Timeline Content Cards */
.timeline-content {
  background: linear-gradient(
    135deg,
    rgba(26, 42, 47, 0.9) 0%,
    rgba(16, 24, 32, 0.8) 100%
  );
  padding: 2rem 2.5rem;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(127, 255, 166, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.timeline-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #7fffa6, #2ecc40, #7fffa6);
  border-radius: 2px 2px 0 0;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(127, 255, 166, 0.2);
  border-color: rgba(127, 255, 166, 0.4);
}

.timeline-content strong {
  color: #7fffa6;
  font-size: 1.4rem;
  display: block;
  margin-bottom: 0.8rem;
  text-shadow: 0 0 10px rgba(127, 255, 166, 0.3);
}

.timeline-content p {
  color: #e0f2e9;
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0;
  opacity: 0.9;
}

/* Timeline Icons/Dots */
.timeline-item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 1rem;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #7fffa6 0%, #2ecc40 100%);
  border-radius: 50%;
  transform: translateX(-50%);
  border: 4px solid #101820;
  box-shadow: 0 0 20px rgba(127, 255, 166, 0.6);
  z-index: 2;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover::before {
  transform: translateX(-50%) scale(1.3);
  box-shadow: 0 0 30px rgba(127, 255, 166, 0.8);
}

/* Education Icons for Each Level */
.timeline-item:nth-child(1)::after {
  content: "🎓";
}
.timeline-item:nth-child(2)::after {
  content: "📚";
}
.timeline-item:nth-child(3)::after {
  content: "🏆";
}
.timeline-item:nth-child(4)::after {
  content: "💻";
}

.timeline-item::after {
  position: absolute;
  left: 50%;
  top: 0.5rem;
  transform: translateX(-50%);
  font-size: 1.5rem;
  z-index: 3;
  filter: drop-shadow(0 0 8px rgba(127, 255, 166, 0.6));
  transition: transform 0.3s ease;
}

.timeline-item:hover::after {
  transform: translateX(-50%) scale(1.2);
}

/* Responsive Design for Education Section */
@media (max-width: 768px) {
  #education {
    padding: 4rem 0;
  }

  .education-container {
    padding: 0 1rem;
  }

  .education-container h2 {
    font-size: 2.5rem;
  }

  .timeline {
    max-width: 100%;
    padding: 1rem 0;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    margin-bottom: 3rem;
    padding-left: 3rem;
    padding-right: 0;
    text-align: left;
  }

  .timeline-item:nth-child(odd) {
    text-align: left;
    padding-right: 0;
    padding-left: 3rem;
  }

  .timeline-item:nth-child(even) {
    text-align: left;
    padding-left: 3rem;
  }

  .timeline-item::before {
    left: 20px;
    transform: translateX(-50%);
  }

  .timeline-item::after {
    left: 20px;
    transform: translateX(-50%);
  }

  .timeline-content {
    padding: 1.5rem 2rem;
  }

  .timeline-content strong {
    font-size: 1.2rem;
  }

  .timeline-content p {
    font-size: 1rem;
  }

  .timeline-year {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
  }
}
