/* Main container for historical records page with centered layout and background effects */
/* Force scroll on mobile for records 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;
}
.historical-records-container {
  position: relative;
  z-index: 10;
  padding: 6rem 3rem 3rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Subtle background gradient overlay for atmospheric depth */
.historical-records-container::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(77, 21, 22, 0.04) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(25, 52, 150, 0.03) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 80%,
      rgba(170, 85, 25, 0.02) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

@keyframes backgroundFloat {
  0%,
  100% {
    transform: translateZ(0);
  }
  50% {
    transform: translateZ(0);
  }
}

/* Page title with gradient text and animated glow effects */
.page-title {
  font-family: "Cinzel", serif;
  font-size: 3.8rem;
  font-weight: 700;
  color: var(--text-light);
  text-align: center;
  margin: 1.5rem 0 1.5rem 0;
  background: linear-gradient(
    135deg,
    var(--primary-blue),
    var(--accent-cyan),
    var(--accent-gold),
    var(--primary-blue)
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  animation:
    titleGlow 3s ease-in-out infinite alternate,
    gradientShift 8s ease infinite;
  z-index: 5;
  letter-spacing: 1px;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

.title-icon {
  display: inline-block;
  font-size: 2.5rem;
  margin: 0 1rem;
  animation: iconFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
}

.title-icon:first-child {
  animation-delay: 0s;
}

.title-icon:last-child {
  animation-delay: 1.5s;
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(-5deg);
  }
  75% {
    transform: translateY(-8px) rotate(5deg);
  }
}

.page-title::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-gold),
    transparent
  );
  border-radius: 2px;
  animation: titleUnderline 2s ease-in-out infinite;
}

@keyframes titleGlow {
  0% {
    text-shadow: 0 0 30px rgba(77, 21, 22, 0.3);
  }
  100% {
    text-shadow:
      0 0 40px rgba(77, 21, 22, 0.6),
      0 0 60px rgba(25, 52, 150, 0.2);
  }
}

@keyframes titleUnderline {
  0%,
  100% {
    width: 100px;
    opacity: 0.65;
  }
  50% {
    width: 200px;
    opacity: 1;
  }
}

/* Page subtitle with decorative sparkle elements */
.page-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 3rem;
  line-height: 1.7;
  max-width: 850px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  padding: 0 2.5rem;
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.page-subtitle::before,
.page-subtitle::after {
  content: "✦";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-gold);
  font-size: 1.4rem;
  animation: sparkle 2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px currentColor);
}

.page-subtitle::before {
  left: 0;
}

.page-subtitle::after {
  right: 0;
  animation-delay: 1s;
}

@keyframes sparkle {
  0% {
    opacity: 0.5;
    transform: translateY(-50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1.3) rotate(180deg);
  }
}

/* Help section with collapsible content and toggle button */
.help-section {
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

/* Interactive help toggle button with hover effects */
.help-toggle {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.3rem 2.2rem;
  background: linear-gradient(
    135deg,
    rgba(77, 21, 22, 0.2),
    rgba(77, 21, 22, 0.12),
    rgba(170, 85, 25, 0.08)
  );
  border: 2px solid rgba(77, 21, 22, 0.35);
  border-radius: 18px;
  color: var(--primary-blue);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
  font-size: 1.05rem;
  justify-content: center;
  max-width: 380px;
  margin: 0 auto;
  box-shadow:
    0 8px 25px rgba(77, 21, 22, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.12),
    0 0 20px rgba(77, 21, 22, 0.05);
  position: relative;
  overflow: hidden;
}

.help-toggle:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.help-toggle:hover {
  background: linear-gradient(
    135deg,
    rgba(77, 21, 22, 0.3),
    rgba(77, 21, 22, 0.2),
    rgba(170, 85, 25, 0.15)
  );
  border-color: var(--primary-blue);
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 12px 35px rgba(77, 21, 22, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    0 0 30px rgba(77, 212, 255, 0.15);
  color: #ffffff;
}

.help-toggle.active {
  background: linear-gradient(
    135deg,
    rgba(25, 52, 150, 0.3),
    rgba(25, 52, 150, 0.2),
    rgba(77, 21, 22, 0.15)
  );
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow:
    0 10px 30px rgba(255, 215, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    0 0 30px rgba(255, 215, 0, 0.1);
}

.help-icon {
  font-size: 1.4rem;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 8px currentColor);
}

.help-toggle:hover .help-icon {
  transform: scale(1.2) rotate(10deg);
}

.help-toggle.active .help-icon {
  transform: scale(1.1) rotate(180deg);
}

/* Expandable help content with grid layout for help items */
.help-content {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease 0.1s,
    margin 0.3s ease;
  opacity: 0;
  margin-top: 0;
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.9),
    rgba(21, 27, 61, 0.6)
  );
  backdrop-filter: blur(15px);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
}

