/* Main content container with centered layout and responsive padding */
/* Force scroll on mobile for chronicle page - apply globally */
html,
body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: 100%;
  min-height: 100vh;
  position: relative;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(
    135deg,
    #0a1628 0%,
    #1a2f4a 30%,
    #0d1f35 60%,
    #162840 100%
  );
}
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
  display: block;
  visibility: visible;
}

/* Performance optimizations for timeline animations */
.timeline-arc,
.timeline-event,
.arc-content,
.event-content {
  will-change: transform, opacity, max-height;
  transform: translateZ(0); /* Force hardware acceleration */
}

/* Optimize transitions for better performance */
.arc-content,
.event-content {
  transition:
    max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease,
    padding 0.2s ease;
}

/* Reduce paint complexity on mobile */
@media (max-width: 768px) {
  .timeline-mobile-optimized .timeline-arc,
  .timeline-mobile-optimized .timeline-event {
    transform: none;
    will-change: auto;
  }
}

/* Ensure main navigation uses shared styles - no overrides */
.main-nav {
  /* Ensure proper z-index above timeline elements */
  z-index: 1000 !important;
}

/* Ensure mobile navigation also uses correct z-index */
.mobile-nav {
  z-index: 1001 !important;
}

/* Page header section with title and subtitle styling */
.page-header {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
  padding: 2rem 0;
  z-index: 10;
}

/* Enhanced timeline controls for search and filtering */
.timeline-controls {
  max-width: 900px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2.5rem;
  background: linear-gradient(
    135deg,
    rgba(30, 58, 95, 0.18),
    rgba(46, 89, 132, 0.14),
    rgba(74, 123, 167, 0.1)
  );
  border: 2px solid rgba(74, 123, 167, 0.35);
  border-radius: 24px;
  backdrop-filter: blur(30px);
  box-shadow:
    0 20px 60px rgba(10, 25, 41, 0.7),
    0 10px 30px rgba(30, 58, 95, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 40px rgba(30, 58, 95, 0.25);
  position: relative;
  overflow: hidden;
}

.timeline-controls::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    #1e3a5f,
    #2e5984,
    #4a7ba7,
    #2e5984,
    #1e3a5f
  );
  opacity: 0.85;
  animation: slimeShimmer 4s linear infinite;
  background-size: 200% 100%;
}

/* Removed gradientShift - replaced with slimeShimmer */

.timeline-controls::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(30, 58, 95, 0.08) 0%,
    rgba(46, 89, 132, 0.05) 40%,
    rgba(74, 123, 167, 0.03) 60%,
    transparent 80%
  );
  animation: controlsGlow 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes slimeGradient {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes slimePulse {
  0%,
  100% {
    box-shadow:
      0 0 18px rgba(74, 123, 167, 0.6),
      0 0 30px rgba(46, 89, 132, 0.4),
      0 0 45px rgba(30, 58, 95, 0.3);
  }
  50% {
    box-shadow:
      0 0 25px rgba(74, 123, 167, 0.8),
      0 0 45px rgba(46, 89, 132, 0.6),
      0 0 65px rgba(30, 58, 95, 0.4);
  }
}

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

@keyframes controlsGlow {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: rotate(180deg) scale(1.1);
    opacity: 0.6;
  }
}

/* Search container with input and button */
.search-container {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  color: #4a7ba7;
  font-size: 1.3rem;
  z-index: 2;
  animation: searchPulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(74, 123, 167, 0.5));
}

@keyframes searchPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

.timeline-search-input {
  width: 100%;
  padding: 1.2rem 1.2rem 1.2rem 3.5rem;
  background: linear-gradient(
    135deg,
    rgba(30, 58, 95, 0.15),
    rgba(46, 89, 132, 0.1)
  );
  border: 2px solid rgba(74, 123, 167, 0.35);
  border-radius: 16px;
  color: #c5d9e8;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 500;
  backdrop-filter: blur(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(30, 58, 95, 0.2);
}

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

.timeline-search-input:hover::before {
  left: 100%;
}

.timeline-search-input:focus {
  outline: none;
  border-color: #4a7ba7;
  box-shadow:
    0 0 22px rgba(74, 123, 167, 0.5),
    0 0 35px rgba(46, 89, 132, 0.35),
    0 8px 25px rgba(30, 58, 95, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    135deg,
    rgba(30, 58, 95, 0.2),
    rgba(46, 89, 132, 0.15)
  );
  transform: translateY(-2px);
}

.timeline-search-input::placeholder {
  color: #7a9bb8;
  opacity: 0.9;
  font-style: italic;
}

.clear-search-btn {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: #7a9bb8;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-search-btn:hover {
  color: #4a7ba7;
  background: rgba(74, 123, 167, 0.1);
}

/* Enhanced search and action buttons */
.search-btn {
  padding: 1.2rem 2rem;
  background: linear-gradient(135deg, #1e3a5f, #2e5984, #4a7ba7);
  border: none;
  border-radius: 16px;
  color: #d4e3f0;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 8px 25px rgba(30, 58, 95, 0.4),
    0 4px 15px rgba(46, 89, 132, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.search-btn::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.6s;
}

.search-btn:hover::before {
  left: 100%;
}

.search-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 12px 40px rgba(30, 58, 95, 0.6),
    0 6px 25px rgba(46, 89, 132, 0.45),
    0 0 35px rgba(74, 123, 167, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  filter: brightness(1.08);
}

.search-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* Enhanced control buttons */
.control-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.expand-all-btn,
.collapse-all-btn,
.view-btn {
  padding: 0.8rem 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(30, 58, 95, 0.18),
    rgba(46, 89, 132, 0.12)
  );
  border: 2px solid rgba(74, 123, 167, 0.4);
  border-radius: 12px;
  color: #b8d4e8;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(15px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.2);
}

.expand-all-btn:hover,
.collapse-all-btn:hover,
.view-btn:hover {
  border-color: #4a7ba7;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.35),
    rgba(46, 89, 132, 0.28)
  );
  transform: translateY(-2px);
  box-shadow:
    0 6px 20px rgba(74, 123, 167, 0.5),
    0 0 30px rgba(74, 123, 167, 0.3);
}

.view-btn.active {
  background: linear-gradient(135deg, #5a8ab8, #4a7ba7);
  border-color: #5a8ab8;
  color: #0a1628;
  box-shadow:
    0 4px 15px rgba(90, 138, 184, 0.6),
    0 0 25px rgba(90, 138, 184, 0.4);
  font-weight: 700;
}

/* Filter controls section */
.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.2),
    rgba(74, 123, 167, 0.05)
  );
  border-radius: 16px;
  border: 1px solid rgba(74, 123, 167, 0.2);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 160px;
  position: relative;
}

.filter-group::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, #4a7ba7, #5a8ab8, #5a8ab8);
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.filter-group:hover::before {
  opacity: 0.1;
}

.filter-group label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #5a8ab8;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 0 10px rgba(90, 138, 184, 0.6);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label::before {
  content: "⚡";
  font-size: 1.1rem;
  animation: labelGlow 2s ease-in-out infinite;
}

@keyframes labelGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 5px rgba(90, 138, 184, 0.6));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(90, 138, 184, 0.6));
  }
}

