:root {
  --color-primary: #ff9a8b;
  --color-secondary: #ff6b6b;
  --color-gold: #ffd700;
  --color-gold-glow: #ffa500;
  --color-accent: #b4e4ff;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: 1px solid rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --backdrop-blur: blur(12px);
  --font-base: "Quicksand", "Nunito", -apple-system, sans-serif;
  --radius-lg: 24px;
  --timeline-line-gold: linear-gradient(
    180deg,
    transparent 0%,
    var(--color-gold) 10%,
    var(--color-gold-glow) 50%,
    var(--color-gold) 90%,
    transparent 100%
  );
  --milestone-color: #ffd700;
  --first-meet-color: #ff69b4;
  --adventure-color: #4facfe;
  --achievement-color: #00f260;
  --special-color: #c9a0dc;
  --default-border: #c9a0dc;
}

body {
  font-family: var(--font-base);
  background: #2d1b3e;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(
    180deg,
    #2d1b3e 0%,
    #4a2b5e 40%,
    #ff9a8b 85%,
    #1a1a2e 100%
  );
}

#canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: auto;
  display: block;
}

#main-content {
  padding-top: 80px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.memories-hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  position: relative;
  color: #fff;
}

.memories-hero h1 {
  font-size: 3.5rem;
  color: #ffd700;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.5);
  margin-bottom: 0.5rem;
}

.memories-hero p {
  font-size: 1.2rem;
  color: #ffc3a0;
  opacity: 0.9;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.timeline-container {
  max-width: 1000px;
  margin: 2rem auto 4rem;
  padding: 2rem 1rem;
  position: relative;
}

.timeline-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--timeline-line-gold);
  border-radius: 2px;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 165, 0, 0.4);
  -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

.timeline-line::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 150px;
  background: repeating-linear-gradient(
    to bottom,
    var(--color-gold) 0,
    var(--color-gold) 10px,
    transparent 10px,
    transparent 20px
  );
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: #fff;
  border: 4px solid var(--color-gold);
  border-radius: 50%;
  top: 1.5rem;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
  transition: all 0.3s ease;
  z-index: 2;
}

.timeline-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #ffc3a0;
  display: none;
}

.timeline-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.memory-item {
  display: flex;
  margin-bottom: 4rem;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.memory-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.memory-item:hover .timeline-dot {
  transform: translateX(-50%) scale(1.4);
  box-shadow: 0 0 25px rgba(255, 215, 0, 1);
}

.memory-item.left {
  justify-content: flex-end;
  text-align: right;
}

.memory-item.left .memory-content {
  margin-right: 3rem;
}

.memory-item.right {
  justify-content: flex-start;
  text-align: left;
}

.memory-item.right .memory-content {
  margin-left: 3rem;
}

.memory-content {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--glass-shadow);
  max-width: 450px;
  position: relative;
  border-left: 4px solid var(--default-border);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.memory-content:hover {
  transform: translateY(-8px) scale(1.02);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 215, 0, 0.2);
  z-index: 10;
}

.memory-title {
  font-size: 1.4rem;
  color: #2d1b3e;
  margin-bottom: 0.8rem;
  font-weight: 800;
}

.memory-description {
  font-size: 1rem;
  color: #4a2b5e;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-weight: 500;
}

.memory-date {
  display: inline-block;
  background: linear-gradient(135deg, #ffb3d9, #e0bbe4);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.memory-emoji {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.memory-category {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.5rem;
  background: var(--special-color);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.image-wrapper {
  overflow: hidden;
  border-radius: 8px;
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.memory-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.5s ease;
  display: block;
}

.memory-image:hover {
  transform: scale(1.1);
}

.memory-content.first-meet {
  border-left-color: var(--first-meet-color);
}
.memory-content.first-meet .memory-category {
  background: var(--first-meet-color);
}

.memory-content.adventure {
  border-left-color: var(--adventure-color);
}
.memory-content.adventure .memory-category {
  background: var(--adventure-color);
}

.memory-content.achievement {
  border-left-color: var(--achievement-color);
}
.memory-content.achievement .memory-category {
  background: var(--achievement-color);
}

.memory-content.milestone {
  border-left-color: var(--milestone-color);
}
.memory-content.milestone .memory-category {
  background: var(--milestone-color);
  color: #333;
  text-shadow: none;
}
.memory-content.milestone .memory-date {
  background: linear-gradient(135deg, #ffd700, #ffa500);
  color: #333;
  animation: pulse 2s ease-in-out infinite;
}
.memory-item.milestone .timeline-dot {
  width: 30px;
  height: 30px;
  background: var(--milestone-color);
  border-color: #fff;
  animation: glow 2s ease-in-out infinite;
}

.audio-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: #ffc3a0;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.audio-toggle:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.audio-toggle.playing {
  background: rgba(30, 10, 40, 0.6);
  border: 1px solid rgba(255, 179, 217, 0.6);
  color: #ffb3d9;
  animation: cricketChirp 3s infinite ease-in-out;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 215, 0, 1);
  }
}

@keyframes cricketChirp {
  0% { transform: scale(1) rotate(0deg); }
  5% { transform: scale(1.15) rotate(10deg); }
  10% { transform: scale(1.15) rotate(-10deg); }
  15% { transform: scale(1.15) rotate(5deg); }
  20% { transform: scale(1) rotate(0deg); }
  0%, 40% { box-shadow: 0 0 10px rgba(201, 160, 220, 0.2); }
  20% { box-shadow: 0 0 25px rgba(255, 179, 217, 0.6), inset 0 0 10px rgba(255, 179, 217, 0.2); }
  100% { box-shadow: 0 0 10px rgba(201, 160, 220, 0.2); }
}

@media (max-width: 768px) {
  .memories-hero h1 {
    font-size: 2.5rem;
  }
  .timeline-line {
    left: 30px;
  }
  .timeline-dot {
    left: 30px;
  }
  .memory-item.left,
  .memory-item.right {
    justify-content: flex-start;
    text-align: left;
  }
  .memory-item.left .memory-content,
  .memory-item.right .memory-content {
    margin-left: 3rem;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .memories-hero h1 {
    font-size: 2rem;
  }
  .memories-hero p {
    font-size: 1rem;
  }
  .timeline-line {
    left: 20px;
  }
  .timeline-dot {
    left: 20px;
  }
  .memory-item.left .memory-content,
  .memory-item.right .memory-content {
    margin-left: 2rem;
  }
  .memory-content {
    padding: 1rem;
  }
  .memory-image {
    height: 150px;
  }
}

@media (min-width: 769px) {
  .progress-bar .bar {
    background: linear-gradient(
      180deg, 
      #FFF0F5 0%,
      #FFD1DC 50%,
      #FFB7C5 100%
    );
    box-shadow: 0 0 15px rgba(255, 183, 197, 0.8);
  }
}