.help-content.expanded {
  max-height: 1000px;
  opacity: 1;
  margin-top: 1rem;
  padding: 2rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.help-item {
  padding: 1rem;
  background: rgba(21, 27, 61, 0.5);
  border-radius: 8px;
  border-left: 3px solid var(--primary-blue);
  transition: all 0.3s ease;
}

.help-item:hover {
  background: rgba(21, 27, 61, 0.7);
  border-left-color: var(--accent-gold);
}

.help-item strong {
  color: var(--primary-blue);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.help-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.keyboard-shortcuts {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

.keyboard-shortcuts h4 {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.shortcut-grid div {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

kbd {
  background: rgba(21, 27, 61, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--primary-blue);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Records control panel with search and filtering functionality */
.records-controls {
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.98),
    rgba(15, 25, 45, 0.95),
    rgba(21, 27, 61, 0.98)
  );
  backdrop-filter: blur(25px);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 3rem;
  border: 1px solid rgba(77, 212, 255, 0.25);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 60px rgba(77, 212, 255, 0.08);
  animation: fadeInUp 0.6s ease-out 0.2s both;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

/* Search input with icon and clear button functionality */
.search-container {
  margin-bottom: 2rem;
}

/* Search input wrapper with animated icon */
.search-input-wrapper {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-blue);
  font-size: 1.2rem;
  z-index: 2;
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(77, 212, 255, 0.3));
  pointer-events: none;
}

.search-input-wrapper:focus-within .search-icon {
  color: var(--accent-gold);
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.5));
  transform: translateY(-50%) scale(1.1);
}

/* Main search input field with glassmorphism design */
#search-input {
  width: 100%;
  padding: 1.3rem 1.3rem 1.3rem 3.5rem;
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.95),
    rgba(15, 20, 45, 0.9)
  );
  border: 2px solid rgba(77, 212, 255, 0.35);
  border-radius: 16px;
  color: var(--text-light);
  font-size: 1.05rem;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 20px rgba(77, 212, 255, 0.05);
}

#search-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow:
    0 0 30px rgba(77, 212, 255, 0.5),
    0 10px 30px rgba(0, 0, 0, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    0 0 40px rgba(77, 212, 255, 0.15);
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 1),
    rgba(15, 20, 45, 0.95)
  );
  transform: translateY(-3px) scale(1.01);
}

#search-input::placeholder {
  color: rgba(232, 240, 255, 0.6);
  font-style: italic;
}

/* Clear search button with hover animations */
.clear-search {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(
    135deg,
    rgba(255, 51, 102, 0.1),
    rgba(255, 51, 102, 0.05)
  );
  border: 1px solid rgba(255, 51, 102, 0.3);
  color: var(--accent-crimson);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.4rem;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.21);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.clear-search:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 51, 102, 0.2),
    rgba(255, 51, 102, 0.1)
  );
  border-color: var(--accent-crimson);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
  color: #ffffff;
}

/* Filter controls grid layout for category and sorting options */
.filter-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  padding: 1.1rem 1.3rem;
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.95),
    rgba(15, 20, 45, 0.9)
  );
  border: 2px solid rgba(77, 212, 255, 0.25);
  border-radius: 14px;
  color: var(--text-light);
  font-size: 0.98rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 15px rgba(77, 212, 255, 0.05);
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow:
    0 0 25px rgba(77, 212, 255, 0.4),
    0 8px 25px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.12),
    0 0 30px rgba(77, 212, 255, 0.1);
  transform: translateY(-2px) scale(1.01);
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 1),
    rgba(15, 20, 45, 0.95)
  );
}