.filter-select {
  padding: 1rem 1.25rem;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.15),
    rgba(46, 89, 132, 0.1)
  );
  border: 2px solid rgba(74, 123, 167, 0.3);
  border-radius: 12px;
  color: #b8d4e8;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

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

.filter-select:hover::before {
  left: 100%;
}

.filter-select:focus {
  outline: none;
  border-color: #5a8ab8;
  box-shadow: 0 0 25px rgba(74, 123, 167, 0.4);
  transform: translateY(-2px);
}

.filter-select:hover {
  border-color: rgba(74, 123, 167, 0.6);
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.2),
    rgba(46, 89, 132, 0.15)
  );
  transform: translateY(-1px);
}

.filter-select option {
  background: #0a1929;
  color: #b8d4e8;
  padding: 0.75rem;
  border: none;
}

/* Main page title with gradient text and glow effects */
.page-title {
  font-family: "Cinzel", serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: #6ba3d0;
  text-shadow:
    0 0 20px rgba(107, 163, 208, 0.8),
    0 0 40px rgba(74, 123, 167, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
  animation: titleGlow 3s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.page-title::after {
  content: "📜";
  position: absolute;
  top: -15px;
  right: -50px;
  font-size: 2.5rem;
  animation: scrollFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(74, 123, 167, 0.6));
}

.page-subtitle {
  font-size: 1.3rem;
  color: #6b8caf;
  margin-bottom: 3rem;
  font-weight: 300;
  position: relative;
  z-index: 2;
}

/* Timeline container with vertical layout and central positioning */
.timeline-container {
  position: relative;
  margin: 4rem 0;
  z-index: 5;
  display: block;
  visibility: visible;
}

/* Central timeline line with gradient colors and glow effect */
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    #4a7ba7,
    #2e5984,
    #1e3a5f,
    #2e5984,
    #4a7ba7,
    #3a6a94,
    #4a7ba7
  );
  transform: translateX(-50%);
  border-radius: 3px;
  box-shadow:
    0 0 18px rgba(74, 123, 167, 0.6),
    0 0 30px rgba(46, 89, 132, 0.4),
    0 0 45px rgba(30, 58, 95, 0.3);
  z-index: 1;
  animation: slimePulse 3s ease-in-out infinite;
}

/* Individual timeline year section with fade-in animation */
.timeline-year {
  position: relative;
  margin-bottom: 6rem;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease-out;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Year marker badge with glassmorphism design */
.year-marker {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.35),
    rgba(46, 89, 132, 0.28),
    rgba(90, 138, 184, 0.15)
  );
  border: 3px solid #4a7ba7;
  border-radius: 20px;
  padding: 2rem 2.5rem;
  text-align: center;
  box-shadow:
    0 0 30px rgba(74, 123, 167, 0.8),
    0 0 50px rgba(46, 89, 132, 0.5),
    0 10px 40px rgba(74, 123, 167, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 2;
  margin-bottom: 3rem;
  width: 100%;
  max-width: calc(100vw - 4rem);
  backdrop-filter: blur(25px);
  position: relative;
  overflow: visible;
  word-wrap: break-word;
  box-sizing: border-box;
}

.year-marker:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow:
    0 0 40px rgba(74, 123, 167, 1),
    0 0 70px rgba(46, 89, 132, 0.7),
    0 15px 50px rgba(74, 123, 167, 0.6);
  border-color: #5a8ab8;
}

.year-number {
  font-family: "Cinzel", serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4a7ba7, #2e5984, #5a8ab8, #4a7ba7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  filter: drop-shadow(0 0 20px rgba(74, 123, 167, 1));
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  word-wrap: break-word;
  overflow: visible;
  white-space: nowrap;
  animation: slimeGradient 3s linear infinite;
}

.year-label {
  font-size: 1rem;
  color: #5a8ab8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
  text-shadow:
    0 0 10px rgba(90, 138, 184, 0.9),
    0 0 20px rgba(90, 138, 184, 0.5);
  word-wrap: break-word;
  overflow: visible;
  white-space: nowrap;
}

/* Enhanced timeline arc container for grouping related events */
.timeline-arc {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.28),
    rgba(46, 89, 132, 0.22),
    rgba(90, 138, 184, 0.12)
  );
  border: 2px solid rgba(74, 123, 167, 0.6);
  border-radius: 24px;
  margin-bottom: 3.5rem;
  overflow: hidden;
  backdrop-filter: blur(30px);
  box-shadow:
    0 20px 60px rgba(74, 123, 167, 0.5),
    0 10px 30px rgba(46, 89, 132, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(74, 123, 167, 0.3);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 100%;
  max-width: calc(100vw - 4rem);
  box-sizing: border-box;
}

.timeline-arc::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4a7ba7, #5a8ab8, #5a8ab8);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.timeline-arc:hover::before {
  opacity: 1;
}

.timeline-arc:hover {
  border-color: #4a7ba7;
  box-shadow:
    0 25px 80px rgba(74, 123, 167, 0.7),
    0 15px 40px rgba(46, 89, 132, 0.5),
    0 0 60px rgba(74, 123, 167, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 1px rgba(74, 123, 167, 0.4);
  transform: translateY(-8px) scale(1.01);
}

.timeline-arc.expanded {
  border-color: #5a8ab8;
  box-shadow:
    0 30px 90px rgba(74, 123, 167, 0.7),
    0 20px 50px rgba(90, 138, 184, 0.5),
    0 0 70px rgba(74, 123, 167, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 1px rgba(90, 138, 184, 0.4);
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.35),
    rgba(46, 89, 132, 0.28),
    rgba(90, 138, 184, 0.18)
  );
}

/* Enhanced arc header with click interaction and expand/collapse functionality */
.arc-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem 3rem;
  cursor: pointer !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.18),
    rgba(46, 89, 132, 0.12),
    rgba(90, 138, 184, 0.08)
  );
  position: relative;
  overflow: hidden;
  pointer-events: auto !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  z-index: 10 !important;
  border: 2px solid rgba(74, 123, 167, 0.4);
  border-radius: 12px;
  margin-bottom: 3px;
  min-height: 70px;
}

/* Enhanced shimmer effect for arc header hover state */
.arc-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    rgba(74, 123, 167, 0.1),
    transparent
  );
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced click hint tooltip for arc headers */
.arc-header::after {
  content: "👆 Click to expand";
  position: absolute;
  top: 8px;
  right: 15px;
  font-size: 11px;
  color: rgba(74, 123, 167, 0.8);
  opacity: 0;
  transition: all 0.4s ease;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.3),
    rgba(46, 89, 132, 0.2)
  );
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 20;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(74, 123, 167, 0.3);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.arc-header:hover {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.28),
    rgba(46, 89, 132, 0.22),
    rgba(90, 138, 184, 0.15)
  );
  border-color: rgba(74, 123, 167, 0.7);
  transform: translateY(-3px);
  box-shadow:
    0 12px 35px rgba(74, 123, 167, 0.6),
    0 6px 20px rgba(46, 89, 132, 0.4),
    0 0 40px rgba(74, 123, 167, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.arc-header:hover::before {
  left: 100%;
}

.arc-header:hover::after {
  opacity: 1;
  transform: translateY(-2px);
}

.arc-header:active {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.35),
    rgba(74, 123, 167, 0.2),
    rgba(90, 138, 184, 0.1)
  );
  transform: translateY(-1px);
  border-color: rgba(74, 123, 167, 0.8);
}

