/* Custom Variables */
:root {
  --primary-green: #10b981;
  --light-green: #34d399;
  --dark-bg: #ffffff;
  --glass-bg: rgba(16, 185, 129, 0.05);
  --glass-border: rgba(16, 185, 129, 0.15);
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f9fafb;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--primary-green), var(--light-green));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #059669, #10b981);
}

/* Text Gradient */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-green), var(--light-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glass Effect */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

/* Timeline Styles */
.timeline-container {
  max-width: 1200px;
  margin: 0 auto;
}

.timeline-item {
  position: relative;
  margin-bottom: 4rem;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.animate {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:nth-child(odd) {
  padding-right: 50%;
  text-align: right;
}

.timeline-item:nth-child(even) {
  padding-left: 50%;
  text-align: left;
  margin-left: auto;
}

.timeline-item:nth-child(odd) .timeline-content {
  margin-right: 2rem;
}

.timeline-item:nth-child(even) .timeline-content {
  margin-left: 2rem;
}

.timeline-content {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.1);
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(16, 185, 129, 0.15);
  border-color: var(--primary-green);
}

/* Special styling for closing section */
.timeline-closing .timeline-content {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(52, 211, 153, 0.05));
  border: 2px solid var(--primary-green);
}

.timeline-closing .timeline-year {
  background: linear-gradient(135deg, var(--primary-green), var(--light-green));
  animation: pulse 2s infinite;
}

/* Auto Play Active State */
.timeline-item.auto-play-active .timeline-content {
  border: 2px solid var(--primary-green);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
  transform: translateY(-8px) scale(1.02);
}

.timeline-item.auto-play-active .timeline-year {
  animation: autoPlayPulse 2s infinite;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.timeline-item.auto-play-active .timeline-dot {
  animation: autoPlayPulse 2s infinite;
  border-color: var(--light-green);
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.6);
}

.timeline-year {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary-green), var(--light-green));
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
  min-width: 120px;
  text-align: center;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: white;
  border: 4px solid var(--primary-green);
  border-radius: 50%;
  z-index: 5;
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
  scale: 1.3;
  border-color: var(--light-green);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.5);
}

/* Timeline Arrow */
.timeline-item:nth-child(odd) .timeline-content::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -15px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid var(--glass-bg);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.timeline-item:nth-child(even) .timeline-content::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -15px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-right: 15px solid var(--glass-bg);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

/* Image Gallery Styles */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.gallery-image {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.gallery-image:hover {
  transform: scale(1.05);
  border-color: var(--primary-green);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}

/* Audio Controls */
.audio-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.05);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-green), var(--light-green));
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

/* Loading Animation */
.loading-dots {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.loading-dots div {
  position: absolute;
  top: 33px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--primary-green);
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-dots div:nth-child(1) {
  left: 8px;
  animation: loading1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
  left: 8px;
  animation: loading2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
  left: 32px;
  animation: loading2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
  left: 56px;
  animation: loading3 0.6s infinite;
}

@keyframes loading1 {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

@keyframes loading3 {
  0% { transform: scale(1); }
  100% { transform: scale(0); }
}

@keyframes loading2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(24px, 0); }
}

@keyframes pulse {
  0%, 100% { 
      transform: translateX(-50%) scale(1);
      opacity: 1;
  }
  50% { 
      transform: translateX(-50%) scale(1.05);
      opacity: 0.9;
  }
}

/* Mode Controls Styling */
.mode-btn {
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.02);
}

#welcome-audio-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

/* Auto Play Indicator */
.auto-play-active {
  animation: autoPlayPulse 2s infinite;
}

@keyframes autoPlayPulse {
  0%, 100% { 
      box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% { 
      box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
      padding-left: 3rem;
      padding-right: 1rem;
      text-align: left;
  }
  
  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
      margin-left: 0;
      margin-right: 0;
  }
  
  .timeline-year {
      left: 1.5rem;
      transform: none;
      font-size: 0.9rem;
      padding: 0.5rem 1rem;
      min-width: 100px;
  }
  
  .timeline-dot {
      left: 1.5rem;
      transform: translateX(-50%);
  }
  
  .timeline-line {
      left: 1.5rem;
  }
  
  .timeline-content::after {
      display: none;
  }
  
  .image-gallery {
      grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
      gap: 0.4rem;
  }
}

@media (max-width: 480px) {
  .timeline-content {
      padding: 1.5rem;
      border-radius: 15px;
  }
  
  .timeline-year {
      font-size: 0.8rem;
      padding: 0.4rem 0.8rem;
      min-width: 80px;
  }
  
  .image-gallery {
      grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
      gap: 0.3rem;
  }
}

/* Smooth Animations */
@media (prefers-reduced-motion: reduce) {
  * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
  }
}