.filter-group select:hover {
  border-color: rgba(77, 212, 255, 0.4);
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.95),
    rgba(15, 20, 45, 0.9)
  );
}

.filter-group select option {
  background: var(--secondary-dark);
  color: var(--text-light);
  padding: 0.5rem;
}

/* Records statistics display with animated counters */
.records-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(77, 212, 255, 0.2);
  position: relative;
  flex-wrap: wrap;
}

.records-stats::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-blue),
    var(--accent-gold),
    var(--primary-blue),
    transparent
  );
}

.stat-item {
  text-align: center;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.6),
    rgba(15, 20, 45, 0.5)
  );
  border-radius: 18px;
  border: 1px solid rgba(77, 212, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 130px;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stat-item:hover {
  transform: translateY(-5px) scale(1.03);
  border-color: var(--primary-blue);
  box-shadow:
    0 12px 35px rgba(77, 212, 255, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    0 0 30px rgba(77, 212, 255, 0.15);
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.8),
    rgba(15, 20, 45, 0.7)
  );
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-blue);
  text-shadow:
    0 0 15px rgba(77, 212, 255, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.stat-item:hover .stat-number {
  color: var(--accent-gold);
  text-shadow:
    0 0 20px rgba(255, 215, 0, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.4);
  transform: scale(1.1);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.stat-item:hover .stat-label {
  color: var(--text-light);
}

/* No results state with animated icon and helpful messaging */
.no-results {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-secondary);
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.9),
    rgba(15, 25, 45, 0.8)
  );
  border-radius: 24px;
  border: 2px solid rgba(77, 212, 255, 0.25);
  margin: 3rem 0;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.08);
}

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

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

.no-results-icon {
  font-size: 5.5rem;
  margin-bottom: 1.5rem;
  opacity: 0.7;
  filter: drop-shadow(0 0 25px rgba(77, 212, 255, 0.4));
  animation: noResultsBounce 2s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes noResultsBounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.05);
  }
}

.no-results h3 {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  color: var(--text-light);
  font-weight: 700;
  text-shadow: 0 0 15px rgba(77, 212, 255, 0.3);
  position: relative;
  z-index: 2;
}

.no-results p {
  font-size: 1.1rem;
  opacity: 0.8;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

/* Individual record card with timeline dot and hover effects */
.record-card {
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.95),
    rgba(15, 25, 45, 0.9),
    rgba(21, 27, 61, 0.95)
  );
  backdrop-filter: blur(20px);
  border-left: 5px solid var(--importance-color, var(--accent-gold));
  border-radius: 20px;
  padding: 2.5rem;
  position: relative;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-left: 2rem;
  cursor: pointer;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  will-change: transform;
  z-index: 2;
  border: 1px solid rgba(77, 212, 255, 0.15);
}

/* Timeline dot indicator with pulsing animation */
.record-card::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: var(--importance-color, var(--accent-gold));
  border-radius: 50%;
  box-shadow:
    0 0 0 6px rgba(21, 27, 61, 0.9),
    0 0 25px var(--importance-color, rgba(255, 215, 0, 0.6)),
    0 0 40px var(--importance-color, rgba(255, 215, 0, 0.3));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.21);
  animation: pulse 2s ease-in-out infinite;
  z-index: 1;
}

@keyframes pulse {
  0%,
  100% {
    transform: translateY(-50%) scale(1);
    box-shadow:
      0 0 0 6px rgba(21, 27, 61, 0.9),
      0 0 25px var(--importance-color, rgba(255, 215, 0, 0.6)),
      0 0 40px var(--importance-color, rgba(255, 215, 0, 0.3));
  }
  50% {
    transform: translateY(-50%) scale(1.1);
    box-shadow:
      0 0 0 8px rgba(21, 27, 61, 0.9),
      0 0 35px var(--importance-color, rgba(255, 215, 0, 0.8)),
      0 0 60px var(--importance-color, rgba(255, 215, 0, 0.4));
  }
}

.record-card:hover {
  transform: translateX(12px) translateY(-6px) scale(1.01);
  border-left-color: var(--primary-blue);
  border-color: rgba(77, 212, 255, 0.4);
  box-shadow:
    0 20px 60px rgba(77, 212, 255, 0.35),
    0 30px 90px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 40px rgba(77, 212, 255, 0.2);
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 1),
    rgba(15, 25, 45, 0.95),
    rgba(21, 27, 61, 1)
  );
}