.arc-header:focus {
  outline: 3px solid rgba(74, 123, 167, 0.7);
  outline-offset: 3px;
}

.arc-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 20px rgba(74, 123, 167, 0.6));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.arc-header:hover .arc-icon {
  transform: scale(1.15) rotate(8deg);
  filter: drop-shadow(0 0 30px rgba(74, 123, 167, 0.6));
}

.arc-title {
  font-family: "Cinzel", serif;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4a7ba7, #2e5984, #5a8ab8, #4a7ba7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  filter: drop-shadow(0 2px 8px rgba(74, 123, 167, 0.8));
  flex: 1;
  word-wrap: break-word;
  overflow: visible;
  white-space: normal;
  line-height: 1.3;
  position: relative;
  animation: slimeGradient 3s linear infinite;
}

.arc-toggle {
  font-size: 1.8rem;
  color: #5a8ab8;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 12px rgba(90, 138, 184, 0.9));
  pointer-events: none;
  user-select: none;
  font-weight: bold;
}

.timeline-arc.expanded .arc-toggle {
  transform: rotate(180deg) scale(1.1);
  color: #4a7ba7;
  filter: drop-shadow(0 0 18px rgba(74, 123, 167, 1));
}

.timeline-arc.expanded .arc-header::after {
  content: "👆 Click to collapse";
}

/* Collapsible content area for timeline arcs */
.arc-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  display: block;
  visibility: visible;
}

.timeline-arc.expanded .arc-content {
  max-height: 5000px;
  overflow: visible;
  opacity: 1;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease 0.1s;
}

.arc-content.force-expanded {
  max-height: 5000px !important;
  opacity: 1 !important;
  overflow: visible !important;
}

.arc-content.force-collapsed {
  max-height: 0px !important;
  opacity: 0 !important;
  overflow: hidden !important;
}

/* Enhanced individual timeline event with expandable content */
.timeline-event {
  border-top: 1px solid rgba(74, 123, 167, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.1),
    rgba(74, 123, 167, 0.02)
  );
}

.timeline-event::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(74, 123, 167, 0.12),
    rgba(90, 138, 184, 0.08),
    transparent
  );
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.timeline-event:hover {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.08),
    rgba(46, 89, 132, 0.05)
  );
  border-color: rgba(74, 123, 167, 0.3);
  transform: translateX(5px);
}

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

.timeline-event.expanded {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.12),
    rgba(46, 89, 132, 0.08)
  );
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(74, 123, 167, 0.3);
  box-shadow: 0 8px 25px rgba(74, 123, 167, 0.2);
}

/* Enhanced event header with icon, title, and date information */
.event-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem 2.5rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

.event-header::after {
  content: "";
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5a8ab8;
  opacity: 0;
  transition: all 0.4s ease;
  box-shadow: 0 0 15px currentColor;
}

.timeline-event[data-importance="high"] .event-header::after {
  opacity: 1;
  background: #4a7ba7;
  box-shadow: 0 0 15px #4a7ba7;
  animation: importancePulse 2s ease-in-out infinite;
}

.timeline-event[data-importance="medium"] .event-header::after {
  opacity: 1;
  background: #5a8ab8;
  box-shadow: 0 0 12px #5a8ab8;
  animation: importancePulse 3s ease-in-out infinite;
}

.timeline-event[data-importance="low"] .event-header::after {
  opacity: 0.8;
  background: #4a7ba7;
  box-shadow: 0 0 8px #4a7ba7;
}

@keyframes importancePulse {
  0%,
  100% {
    transform: translateY(-50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-50%) scale(1.2);
    opacity: 1;
  }
}

.event-header:hover {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.12),
    rgba(46, 89, 132, 0.08)
  );
  border-radius: 8px;
}

.event-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5a8ab8, #4a7ba7, #4a7ba7);
  border-radius: 50%;
  box-shadow:
    0 6px 20px rgba(90, 138, 184, 0.6),
    0 3px 10px rgba(74, 123, 167, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.event-icon::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.event-header:hover .event-icon::before {
  opacity: 1;
}

.event-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #b8d4e8;
  flex: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  line-height: 1.3;
}

.event-date {
  font-size: 0.95rem;
  color: #7a9bb8;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.2),
    rgba(46, 89, 132, 0.15)
  );
  padding: 0.4rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(74, 123, 167, 0.4);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(74, 123, 167, 0.2);
}

.event-expand-hint {
  font-size: 0.85rem;
  color: #5a8ab8;
  opacity: 0.8;
  font-style: italic;
  transition: all 0.4s ease;
  white-space: nowrap;
  pointer-events: none;
  margin-left: 1.5rem;
  font-weight: 500;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 8px rgba(90, 138, 184, 0.5);
}

.timeline-event.expanded .event-expand-hint::after {
  content: "Click to collapse";
}

.event-header:hover .event-expand-hint {
  opacity: 1;
  color: #4a7ba7;
  transform: translateX(-5px);
  text-shadow: 0 0 10px rgba(74, 123, 167, 0.8);
}

/* Expandable event content with detailed information */
.event-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0.21);
  padding: 0 2rem;
  opacity: 0;
}

.timeline-event.expanded .event-content {
  max-height: none;
  overflow: visible;
  padding: 0 2rem 2rem 2rem;
  opacity: 1;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0.21),
    opacity 0.3s ease 0.1s;
}

/* Event description with highlighted styling */
.event-description {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #b8d4e8;
  margin-bottom: 2rem;
  padding: 2rem;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.2),
    rgba(46, 89, 132, 0.15)
  );
  border-left: 4px solid #4a7ba7;
  border-radius: 0 12px 12px 0;
  box-shadow:
    0 4px 15px rgba(74, 123, 167, 0.3),
    0 0 30px rgba(74, 123, 167, 0.1);
  min-height: 60px;
  backdrop-filter: blur(20px);
}

/* Event consequences and characters sections */
.event-consequences,
.event-characters {
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(74, 123, 167, 0.12);
  border-radius: 8px;
  border: 1px solid rgba(74, 123, 167, 0.3);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 15px rgba(74, 123, 167, 0.15);
}

.event-consequences h4,
.event-characters h4 {
  color: #5a8ab8;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow:
    0 0 10px rgba(90, 138, 184, 0.8),
    0 0 20px rgba(90, 138, 184, 0.4);
}

.event-consequences h4::before {
  content: "⚡";
  font-size: 1.2rem;
}

.event-characters h4::before {
  content: "👥";
  font-size: 1.2rem;
}

.event-consequences ul {
  list-style: none;
  padding-left: 0;
}

.event-consequences li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: #b8d4e8;
  line-height: 1.6;
  font-size: 0.95rem;
}

.event-consequences li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #4a7ba7;
  font-weight: bold;
  filter: drop-shadow(0 0 5px rgba(74, 123, 167, 0.6));
}

.character-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.character-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(
    135deg,
    rgba(30, 58, 95, 0.22),
    rgba(46, 89, 132, 0.16)
  );
  border: 1px solid rgba(74, 123, 167, 0.35);
  border-radius: 25px;
  color: #b8d4e8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
}

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

.character-link:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 20px rgba(74, 123, 167, 0.5),
    0 0 30px rgba(74, 123, 167, 0.3);
  border-color: #4a7ba7;
  color: #4a7ba7;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.3),
    rgba(46, 89, 132, 0.25)
  );
}

.character-link:hover::before {
  left: 100%;
}

.character-link img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(74, 123, 167, 0.5);
  box-shadow: 0 0 8px rgba(74, 123, 167, 0.3);
}

/* Timeline statistics grid showing event counts and metrics */
.timeline-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(74, 123, 167, 0.2);
}

/* Individual statistic card with icon and value */
.stat-card {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.25),
    rgba(46, 89, 132, 0.2)
  );
  border: 1px solid rgba(74, 123, 167, 0.2);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #4a7ba7, #5a8ab8);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(74, 123, 167, 0.2);
  border-color: #4a7ba7;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(74, 123, 167, 0.6));
}

.stat-value {
  font-family: "Cinzel", serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #4a7ba7;
  text-shadow: 0 0 15px rgba(74, 123, 167, 0.6);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1rem;
  color: #7a9bb8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Character tooltip for hover information */
.character-tooltip {
  position: absolute;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.35),
    rgba(46, 89, 132, 0.3)
  );
  border: 2px solid #4a7ba7;
  border-radius: 12px;
  padding: 1rem;
  color: #b8d4e8;
  font-size: 0.9rem;
  z-index: 1000;
  pointer-events: none;
  backdrop-filter: blur(25px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  animation: tooltipFadeIn 0.3s ease-out;
  max-width: 200px;
}

.tooltip-name {
  font-weight: 600;
  color: #4a7ba7;
  margin-bottom: 0.25rem;
  text-shadow: 0 0 10px rgba(74, 123, 167, 0.6);
}

.tooltip-hint {
  font-size: 0.8rem;
  color: #7a9bb8;
  opacity: 0.8;
}

/* Timeline progress bar at top of page */
.timeline-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(74, 123, 167, 0.25);
  z-index: 1000;
  backdrop-filter: blur(15px);
}

/* Enhanced floating action buttons */
.timeline-fab-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
}

.timeline-fab {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #4a7ba7, #5a8ab8);
  border: none;
  border-radius: 50%;
  color: #0a1929;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(74, 123, 167, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.timeline-fab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timeline-fab:hover::before {
  opacity: 1;
}

.timeline-fab:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 35px rgba(74, 123, 167, 0.6);
}

.timeline-fab-help {
  background: linear-gradient(135deg, #5a8ab8, #4a7ba7);
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
}

.timeline-fab-help:hover {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 12px 35px rgba(90, 138, 184, 0.6);
}

.timeline-fab.hidden {
  transform: translateY(100px);
  opacity: 0;
}

/* Enhanced notification system */
.timeline-notification {
  position: fixed;
  top: 100px;
  right: 2rem;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.95),
    rgba(46, 89, 132, 0.9)
  );
  border: 2px solid rgba(74, 123, 167, 0.6);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  color: #0a1929;
  font-weight: 600;
  z-index: 10000;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 25px rgba(74, 123, 167, 0.4);
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.timeline-notification--success {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.95),
    rgba(46, 89, 132, 0.9)
  );
  border-color: rgba(74, 123, 167, 0.6);
  box-shadow: 0 8px 25px rgba(74, 123, 167, 0.4);
}

.timeline-notification--info {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.95),
    rgba(46, 89, 132, 0.9)
  );
  border-color: rgba(74, 123, 167, 0.6);
  box-shadow: 0 8px 25px rgba(74, 123, 167, 0.4);
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.notification-content i {
  font-size: 1.2rem;
}

/* Enhanced scroll animations */
.timeline-year,
.timeline-arc {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-year.animate-in,
.timeline-arc.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays */
.timeline-year:nth-child(1) {
  transition-delay: 0.1s;
}
.timeline-year:nth-child(2) {
  transition-delay: 0.2s;
}
.timeline-year:nth-child(3) {
  transition-delay: 0.3s;
}
.timeline-year:nth-child(4) {
  transition-delay: 0.4s;
}
.timeline-year:nth-child(5) {
  transition-delay: 0.5s;
}

/* Enhanced keyboard shortcut hints */
.keyboard-hints {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.9),
    rgba(74, 123, 167, 0.1)
  );
  border: 1px solid rgba(74, 123, 167, 0.3);
  border-radius: 12px;
  padding: 1rem;
  color: #b8d4e8;
  font-size: 0.8rem;
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.keyboard-hints.show {
  opacity: 1;
  transform: translateY(0);
}

.keyboard-hints h4 {
  margin: 0 0 0.5rem 0;
  color: #5a8ab8;
  font-size: 0.9rem;
}

.keyboard-hints ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.keyboard-hints li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.keyboard-hints kbd {
  background: rgba(74, 123, 167, 0.2);
  border: 1px solid rgba(74, 123, 167, 0.3);
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  font-size: 0.7rem;
  color: #5a8ab8;
}
@keyframes scrollFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(74, 123, 167, 0.6);
  }
  50% {
    box-shadow: 0 0 40px rgba(74, 123, 167, 0.6);
  }
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

@keyframes arcExpand {
  from {
    transform: scale(0.98);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
  }
  to {
    transform: scale(1);
    box-shadow: 0 25px 70px rgba(74, 123, 167, 0.4);
  }
}