.record-card:hover::before {
  background: var(--primary-blue);
  box-shadow:
    0 0 0 8px rgba(21, 27, 61, 0.9),
    0 0 35px rgba(77, 212, 255, 0.8),
    0 0 60px rgba(77, 212, 255, 0.4);
  transform: translateY(-50%) scale(1.2);
}

.record-card.critical {
  border-left-color: var(--accent-crimson);
}

.record-card.major {
  border-left-color: var(--accent-gold);
}

.record-card.moderate {
  border-left-color: var(--primary-blue);
}

/* Record icon container with gradient background and category badge */
.record-icon-container {
  flex-shrink: 0;
  width: 85px;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.2),
    rgba(77, 212, 255, 0.15),
    rgba(170, 85, 255, 0.1)
  );
  border-radius: 22px;
  border: 2px solid rgba(77, 212, 255, 0.35);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    0 0 20px rgba(77, 212, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.record-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 15px var(--glow-gold));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.21);
  z-index: 2;
  position: relative;
}

.record-category-icon {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.1rem;
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.95),
    rgba(15, 25, 45, 0.9)
  );
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(77, 212, 255, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.record-card:hover .record-icon {
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 0 20px var(--glow-blue));
}

.record-card:hover .record-icon-container {
  border-color: var(--primary-blue);
  box-shadow:
    0 15px 45px rgba(77, 212, 255, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    0 0 30px rgba(77, 212, 255, 0.3);
  transform: scale(1.08) rotate(2deg);
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.25),
    rgba(77, 212, 255, 0.2),
    rgba(170, 85, 255, 0.15)
  );
}

.record-card:hover .record-category-icon {
  border-color: var(--accent-gold);
  transform: scale(1.1);
}

/* Record content area with title, description, and metadata */
.record-content {
  flex: 1;
  text-align: left;
  min-width: 0;
  overflow: visible;
}

/* Record title with animated underline on hover */
.record-title {
  font-family: "Cinzel", serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 0.8rem;
  line-height: 1.3;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  word-break: break-word;
  letter-spacing: 0.5px;
}

.record-title::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-blue),
    var(--accent-cyan),
    var(--accent-gold)
  );
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
  box-shadow: 0 0 10px currentColor;
}

.record-card:hover .record-title {
  color: var(--primary-blue);
  text-shadow: 0 0 20px rgba(77, 212, 255, 0.5);
  transform: translateX(6px);
}

.record-card:hover .record-title::after {
  width: 80px;
}

.record-description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  word-break: break-word;
}

.record-card:hover .record-description {
  color: rgba(232, 240, 255, 0.9);
  transform: translateX(2px);
}

/* Record metadata section with volume, importance, and date badges */
.record-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.record-volume {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-blue);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: linear-gradient(
    135deg,
    rgba(77, 212, 255, 0.2),
    rgba(77, 212, 255, 0.12)
  );
  padding: 0.5rem 1.2rem;
  border-radius: 28px;
  border: 1px solid rgba(77, 212, 255, 0.4);
  box-shadow:
    0 6px 18px rgba(77, 212, 255, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.12),
    0 0 15px rgba(77, 212, 255, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.record-volume:hover {
  background: linear-gradient(
    135deg,
    rgba(77, 212, 255, 0.3),
    rgba(77, 212, 255, 0.2)
  );
  border-color: var(--primary-blue);
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 8px 25px rgba(77, 212, 255, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    0 0 20px rgba(77, 212, 255, 0.15);
}

.record-importance {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.5rem 1rem;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.06)
  );
  border: 1px solid currentColor;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.12),
    0 0 15px currentColor;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.record-importance:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    0 0 20px currentColor;
}

.record-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  background: rgba(21, 27, 61, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(77, 212, 255, 0.1);
  transition: all 0.3s ease;
}

.record-date:hover {
  color: var(--text-light);
  border-color: rgba(77, 212, 255, 0.3);
  background: rgba(21, 27, 61, 0.6);
}