@keyframes arcCollapse {
  from {
    transform: scale(1);
    box-shadow: 0 25px 70px rgba(74, 123, 167, 0.4);
  }
  to {
    transform: scale(0.98);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered entrance animations for timeline elements */
.timeline-year:nth-child(odd) .timeline-arc {
  animation: slideInFromLeft 0.8s ease-out;
}

.timeline-year:nth-child(even) .timeline-arc {
  animation: slideInFromRight 0.8s ease-out;
}

.timeline-year.visible {
  animation: fadeInUp 0.6s ease-out;
}

.timeline-event:hover .event-icon {
  animation: pulseGlow 2s ease-in-out infinite;
  transform: scale(1.1);
}

.timeline-arc.expanding {
  animation: arcExpand 0.6s cubic-bezier(0.4, 0.21);
}

.timeline-arc.collapsing {
  animation: arcCollapse 0.4s cubic-bezier(0.4, 0.21);
}

/* Accessibility focus states for interactive elements */
.timeline-event:focus {
  outline: 2px solid #4a7ba7;
  outline-offset: 2px;
}

/* Layout fixes and positioning overrides for timeline elements */
.year-marker {
  position: relative !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin: 0 auto 2rem auto !important;
  display: block !important;
  width: 100% !important;
  max-width: calc(100vw - 4rem) !important;
  box-sizing: border-box !important;
}

.timeline-line {
  left: 50% !important;
  transform: translateX(-50%) !important;
}

.timeline-arc {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: calc(100vw - 4rem) !important;
  box-sizing: border-box !important;
}

/* Visibility and display overrides for timeline components */
.timeline-container,
.timeline-year,
.timeline-arc,
.timeline-event {
  display: block !important;
  visibility: visible !important;
}

.timeline-year {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.timeline-line {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.year-marker {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.timeline-year *,
.timeline-arc *,
.timeline-event * {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.year-marker,
.arc-header,
.event-header {
  overflow: visible !important;
}

/* Text rendering optimizations for better typography */
.year-number,
.year-label,
.arc-title,
.event-title {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.arc-toggle {
  transition: transform 0.3s ease;
  pointer-events: none;
  user-select: none;
  font-size: 1.5rem;
  color: #5a8ab8;
  filter: drop-shadow(0 0 10px rgba(90, 138, 184, 0.6));
}

.timeline-arc.expanded .arc-toggle {
  transform: rotate(180deg);
  color: #4a7ba7;
  filter: drop-shadow(0 0 15px rgba(74, 123, 167, 0.6));
}

.timeline-arc .arc-content.force-expanded {
  max-height: 5000px !important;
  opacity: 1 !important;
  overflow: visible !important;
  display: block !important;
  visibility: visible !important;
  transition:
    max-height 0.6s cubic-bezier(0.4, 0.21),
    opacity 0.3s ease 0.2s !important;
}

.timeline-arc .arc-content.force-collapsed {
  max-height: 0px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  transition:
    max-height 0.6s cubic-bezier(0.4, 0.21),
    opacity 0.3s ease 0.1s !important;
}

.timeline-progress-bar {
  transition: width 0.1s ease-out;
}

.timeline-arc.expanded {
  box-shadow: 0 20px 60px rgba(74, 123, 167, 0.3);
  border-color: #4a7ba7;
}

.timeline-event.expanded {
  background: rgba(74, 123, 167, 0.05);
  border-radius: 8px;
  margin: 0.5rem 0;
}

.timeline-container.compact-view .event-description {
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 1rem;
  margin-bottom: 1rem;
}

.timeline-container.compact-view .event-consequences,
.timeline-container.compact-view .event-characters {
  margin-bottom: 1rem;
  padding: 0.8rem;
}

.timeline-container.compact-view .event-consequences h4,
.timeline-container.compact-view .event-characters h4 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.timeline-container.compact-view .event-consequences li {
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.timeline-container.compact-view .character-link {
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
}

.timeline-container.compact-view .character-link img {
  width: 20px;
  height: 20px;
}

.timeline-container.compact-view .arc-header {
  padding: 1.5rem 2rem;
}

.timeline-container.compact-view .arc-title {
  font-size: 1.5rem;
}

.timeline-container.compact-view .event-header {
  padding: 1rem 1.5rem;
}

.timeline-container.compact-view .event-title {
  font-size: 1rem;
}

.timeline-container.compact-view .year-marker {
  padding: 1rem 2rem;
}

.timeline-container.compact-view .year-number {
  font-size: 2rem;
}

/* Loading state with spinner animation */
.timeline-loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 2rem;
  color: #7a9bb8;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.05),
    rgba(74, 123, 167, 0.02)
  );
  border-radius: 20px;
  margin: 2rem 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Error state styling for timeline failures */
.timeline-error {
  text-align: center;
  padding: 4rem 2rem;
  color: #4a7ba7;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.1),
    rgba(74, 123, 167, 0.05)
  );
  border: 2px solid rgba(74, 123, 167, 0.2);
  border-radius: 20px;
  margin: 2rem 0;
}

.timeline-error-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.timeline-error-text {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-error-hint {
  font-size: 1rem;
  opacity: 0.8;
}

/* Performance optimizations using CSS containment */
.timeline-year,
.timeline-arc,
.timeline-event {
  contain: layout style;
}

.timeline-year.visible {
  will-change: transform, opacity;
}

.timeline-year:not(.visible) {
  will-change: auto;
}

.arc-content {
  contain: layout;
}

.timeline-arc.expanded .arc-content {
  contain: none;
}

@keyframes blueGlow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(74, 123, 167, 0.6);
  }
  50% {
    box-shadow:
      0 0 30px rgba(74, 123, 167, 0.6),
      0 0 40px rgba(74, 123, 167, 0.3);
  }
}

/* Search highlighting and visual enhancements */
.search-highlight {
  background: linear-gradient(
    135deg,
    rgba(90, 138, 184, 0.4),
    rgba(90, 138, 184, 0.2)
  );
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-weight: 600;
  color: #0a1929;
  box-shadow: 0 1px 3px rgba(90, 138, 184, 0.3);
  animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%,
  100% {
    background: linear-gradient(
      135deg,
      rgba(90, 138, 184, 0.4),
      rgba(90, 138, 184, 0.2)
    );
  }
  50% {
    background: linear-gradient(
      135deg,
      rgba(90, 138, 184, 0.6),
      rgba(90, 138, 184, 0.4)
    );
  }
}

/* Enhanced no-results state */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: #7a9bb8;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.08),
    rgba(74, 123, 167, 0.04)
  );
  border: 2px solid rgba(74, 123, 167, 0.15);
  border-radius: 20px;
  margin: 3rem 0;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.no-results::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(74, 123, 167, 0.1),
    transparent
  );
  animation: shimmer 3s ease-in-out infinite;
}

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

.no-results-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.6;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.no-results-text {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #b8d4e8;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.no-results-hint {
  font-size: 1rem;
  opacity: 0.8;
  font-style: italic;
}

/* Timeline Progress Navigation */
.timeline-progress-nav {
  position: sticky;
  top: 1px;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.25),
    rgba(46, 89, 132, 0.2),
    rgba(90, 138, 184, 0.1)
  );
  border: 2px solid rgba(74, 123, 167, 0.4);
  border-radius: 20px;
  margin-bottom: 3rem;
  backdrop-filter: blur(30px);
  box-shadow:
    0 15px 50px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  z-index: 50;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(74, 123, 167, 0.2);
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.1),
    rgba(74, 123, 167, 0.05)
  );
}

.progress-nav-header h3 {
  font-family: "Cinzel", serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #4a7ba7;
  text-shadow: 0 0 15px rgba(74, 123, 167, 0.6);
  margin: 0;
}

.progress-nav-toggle {
  background: linear-gradient(135deg, #5a8ab8, #4a7ba7);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: #0a1929;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(90, 138, 184, 0.3);
}

.progress-nav-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(90, 138, 184, 0.4);
}

.progress-nav-content {
  padding: 2rem;
  max-height: 200px;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-progress-nav.collapsed .progress-nav-content {
  max-height: 0;
  padding: 0 2rem;
}

.progress-nav-track {
  position: relative;
  height: 80px;
  display: flex;
  align-items: center;
}

.progress-nav-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4a7ba7, #5a8ab8, #5a8ab8);
  border-radius: 2px;
  transform: translateY(-50%);
  box-shadow: 0 0 15px rgba(74, 123, 167, 0.6);
}

.progress-nav-markers {
  display: flex;
  justify-content: space-between;
  width: 100%;
  position: relative;
  z-index: 2;
}

.progress-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.progress-marker:hover {
  transform: translateY(-5px);
}

.marker-dot {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #4a7ba7, #5a8ab8);
  border: 3px solid #0a1929;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(74, 123, 167, 0.6);
  transition: all 0.3s ease;
  position: relative;
  z-index: 3;
}

.progress-marker.active .marker-dot {
  background: linear-gradient(135deg, #5a8ab8, #4a7ba7);
  box-shadow: 0 0 20px rgba(90, 138, 184, 0.6);
  transform: scale(1.3);
}

.progress-marker.completed .marker-dot {
  background: linear-gradient(135deg, #5a8ab8, #4a7ba7);
  box-shadow: 0 0 15px rgba(74, 123, 167, 0.6);
}

.marker-label {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #b8d4e8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.marker-label span {
  font-size: 0.7rem;
  color: #7a9bb8;
  font-weight: 400;
}

.progress-nav-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0%;
  height: 6px;
  background: linear-gradient(90deg, #5a8ab8, #4a7ba7);
  border-radius: 3px;
  transform: translateY(-50%);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(90, 138, 184, 0.6);
  z-index: 1;
}

/* Timeline Progression Section */
.timeline-progression {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.2),
    rgba(46, 89, 132, 0.15),
    rgba(90, 138, 184, 0.08)
  );
  border: 2px solid rgba(74, 123, 167, 0.3);
  border-radius: 24px;
  padding: 2.5rem;
  margin-top: 4rem;
  backdrop-filter: blur(30px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.timeline-progression::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4a7ba7, #5a8ab8, #5a8ab8);
  opacity: 0.8;
}

.progression-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.progression-header h3 {
  font-family: "Cinzel", serif;
  font-size: 2rem;
  font-weight: 700;
  color: #4a7ba7;
  text-shadow: 0 0 20px rgba(74, 123, 167, 0.6);
  margin: 0;
}

.progression-controls {
  display: flex;
  gap: 1rem;
}

.progression-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #4a7ba7, #5a8ab8);
  border: none;
  border-radius: 12px;
  color: #0a1929;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(74, 123, 167, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.progression-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 123, 167, 0.4);
}

.progression-btn:active {
  transform: translateY(0);
}

.progression-content {
  position: relative;
}

.progression-track {
  position: relative;
  padding: 2rem 0;
}

.progression-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    90deg,
    rgba(74, 123, 167, 0.3),
    rgba(74, 123, 167, 0.2),
    rgba(74, 123, 167, 0.3)
  );
  border-radius: 3px;
  transform: translateY(-50%);
}

.progression-fill {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0%;
  height: 8px;
  background: linear-gradient(90deg, #4a7ba7, #5a8ab8, #5a8ab8);
  border-radius: 4px;
  transform: translateY(-50%);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(74, 123, 167, 0.6);
  z-index: 2;
}

.progression-eras {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 3;
}

.era-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  max-width: 120px;
}

.era-node:hover {
  transform: translateY(-8px);
}

.era-dot {
  width: 20px;
  height: 20px;
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.5),
    rgba(74, 123, 167, 0.3)
  );
  border: 3px solid rgba(74, 123, 167, 0.6);
  border-radius: 50%;
  transition: all 0.4s ease;
  position: relative;
  z-index: 4;
  box-shadow: 0 0 10px rgba(74, 123, 167, 0.3);
}

.era-node.completed .era-dot {
  background: linear-gradient(135deg, #5a8ab8, #4a7ba7);
  border-color: #5a8ab8;
  box-shadow: 0 0 15px rgba(74, 123, 167, 0.6);
}

.era-node.current .era-dot {
  background: linear-gradient(135deg, #5a8ab8, #4a7ba7);
  border-color: #5a8ab8;
  box-shadow: 0 0 20px rgba(90, 138, 184, 0.6);
  animation: currentEraPulse 2s ease-in-out infinite;
}

@keyframes currentEraPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.era-info {
  margin-top: 1rem;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

.era-node:hover .era-info,
.era-node.current .era-info {
  opacity: 1;
  transform: translateY(0);
}

.era-year {
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #4a7ba7;
  text-shadow: 0 0 10px rgba(74, 123, 167, 0.6);
  margin-bottom: 0.25rem;
}

.era-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #5a8ab8;
  text-shadow: 0 0 8px rgba(90, 138, 184, 0.6);
  margin-bottom: 0.5rem;
}

.era-description {
  font-size: 0.75rem;
  color: #7a9bb8;
  line-height: 1.3;
  max-width: 100px;
}

.progression-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(74, 123, 167, 0.2);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #7a9bb8;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid;
}

.legend-dot.completed {
  background: linear-gradient(135deg, #5a8ab8, #4a7ba7);
  border-color: #5a8ab8;
  box-shadow: 0 0 8px rgba(74, 123, 167, 0.6);
}

.legend-dot.current {
  background: linear-gradient(135deg, #5a8ab8, #4a7ba7);
  border-color: #5a8ab8;
  box-shadow: 0 0 10px rgba(90, 138, 184, 0.6);
}

.legend-dot.upcoming {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.5),
    rgba(74, 123, 167, 0.3)
  );
  border-color: rgba(74, 123, 167, 0.6);
  box-shadow: 0 0 6px rgba(74, 123, 167, 0.3);
}

/* Floating Timeline Progress Indicator */
.floating-timeline-progress {
  position: fixed;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.95),
    rgba(46, 89, 132, 0.9),
    rgba(90, 138, 184, 0.1)
  );
  border: 2px solid rgba(74, 123, 167, 0.6);
  border-radius: 16px;
  padding: 1rem;
  backdrop-filter: blur(30px);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 100;
  opacity: 0;
  transform: translateY(-50%) translateX(100px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 180px;
}

.floating-timeline-progress.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.progress-indicator-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.current-era-info {
  text-align: center;
}

.current-era-year {
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0a1929;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.25rem;
}

.current-era-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0a1929;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5a8ab8, #4a7ba7);
  border-radius: 3px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(90, 138, 184, 0.5);
}

.timeline-loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(74, 123, 167, 0.2);
  border-top: 4px solid #4a7ba7;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px rgba(74, 123, 167, 0.3);
}

.timeline-loading-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: #4a7ba7;
  text-shadow: 0 0 10px rgba(74, 123, 167, 0.6);
}

/* Improved accessibility focus states */
.timeline-search-input:focus,
.filter-select:focus,
.view-btn:focus,
.expand-all-btn:focus,
.collapse-all-btn:focus,
.search-btn:focus {
  outline: 3px solid rgba(74, 123, 167, 0.6);
  outline-offset: 2px;
}

/* Enhanced hover effects for interactive elements */
.timeline-search-input:hover {
  border-color: rgba(74, 123, 167, 0.5);
  background: rgba(74, 123, 167, 0.12);
}

.filter-select:hover {
  border-color: rgba(74, 123, 167, 0.5);
  background: rgba(74, 123, 167, 0.12);
}

/* Smooth transitions for all interactive elements */
.timeline-controls * {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced visual feedback for active states */
.filter-select:active,
.timeline-search-input:active {
  transform: scale(0.98);
}

.search-btn:active,
.view-btn:active,
.expand-all-btn:active,
.collapse-all-btn:active {
  transform: translateY(1px) scale(0.95);
}

/* Improved contrast for better readability */
.timeline-controls {
  box-shadow:
    0 15px 50px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.timeline-line {
  animation: blueGlow 4s ease-in-out infinite;
}

.year-marker:hover {
  animation: blueGlow 2s ease-in-out infinite;
}

.character-link:hover {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.3),
    rgba(46, 89, 132, 0.2)
  );
  border-color: #4a7ba7;
  color: #4a7ba7;
  box-shadow: 0 6px 20px rgba(74, 123, 167, 0.3);
  backdrop-filter: blur(20px);
}

.timeline-event[data-importance="high"] .event-header::after {
  background: #4a7ba7;
  box-shadow: 0 0 10px rgba(74, 123, 167, 0.7);
}

.timeline-event[data-importance="medium"] .event-header::after {
  background: #5a8ab8;
  box-shadow: 0 0 8px rgba(90, 138, 184, 0.6);
}