/* Expandable record details section with smooth animations */
.record-details {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition:
    grid-template-rows 0.6s cubic-bezier(0.4, 0, 0.21),
    opacity 0.4s ease 0.1s,
    margin-top 0.5s cubic-bezier(0.4, 0, 0.21);
  opacity: 0;
  margin-top: 0;
}

.record-details > .details-content {
  min-height: 0;
  overflow: hidden;
}

.record-details.expanded {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 1.8rem;
}

.record-details > div,
.record-details .details-content > div {
  margin-bottom: 1.2rem;
  padding: 1.2rem;
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.8),
    rgba(15, 20, 45, 0.7)
  );
  border-radius: 14px;
  border-left: 4px solid var(--primary-blue);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.08),
    0 0 15px rgba(77, 212, 255, 0.05);
  transition: all 0.3s ease;
  position: relative;
  word-break: break-word;
}

.record-details > div:hover,
.record-details .details-content > div:hover {
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.95),
    rgba(15, 20, 45, 0.85)
  );
  transform: translateX(6px);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.12),
    0 0 20px rgba(77, 212, 255, 0.1);
  border-left-color: var(--accent-cyan);
}

.detail-label {
  font-weight: 700;
  color: var(--primary-blue);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-shadow: 0 0 12px rgba(77, 212, 255, 0.4);
  word-break: break-word;
  position: relative;
  padding-left: 0.5rem;
}

.detail-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-cyan);
  border-radius: 2px;
}

.detail-value {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  word-break: break-word;
  max-width: 100%;
}

.record-details > div:hover .detail-value,
.record-details .details-content > div:hover .detail-value {
  color: rgba(232, 240, 255, 0.9);
}

/* Expand/collapse button for record details */
.record-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.2rem;
  padding: 0.85rem 1.6rem;
  background: linear-gradient(
    135deg,
    rgba(77, 212, 255, 0.18),
    rgba(77, 212, 255, 0.1)
  );
  border: 2px solid rgba(77, 212, 255, 0.35);
  border-radius: 14px;
  color: var(--primary-blue);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 6px 18px rgba(77, 212, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 20px rgba(77, 212, 255, 0.08);
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.record-expand-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(77, 212, 255, 0.3),
    rgba(77, 212, 255, 0.2)
  );
  border-color: var(--primary-blue);
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 10px 30px rgba(77, 212, 255, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    0 0 30px rgba(77, 212, 255, 0.2);
  color: #ffffff;
}

.expand-icon {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.21);
  font-size: 1rem;
  display: inline-block;
}

.record-details.expanded + .record-expand-btn .expand-icon {
  transform: rotate(180deg);
}

.record-details.expanded + .record-expand-btn,
.record-expand-btn.expanded {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.15),
    rgba(255, 215, 0, 0.08)
  );
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Records grid layout with timeline line and staggered animations */
.records-grid {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  overflow: visible;
  z-index: 2;
}

/* Vertical timeline line with gradient colors */
.records-grid::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(77, 212, 255, 0.4) 5%,
    rgba(77, 212, 255, 0.7) 25%,
    rgba(255, 215, 0, 0.5) 50%,
    rgba(77, 212, 255, 0.7) 75%,
    rgba(77, 212, 255, 0.4) 95%,
    transparent
  );
  border-radius: 3px;
  z-index: 1;
  box-shadow:
    0 0 15px rgba(77, 212, 255, 0.4),
    0 0 25px rgba(77, 212, 255, 0.15);
  animation: timelinePulse 4s ease-in-out infinite;
}

@keyframes timelinePulse {
  0%,
  100% {
    opacity: 0.8;
    box-shadow:
      0 0 15px rgba(77, 212, 255, 0.4),
      0 0 25px rgba(77, 212, 255, 0.15);
  }
  50% {
    opacity: 1;
    box-shadow:
      0 0 20px rgba(77, 212, 255, 0.6),
      0 0 35px rgba(77, 212, 255, 0.25);
  }
}

/* Screen reader only content for accessibility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Accessibility focus states for interactive elements */
.record-card:focus-visible,
.record-expand-btn:focus-visible,
.help-toggle:focus-visible {
  outline: 3px solid var(--primary-blue);
  outline-offset: 4px;
  z-index: 10;
}

/* Staggered animation delays for record card entrance effects */
.record-card:nth-child(1) {
  animation-delay: 0.05s;
}
.record-card:nth-child(2) {
  animation-delay: 0.1s;
}
.record-card:nth-child(3) {
  animation-delay: 0.15s;
}
.record-card:nth-child(4) {
  animation-delay: 0.2s;
}
.record-card:nth-child(5) {
  animation-delay: 0.25s;
}
.record-card:nth-child(6) {
  animation-delay: 0.3s;
}
.record-card:nth-child(7) {
  animation-delay: 0.35s;
}
.record-card:nth-child(8) {
  animation-delay: 0.4s;
}
.record-card:nth-child(9) {
  animation-delay: 0.45s;
}
.record-card:nth-child(10) {
  animation-delay: 0.5s;
}

/* Text selection styling with brand colors */
::selection {
  background: rgba(77, 212, 255, 0.3);
  color: var(--text-light);
}

::-moz-selection {
  background: rgba(77, 212, 255, 0.3);
  color: var(--text-light);
}

/* Mobile-first responsive design for small screens */
@media (max-width: 767px) {
  .historical-records-container {
    padding: 1.5rem 1rem 3rem 1rem;
    padding-top: 2rem; /* Reduced from 6rem since navbar is no longer fixed */
  }

  /* Page Header */
  .page-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin: 1rem 0;
  }

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

  /* Help Section */
  .help-section {
    margin-bottom: 1.5rem;
  }

  .help-toggle {
    max-width: 100%;
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
  }

  .help-content.expanded {
    padding: 1.5rem;
  }

  .help-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .shortcut-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  /* Records Controls */
  .records-controls {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

  .search-input-wrapper {
    max-width: 100%;
  }

  #search-input {
    font-size: 0.9rem;
    padding: 1rem 1rem 1rem 3rem;
  }

  .filter-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-group select {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }

  .records-stats {
    gap: 1.5rem;
    flex-direction: row;
    justify-content: space-around;
  }

  .stat-item {
    min-width: 100px;
    padding: 0.8rem;
  }

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

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

  /* Records Grid */
  .records-grid {
    gap: 1.5rem;
    max-width: 100%;
  }

  .records-grid::before {
    left: 0.5rem;
    width: 2px;
  }

  /* Record Cards */
  .record-card {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    margin-left: 1rem;
    border-radius: 12px;
  }

  .record-card::before {
    left: -1rem;
    width: 14px;
    height: 14px;
  }

  .record-card:hover {
    transform: translateY(-2px);
  }

  .record-icon-container {
    width: 60px;
    height: 60px;
    align-self: flex-start;
  }

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

  .record-category-icon {
    width: 24px;
    height: 24px;
    font-size: 1rem;
    bottom: -2px;
    right: -2px;
  }

  .record-content {
    text-align: left;
  }

  .record-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }

  .record-description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }

  .record-meta {
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
  }

  .record-volume,
  .record-importance,
  .record-date {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  .record-expand-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    margin-top: 1rem;
  }

  .record-details.expanded {
    margin-top: 1.2rem;
  }

  .record-details > div,
  .record-details .details-content > div {
    padding: 0.8rem;
    margin-bottom: 0.8rem;
  }

  .detail-label {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
  }

  .detail-value {
    font-size: 0.9rem;
  }

  /* No Results */
  .no-results {
    padding: 3rem 1.5rem;
    margin: 2rem 0;
  }

  .no-results-icon {
    font-size: 3.5rem;
  }

  .no-results h3 {
    font-size: 1.5rem;
  }

  .no-results p {
    font-size: 1rem;
  }

  /* Touch Improvements */
  .record-card,
  .record-expand-btn,
  .help-toggle,
  .clear-search,
  .filter-group select,
  #search-input {
    touch-action: manipulation;
  }

  /* Disable hover effects on touch devices */
  .record-card:hover {
    transform: none;
  }

  .record-card:hover .record-title::after {
    width: 0;
  }

  /* Improve touch targets */
  .record-expand-btn {
    min-height: 44px;
  }

  .clear-search {
    width: 36px;
    height: 36px;
    right: 0.8rem;
  }

  /* Performance optimizations */
  .magic-circle,
  .particles,
  .starfield,
  .floating-element {
    display: none !important;
  }

  /* Reduce animations */
  .record-card {
    animation: none;
  }

  .record-card::before {
    animation: none;
  }
}

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

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

  .page-subtitle {
    font-size: 0.9rem;
    padding: 0 0.5rem;
  }

  .records-controls {
    padding: 1rem;
  }

  .records-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .stat-item {
    min-width: auto;
    width: 100%;
  }

  .record-card {
    padding: 1rem;
    margin-left: 0.5rem;
  }

  .record-card::before {
    left: -0.5rem;
    width: 12px;
    height: 12px;
  }

  .records-grid::before {
    left: 0.25rem;
  }

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

  .record-description {
    font-size: 0.9rem;
  }

  .record-icon-container {
    width: 50px;
    height: 50px;
  }

  .record-icon {
    font-size: 1.6rem;
  }

  .record-category-icon {
    width: 20px;
    height: 20px;
    font-size: 0.9rem;
  }
}