.timeline-event[data-importance="low"] .event-header::after {
  background: #4a7ba7;
  box-shadow: 0 0 6px rgba(74, 123, 167, 0.6);
}

.stat-card:hover {
  background: linear-gradient(
    135deg,
    rgba(74, 123, 167, 0.35),
    rgba(46, 89, 132, 0.3)
  );
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 40px rgba(74, 123, 167, 0.4);
  backdrop-filter: blur(25px);
}

.stat-card::before {
  background: linear-gradient(90deg, #4a7ba7, #5a8ab8);
}

.timeline-arc.expanded {
  backdrop-filter: blur(30px);
}

.arc-header:hover {
  backdrop-filter: blur(25px);
}

.event-header:hover {
  backdrop-filter: blur(15px);
}

/* Mobile-first responsive design for small screens */
@media (max-width: 767px) {
  /* Enhanced mobile touch targets */
  .view-btn,
  .expand-all-btn,
  .collapse-all-btn,
  .search-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .timeline-search-input {
    min-height: 44px;
  }

  .filter-select {
    min-height: 44px;
  }

  .main-content {
    padding: 1rem;
    padding-top: 2rem; /* Reduced since navbar is no longer fixed */
    max-width: 100%;
  }

  /* Page Header */
  .page-header {
    margin-bottom: 2rem;
    padding: 1rem 0;
  }

  .page-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
  }

  .page-title::after {
    right: -30px;
    font-size: 2rem;
  }

  .page-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  /* Timeline Controls - Mobile Layout */
  .timeline-controls {
    padding: 1.5rem;
    gap: 1.5rem;
    margin: 1.5rem auto 0;
    border-radius: 16px;
  }

  .search-container {
    flex-direction: column;
    gap: 1rem;
  }

  .search-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
  }

  .filter-controls {
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
    padding: 1rem;
  }

  .filter-group {
    min-width: auto;
  }

  .control-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .expand-all-btn,
  .collapse-all-btn,
  .view-btn {
    width: 100%;
    padding: 1rem;
    font-size: 0.9rem;
  }

  /* Enhanced FAB container for mobile */
  .timeline-fab-container {
    bottom: 1.5rem;
    right: 1.5rem;
    gap: 0.75rem;
  }

  .timeline-fab {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }

  .timeline-fab-help {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  /* Mobile keyboard hints */
  .keyboard-hints {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 0.75rem;
    font-size: 0.75rem;
  }

  .keyboard-hints h4 {
    font-size: 0.8rem;
  }

  /* Mobile notifications */
  .timeline-notification {
    top: 80px;
    right: 1rem;
    left: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Timeline Container */
  .timeline-container {
    margin: 2rem 0;
    padding-left: 0;
  }

  /* Central Line → Left aligned on mobile */
  .timeline-line {
    left: 1rem !important;
    transform: none !important;
    width: 3px;
  }

  /* Year Section */
  .timeline-year {
    padding-left: 2rem;
    margin-bottom: 2.5rem;
    align-items: flex-start;
  }

  /* Year Marker */
  .year-marker {
    left: 0 !important;
    transform: none !important;
    padding: 1.5rem 2rem;
    min-width: auto;
    width: calc(100% - 2rem);
    max-width: calc(100vw - 6rem);
    margin-left: -2rem;
  }

  .year-number {
    font-size: 1.8rem;
    white-space: nowrap;
  }

  .year-label {
    font-size: 0.85rem;
    white-space: nowrap;
  }

  /* Timeline Arcs */
  .timeline-arc {
    margin-left: 0;
    margin-bottom: 2rem;
  }

  /* Arc Header */
  .arc-header {
    padding: 1.5rem 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: 60px;
  }

  .arc-icon {
    font-size: 2.2rem;
  }

  .arc-title {
    font-size: 1.4rem;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
  }

  .arc-toggle {
    font-size: 1.4rem;
    margin-left: auto;
  }

  /* Arc Content */
  .arc-content {
    padding: 0;
  }

  /* Events */
  .timeline-event {
    margin-bottom: 1rem;
    border-radius: 12px;
  }

  .event-header {
    padding: 1.25rem 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .event-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
  }

  .event-title {
    font-size: 1.15rem;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
  }

  .event-date {
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
    white-space: nowrap;
  }

  .event-expand-hint {
    font-size: 0.75rem;
    margin-left: 0;
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
  }

  .event-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
  }

  .event-description {
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .event-consequences,
  .event-characters {
    margin-bottom: 1.25rem;
    padding: 1rem;
  }

  .event-consequences h4,
  .event-characters h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .event-consequences li {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
  }

  .character-links {
    gap: 0.75rem;
  }

  .character-link {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }

  .character-link img {
    width: 20px;
    height: 20px;
  }

  /* Timeline Progress Navigation - Mobile */
  .timeline-progress-nav {
    margin-bottom: 2rem;
    position: static;
  }

  .progress-nav-header {
    padding: 1rem 1.5rem;
  }

  .progress-nav-header h3 {
    font-size: 1.2rem;
  }

  .progress-nav-content {
    padding: 1.5rem;
    max-height: 150px;
  }

  .progress-nav-track {
    height: 60px;
  }

  .marker-label {
    font-size: 0.7rem;
    margin-top: 0.5rem;
  }

  .marker-label span {
    font-size: 0.6rem;
  }

  .marker-dot {
    width: 12px;
    height: 12px;
  }

  /* Timeline Progression - Mobile */
  .timeline-progression {
    padding: 1.5rem;
    margin-top: 2rem;
  }

  .progression-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .progression-header h3 {
    font-size: 1.5rem;
    text-align: center;
  }

  .progression-controls {
    justify-content: center;
  }

  .progression-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
  }

  .progression-track {
    padding: 1.5rem 0;
  }

  .progression-eras {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

  .era-node {
    max-width: 100px;
  }

  .era-dot {
    width: 16px;
    height: 16px;
  }

  .era-info {
    margin-top: 0.75rem;
  }

  .era-year {
    font-size: 1rem;
  }

  .era-name {
    font-size: 0.8rem;
  }

  .era-description {
    font-size: 0.7rem;
    max-width: 90px;
  }

  .progression-legend {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .legend-item {
    font-size: 0.85rem;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .stat-icon {
    font-size: 2rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.85rem;
  }

  /* Disable heavy animations on mobile */
  .timeline-arc,
  .timeline-event,
  .year-marker {
    animation: none !important;
  }

  /* Touch-friendly interactions */
  .arc-header,
  .event-header {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(74, 123, 167, 0.2);
  }

  /* Disable heavy background effects on mobile */
  .magic-circle,
  .particles,
  .starfield {
    display: none !important;
  }

  /* Floating Timeline Progress - Mobile */
  .floating-timeline-progress {
    right: 1rem;
    min-width: 140px;
    padding: 0.75rem;
  }

  .current-era-year {
    font-size: 1rem;
  }

  .current-era-name {
    font-size: 0.7rem;
  }

  .progress-bar-container {
    height: 4px;
  }

  /* Reduce backdrop blur for better performance */
  .timeline-arc,
  .year-marker,
  .event-description,
  .event-consequences,
  .event-characters {
    backdrop-filter: blur(10px) !important;
  }

  /* Disable hover-only transforms on touch */
  .timeline-event:hover,
  .timeline-arc:hover,
  .year-marker:hover {
    transform: none !important;
  }

  /* Optimize scrolling */
  body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Improve touch targets */
  .arc-header,
  .event-header {
    min-height: 48px;
    touch-action: manipulation;
  }

  /* Reduce motion for better performance */
  * {
    animation-duration: 0.2s !important;
    transition-duration: 0.2s !important;
  }

  /* Hide decorative elements */
  .page-title::after {
    display: none;
  }

  /* Optimize text rendering */
  .year-number,
  .year-label,
  .arc-title,
  .event-title {
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: subpixel-antialiased;
  }

  /* Improve text selection on mobile */
  .arc-title,
  .event-title,
  .event-description {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
  }

  /* Better focus indicators for accessibility */
  .arc-header:focus,
  .event-header:focus {
    outline: 3px solid #4a7ba7;
    outline-offset: 2px;
  }

  /* Improve contrast for better readability */
  .event-date {
    background: rgba(74, 123, 167, 0.2);
    border-color: rgba(74, 123, 167, 0.4);
  }

  /* Better spacing for touch targets */
  .character-links {
    gap: 1rem;
    justify-content: flex-start;
  }

  /* Optimize loading states */
  .timeline-loading {
    padding: 2rem 1rem;
  }

  .timeline-loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 2px;
  }

  /* Better error states */
  .timeline-error {
    margin: 1rem 0;
    padding: 2rem 1rem;
  }

  .timeline-error-icon {
    font-size: 2rem;
  }

  .timeline-error-text {
    font-size: 1rem;
  }

  /* Improve search highlights */
  .search-highlight {
    background: rgba(90, 138, 184, 0.3);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
  }

  /* Better no-results state */
  .no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #7a9bb8;
    background: rgba(74, 123, 167, 0.05);
    border: 1px solid rgba(74, 123, 167, 0.1);
    border-radius: 12px;
    margin: 2rem 0;
  }

  .no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
  }

  .no-results-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #b8d4e8;
  }

  .no-results-hint {
    font-size: 0.9rem;
    opacity: 0.8;
  }
}

/* Small phone optimizations for very narrow screens */
@media (max-width: 479px) {
  .main-content {
    padding: 0.75rem;
    padding-top: 1.5rem;
  }

  .page-header {
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
  }

  .page-title {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .page-title::after {
    right: -25px;
    font-size: 1.5rem;
  }

  .page-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  /* Timeline Progress Navigation - Small Mobile */
  .timeline-progress-nav {
    margin-bottom: 1.5rem;
  }

  .progress-nav-header {
    padding: 0.75rem 1rem;
  }

  .progress-nav-header h3 {
    font-size: 1rem;
  }

  .progress-nav-toggle {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .progress-nav-content {
    padding: 1rem;
    max-height: 120px;
  }

  .progress-nav-track {
    height: 50px;
  }

  .marker-label {
    font-size: 0.6rem;
    margin-top: 0.4rem;
  }

  .marker-label span {
    font-size: 0.55rem;
  }

  .marker-dot {
    width: 10px;
    height: 10px;
    border-width: 2px;
  }

  /* Timeline Progression - Small Mobile */
  .timeline-progression {
    padding: 1rem;
    margin-top: 1.5rem;
  }

  .progression-header h3 {
    font-size: 1.3rem;
  }

  .progression-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }

  .progression-eras {
    gap: 0.75rem;
  }

  .era-node {
    max-width: 80px;
  }

  .era-dot {
    width: 14px;
    height: 14px;
    border-width: 2px;
  }

  .era-year {
    font-size: 0.9rem;
  }

  .era-name {
    font-size: 0.75rem;
  }

  .era-description {
    font-size: 0.65rem;
    max-width: 75px;
  }

  .legend-item {
    font-size: 0.8rem;
  }

  .legend-dot {
    width: 10px;
    height: 10px;
    border-width: 1px;
  }

  .timeline-container {
    padding-left: 1rem;
  }

  .timeline-line {
    left: 0.75rem !important;
    width: 2px;
  }

  .timeline-year {
    padding-left: 1.5rem;
    margin-bottom: 2rem;
  }

  .year-marker {
    left: 0 !important;
    transform: none !important;
    padding: 1.25rem 1.5rem;
    max-width: calc(100vw - 5rem);
    margin-left: -1.5rem;
  }

  .year-number {
    font-size: 1.5rem;
  }

  .year-label {
    font-size: 0.75rem;
  }

  .arc-header {
    padding: 0.875rem 1rem;
    gap: 0.5rem;
  }

  .arc-icon {
    font-size: 1.8rem;
  }

  .arc-title {
    font-size: 1.1rem;
  }

  .arc-toggle {
    font-size: 1.2rem;
  }

  .event-header {
    padding: 0.875rem 1rem;
    gap: 0.5rem;
  }

  .event-icon {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }

  .event-title {
    font-size: 1rem;
  }

  .event-date {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
  }

  .event-expand-hint {
    font-size: 0.65rem;
  }

  .event-content {
    padding: 0 1rem 1rem 1rem;
  }

  .event-description {
    font-size: 0.9rem;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .event-consequences,
  .event-characters {
    padding: 0.75rem;
    margin-bottom: 1rem;
  }

  .event-consequences h4,
  .event-characters h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .event-consequences li {
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
  }

  .character-link {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }

  .character-link img {
    width: 18px;
    height: 18px;
  }

  .timeline-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-icon {
    font-size: 1.8rem;
  }

  .stat-value {
    font-size: 1.8rem;
  }

  .timeline-fab {
    width: 44px;
    height: 44px;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.2rem;
  }
}

/* Tablet layout adjustments for medium screens */
@media (min-width: 768px) {
  .main-content {
    padding: 2rem;
    padding-top: 2rem;
  }

  /* Timeline Controls - Tablet Layout */
  .timeline-controls {
    max-width: 900px;
  }

  .search-container {
    flex-direction: row;
  }

  .filter-controls {
    flex-direction: row;
    justify-content: space-between;
  }

  /* Restore center line */
  .timeline-line {
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 4px;
  }

  .timeline-year {
    padding-left: 0;
    align-items: center;
  }

  .year-marker {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .timeline-container {
    padding-left: 0;
  }

  .page-title {
    font-size: 3rem;
  }

  .page-subtitle {
    font-size: 1.2rem;
  }

  .timeline-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Laptop and desktop optimizations for larger screens */
@media (min-width: 1024px) {
  .main-content {
    max-width: 1200px;
    padding: 2rem;
    padding-top: 2rem;
  }

  .page-title {
    font-size: 3.5rem;
  }

  .page-subtitle {
    font-size: 1.3rem;
  }
}

/* ---------- Large Screens (≥ 1280px) ---------- */
@media (min-width: 1280px) {
  .main-content {
    max-width: 1400px;
  }

  .page-title {
    font-size: 3.8rem;
  }
}

/* Accessibility support for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .timeline-arc,
  .timeline-event,
  .year-marker,
  .arc-header,
  .event-header {
    animation: none !important;
    transition: none !important;
  }
}

/* High DPI display optimizations for crisp images */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .character-link img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode color scheme adjustments */
@media (prefers-color-scheme: dark) {
  :root {
    --text-light: #f0f8ff;
    --text-secondary: rgba(240, 248, 255, 0.8);
  }
}