/* ---------- Small Phones (≤ 479px) ---------- */
@media (max-width: 479px) {
  .records-page {
    padding: 1rem 0.75rem;
    padding-top: 1.5rem;
  }

  .records-title {
    font-size: 1.8rem;
  }

  .record-card {
    padding: 1rem;
  }

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

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

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

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

  .records-controls {
    padding: 2rem;
  }

  .filter-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .records-stats {
    flex-direction: row;
    gap: 2rem;
  }

  .record-card {
    flex-direction: row;
    gap: 2rem;
  }

  .record-icon-container {
    width: 70px;
    height: 70px;
  }

  .record-expand-btn {
    width: auto;
    align-self: flex-start;
  }
}

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

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

  .records-controls {
    padding: 2.5rem;
  }

  .record-card {
    gap: 2rem;
  }

  .record-icon-container {
    width: 80px;
    height: 80px;
  }

  .record-icon {
    font-size: 2.5rem;
  }
}

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

  .records-controls {
    padding: 3rem;
  }
}

/* Mobile performance optimizations and touch interaction improvements */
@media (max-width: 767px) {
  /* Disable heavy decorative effects */
  .magic-circle,
  .particles,
  .starfield,
  .floating-element {
    display: none !important;
  }

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

  .historical-records-container {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Disable hover transforms on touch */
  .record-card:hover {
    transform: none !important;
  }

  .record-card:hover .record-icon-container {
    transform: none !important;
  }

  .record-card:hover .record-icon {
    transform: none !important;
  }

  /* Improve touch interaction */
  .record-card {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(77, 212, 255, 0.1);
  }

  .record-expand-btn {
    -webkit-tap-highlight-color: rgba(77, 212, 255, 0.2);
  }

  /* Ensure proper viewport handling */
  .historical-records-container {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Mobile-specific animations */
  .record-card {
    transition:
      transform 0.2s ease,
      box-shadow 0.2s ease;
  }

  .record-card:active {
    transform: scale(0.98);
  }

  /* Improve readability on small screens */
  .record-title {
    word-break: break-word;
    hyphens: auto;
  }

  .record-description {
    word-break: break-word;
    hyphens: auto;
  }

  .detail-value {
    word-break: break-word;
    hyphens: auto;
  }

  /* Mobile navigation improvements */
  .mobile-menu-toggle {
    z-index: 1001;
    position: relative;
  }

  .mobile-nav {
    z-index: 1000;
  }

  /* Ensure mobile nav is above all content */
  .mobile-nav.active {
    z-index: 9999;
  }

  /* Prevent content from showing through mobile nav */
  body.mobile-nav-active .historical-records-container {
    visibility: hidden;
  }

  body.mobile-nav-active .main-nav {
    z-index: 999;
  }
}

/* Accessibility support for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .record-card {
    animation: none !important;
    transition: none !important;
  }

  .record-card::before {
    animation: none !important;
  }

  .page-title {
    animation: none !important;
  }

  .page-title::before {
    animation: none !important;
  }

  .help-icon {
    transition: none !important;
  }

  .loading-orb,
  .loading-inner,
  .loading-text,
  .loading-bar {
    animation: none !important;
  }

  .title-icon {
    animation: none !important;
  }
}

/* Smooth animation keyframes for card interactions */
@keyframes cardPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

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