/* =====================================
   ELEMENT DETAIL PAGE STYLES
   Atomic Lab Theme - Element Detail
   ===================================== */

/* Element Hero Section */
.element-hero {
  padding: 2rem 0 4rem;
  background: radial-gradient(circle at center, rgba(0, 212, 255, 0.05) 0%, transparent 70%);
}

.element-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: center;
}

/* Large Element Card */
.element-card-large {
  width: 200px;
  height: 200px;
  position: relative;
  background: var(--color-surface-primary);
  border: 3px solid;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: all var(--duration-normal) var(--ease-out);
}

.element-card-large:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: var(--shadow-glow);
}

/* Removed duplicate element-card-small definition - using the updated one below in Related Elements section */

.element-number-large {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1rem;
  opacity: 0.7;
  font-family: var(--font-mono);
}

.element-symbol-large {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px currentColor;
}

.element-name-large {
  font-size: 1rem;
  opacity: 0.8;
  text-align: center;
  letter-spacing: 1px;
}

/* Atom Visualization */
.atom-visualization {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 2rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Atom Nucleus */
.atom-nucleus {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: radial-gradient(circle,
      #FFFFFF 0%,
      #FFFFFF 40%,
      rgba(0, 229, 255, 0.8) 60%,
      rgba(189, 0, 255, 0.4) 100%);
  border-radius: 50%;
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.9),
    0 0 40px rgba(0, 229, 255, 0.6),
    0 0 60px rgba(189, 0, 255, 0.3);
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: nucleus-pulse 2s ease-in-out infinite;
}

.nucleus-symbol {
  font-size: 12px;
  font-weight: bold;
  color: rgba(0, 0, 0, 0.8);
}

.nucleus-details {
  display: flex;
  gap: 5px;
  font-size: 6px;
  color: rgba(0, 0, 0, 0.6);
}

/* Electron Shells Container */
.electron-shells {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
}

/* Individual Electron Shell */
.atom-visualization .electron-shell {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid;
  opacity: 0.5;
}

/* Shell sizes for detail page atom visualization */
.atom-visualization .electron-shell[data-shell="1"] {
  width: 60px;
  height: 60px;
  border-color: #00D4FF;
  animation: rotate-shell-1 3s linear infinite;
}

.atom-visualization .electron-shell[data-shell="2"] {
  width: 90px;
  height: 90px;
  border-color: #00B8E6;
  animation: rotate-shell-2 3.5s linear infinite;
}

.atom-visualization .electron-shell[data-shell="3"] {
  width: 120px;
  height: 120px;
  border-color: #0099FF;
  animation: rotate-shell-3 4s linear infinite;
}

.atom-visualization .electron-shell[data-shell="4"] {
  width: 150px;
  height: 150px;
  border-color: #0080FF;
  animation: rotate-shell-4 4.5s linear infinite;
}

.atom-visualization .electron-shell[data-shell="5"] {
  width: 180px;
  height: 180px;
  border-color: #0066FF;
  animation: rotate-shell-5 5s linear infinite;
}

/* Electron Wrapper for Rotation */
.atom-visualization .electron-wrapper {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  transform-origin: center center;
  animation: electronOrbit 3s linear infinite;
}

/* Different speeds for each shell */
.atom-visualization .electron-shell[data-shell="1"] .electron-wrapper {
  animation-duration: 2s;
}

.atom-visualization .electron-shell[data-shell="2"] .electron-wrapper {
  animation-duration: 2.5s;
}

.atom-visualization .electron-shell[data-shell="3"] .electron-wrapper {
  animation-duration: 3s;
}

.atom-visualization .electron-shell[data-shell="4"] .electron-wrapper {
  animation-duration: 3.5s;
}

.atom-visualization .electron-shell[data-shell="5"] .electron-wrapper {
  animation-duration: 4s;
}

/* Individual Electrons */
.atom-visualization .electron {
  position: absolute;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle,
      #00E5FF 0%,
      #00E5FF 50%,
      transparent 100%);
  border-radius: 50%;
  box-shadow: 0 0 10px #00E5FF, 0 0 20px #00E5FF;
}

/* Electron animations */
@keyframes electronOrbit {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes nucleus-pulse {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      0 0 20px rgba(255, 255, 255, 0.9),
      0 0 40px rgba(0, 229, 255, 0.6),
      0 0 60px rgba(189, 0, 255, 0.3);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow:
      0 0 30px rgba(255, 255, 255, 1),
      0 0 50px rgba(0, 229, 255, 0.8),
      0 0 70px rgba(189, 0, 255, 0.5);
  }
}

/* Electron Orbits */
.electron-orbits {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.orbit {
  position: absolute;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.orbit-1 {
  width: 80%;
  height: 80%;
  animation: electron-orbit 3s linear infinite;
}

.orbit-2 {
  width: 60%;
  height: 60%;
  animation: electron-orbit 4s linear infinite reverse;
}

.orbit-3 {
  width: 40%;
  height: 40%;
  animation: electron-orbit 5s linear infinite;
}

/* Element Info */
.element-info {
  min-width: 0;
}

.element-title {
  font-size: 3rem;
  color: var(--color-brand-primary);
  text-shadow: 0 0 20px currentColor;
  margin-bottom: 0.5rem;
  font-weight: 900;
}

.element-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  letter-spacing: 1px;
}

/* Quick Stats */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-item {
  background: rgba(var(--glow-rgb), 0.05);
  border: 1px solid rgba(var(--glow-rgb), 0.2);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

.stat-value.electron-config {
  font-size: 0.9rem;
  word-break: break-all;
}

/* Element Actions */
.element-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Element Details Grid */
.element-details {
  padding: 4rem 0;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

/* Detail Panels */
.detail-panel {
  background: var(--color-surface-primary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  transition: all var(--duration-normal) var(--ease-out);
}

.detail-panel:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

.detail-panel.warning-panel {
  border-color: var(--color-warning);
  background: rgba(255, 107, 0, 0.05);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(var(--glow-rgb), 0.2);
}

.panel-header h3 {
  color: var(--color-brand-primary);
  font-size: 1.1rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-status {
  color: var(--color-success);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 255, 136, 0.1);
  border-radius: var(--radius-sm);
}

/* Properties Grid */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.property-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.property-label {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Applications List */
.applications-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.application-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-icon {
  width: 40px;
  height: 40px;
  background: rgba(var(--glow-rgb), 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand-primary);
  flex-shrink: 0;
}

.app-text {
  flex: 1;
  line-height: 1.5;
  color: var(--color-text-primary);
}

/* Discovery Info */
.discovery-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.discovery-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.discovery-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.discovery-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Timeline */
.discovery-timeline {
  margin-top: 1rem;
  position: relative;
}

.timeline-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.timeline-point::before {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--color-brand-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-brand-primary);
  margin-bottom: 0.5rem;
}

.timeline-year {
  position: relative;
  bottom: 105%;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-brand-primary);
  font-size: 1.1rem;
}

.timeline-event {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* Safety Information */
.safety-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.safety-level {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 107, 0, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 107, 0, 0.3);
}

.safety-label {
  color: var(--color-text-primary);
  font-weight: 600;
}

.safety-indicator {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.safety-indicator.moderate {
  background: var(--color-warning);
  color: var(--color-text-inverse);
}

.safety-notes {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.6;
}

/* Related Elements */
.related-elements {
  padding: 4rem 0;
  background: rgba(15, 20, 25, 0.5);
}

.related-elements h2 {
  text-align: center;
  color: var(--color-brand-primary);
  margin-bottom: 2rem;
  font-size: 2rem;
  text-shadow: 0 0 10px currentColor;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.related-note {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Related Elements Card - Match Element Showcase Style */
/* Support both singular and plural class names for compatibility */
.related-elements-card,
.related-element-card {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 1rem !important;
  margin: 0 !important;
  background: radial-gradient(circle at center, rgba(0, 212, 255, 0.1) 0%, transparent 50%) !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  /* Override any anchor tag properties */
  outline: none !important;
  border: none !important;
  /* Removed color: inherit to allow element category colors to cascade down */
}

.related-elements-card:hover,
.related-element-card:hover {
  transform: translateY(-5px) !important;
  background: radial-gradient(circle at center, rgba(0, 212, 255, 0.15) 0%, transparent 50%) !important;
  text-decoration: none !important;
  /* Removed color: inherit to allow element category colors to show */
}

/* Element Card Small - Update to match hex structure */
.element-card-small {
  width: 120px !important;
  height: 120px !important;
  position: relative !important;
  background: linear-gradient(135deg, rgba(26, 26, 35, 0.9), rgba(13, 13, 20, 0.9)) !important;
  border: 2px solid currentColor !important;
  border-radius: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(10px) !important;
  transition: all var(--duration-normal) var(--ease-out) !important;
  overflow: hidden !important;
  padding: 0.5rem !important;
  /* Ensure no anchor styles interfere */
  text-decoration: none !important;
  /* Removed color: inherit to allow category colors to work */
}

.element-card-small::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, currentColor, transparent);
  opacity: 0.1;
  transition: opacity 0.3s;
}

.related-elements-card:hover .element-card-small,
.related-element-card:hover .element-card-small {
  box-shadow: 
    0 0 30px currentColor,
    inset 0 0 20px rgba(255, 255, 255, 0.1) !important;
}

.related-elements-card:hover .element-card-small::before,
.related-element-card:hover .element-card-small::before {
  opacity: 0.2 !important;
}

/* Element Components in Small Cards - Override anchor properties */
a .element-card-small .element-number,
.related-element-card .element-number,
.related-elements-card .element-number,
.element-card-small .element-number {
  position: absolute !important;
  top: 0.5rem !important;
  right: 0.5rem !important;
  font-size: 0.75rem !important;
  opacity: 0.8 !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em !important;
  z-index: 50 !important;
  text-decoration: none !important;
  /* Removed color: inherit to allow category colors to work */
}

a .element-card-small .element-symbol,
.related-element-card .element-symbol,
.related-elements-card .element-symbol,
.element-card-small .element-symbol {
  font-size: 2rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
  letter-spacing: -0.02em !important;
  margin: 0.25rem 0 !important;
  position: relative !important;
  z-index: 50 !important;
  font-family: var(--font-primary) !important;
  text-decoration: none !important;
  /* Removed color: inherit to allow category colors to work */
}

a .element-card-small .element-name,
.related-element-card .element-name,
.related-elements-card .element-name,
.element-card-small .element-name {
  font-size: 0.75rem !important;
  opacity: 0.8 !important;
  text-transform: capitalize !important;
  text-align: center !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  position: relative !important;
  z-index: 50 !important;
  text-decoration: none !important;
  /* Removed color: inherit to allow category colors to work */
}

/* Additional Element Category Colors for Complex Names */
.element-alkaline-earth-metals { color: var(--color-alkaline); }
.element-transition-metals { color: var(--color-transition); }
.element-noble-gases { color: var(--color-noble); }
.element-other-nonmetals { color: var(--color-nonmetal); }

/* Element Navigation */
.element-navigation {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  z-index: var(--z-fixed);
  background: rgba(var(--color-bg-primary), 0.95);
  padding: 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-primary);
  backdrop-filter: blur(10px);
}

.nav-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--color-text-primary);
  text-decoration: none;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-full);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.nav-btn a {
  color: inherit;
  text-decoration: none;
}

.nav-btn:hover {
  background: var(--color-brand-primary);
  color: var(--color-text-inverse);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(var(--glow-rgb), 0.3);
}

.table-btn {
  background: rgba(var(--glow-rgb), 0.1);
  border-color: var(--color-brand-primary);
}

/* =====================================
   TABLE OF CONTENTS - TOP SECTION
   ===================================== */

.toc-section-top {
  padding: 2rem 0;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.03) 0%, rgba(138, 43, 226, 0.03) 100%);
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  margin-bottom: 2rem;
}

.toc-container-top {
  text-align: center;
}

.toc-title {
  font-size: 1.3rem;
  color: var(--color-accent-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.toc-text-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

.toc-text-link {
  position: relative;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  transition: all var(--duration-fast) var(--ease-out);
  border-bottom: 2px solid transparent;
}

.toc-text-link::after {
  content: '•';
  position: absolute;
  right: -1rem;
  color: rgba(0, 212, 255, 0.3);
  font-size: 0.8rem;
}

.toc-text-link:last-child::after {
  display: none;
}

.toc-text-link:hover {
  color: var(--color-accent-primary);
  border-bottom-color: var(--color-accent-primary);
  transform: translateY(-2px);
}

.toc-text-link.active {
  color: var(--color-accent-primary);
  border-bottom-color: var(--color-accent-primary);
  font-weight: 600;
}

/* =====================================
   TABLE OF CONTENTS - STICKY SIDEBAR
   ===================================== */

.toc-navigation {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  align-items: center;
}

.toc-navigation.visible {
  opacity: 1;
  visibility: visible;
}

/* Arrow Trigger */
.toc-arrow-trigger {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 80px;
  background: linear-gradient(90deg, var(--color-accent-primary) 0%, rgba(0, 212, 255, 0.8) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: 2px 0 15px rgba(0, 212, 255, 0.3);
  z-index: 1002;
}

.toc-arrow-trigger:hover {
  width: 50px;
  background: linear-gradient(90deg, var(--color-accent-secondary) 0%, var(--color-accent-primary) 100%);
  box-shadow: 3px 0 20px rgba(0, 212, 255, 0.5);
}

.toc-arrow-trigger i {
  color: #DEE6ED;
  font-size: 1.2rem;
  transition: transform var(--duration-fast) var(--ease-out);
}

.toc-navigation:not(.collapsed) .toc-arrow-trigger {
  left: 280px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--color-accent-primary);
  border-left: none;
}

.toc-navigation:not(.collapsed) .toc-arrow-trigger i {
  color: var(--color-accent-primary);
}

/* Collapsed state - only arrow visible */
.toc-navigation.collapsed .toc-content {
  transform: translateY(-50%) translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Expanded state - content slides in */
.toc-navigation:not(.collapsed) .toc-content {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Add pulsing animation to arrow when collapsed */
.toc-navigation.collapsed .toc-arrow-trigger {
  animation: arrowPulse 3s infinite;
}

@keyframes arrowPulse {

  0%,
  100% {
    transform: translateY(-50%);
  }

  50% {
    transform: translateY(-50%) translateX(5px);
  }
}

.toc-content {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  max-height: 80vh;
  background: var(--color-surface-primary);
  border: 1px solid var(--color-accent-primary);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem;
  overflow-y: auto;
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: 5px 0 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.toc-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.toc-header h3 {
  font-size: 1.1rem;
  color: var(--color-accent-primary);
  margin: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-link {
  display: block;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
  font-size: 0.9rem;
  position: relative;
}

.toc-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--color-accent-primary);
  transition: height var(--duration-fast) var(--ease-out);
}

.toc-link:hover {
  color: var(--color-accent-primary);
  background: rgba(0, 212, 255, 0.1);
  padding-left: 1.5rem;
}

.toc-link.active {
  color: var(--color-accent-primary);
  background: rgba(0, 212, 255, 0.15);
  font-weight: 600;
}

.toc-link.active::before {
  height: 70%;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--color-accent-primary);
  color: var(--color-bg-primary);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 212, 255, 0.5);
}

.back-to-top i {
  color: #DEF6ED;
  font-size: 1.2rem;
}

/* Improved Section Spacing */
.content-section {
  margin-bottom: 3rem !important;
  /* Consistent spacing between all sections */
  scroll-margin-top: 100px;
  /* Offset for fixed header when scrolling */
}

.content-section:last-child {
  margin-bottom: 2rem !important;
}

/* Consistent List Margins */
.formatted-content ul,
.formatted-content ol {
  margin: 1.5rem 0 !important;
  padding-left: 2rem !important;
}

.formatted-content li {
  margin-bottom: 0.75rem !important;
  line-height: 1.8;
}

.formatted-content ul ul,
.formatted-content ol ol,
.formatted-content ul ol,
.formatted-content ol ul {
  margin: 0.75rem 0 !important;
}

/* Mobile Responsive TOC */
@media (max-width: 768px) {
  .toc-section-top {
    padding: 1.5rem 0;
  }

  .toc-text-grid {
    gap: 0.75rem 1.5rem;
    padding: 0 0.5rem;
  }

  .toc-text-link {
    font-size: 0.9rem;
    padding: 0.4rem 0;
  }

  .toc-text-link::after {
    right: -0.75rem;
  }

  .toc-arrow-trigger {
    width: 35px;
    height: 70px;
  }

  .toc-arrow-trigger i {
    font-size: 1rem;
  }

  .toc-content {
    width: 250px;
    max-height: 70vh;
  }

  .toc-navigation:not(.collapsed) .toc-arrow-trigger {
    left: 250px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .element-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .element-card-large {
    width: 150px;
    height: 150px;
    margin: 0 auto;
  }

  .element-symbol-large {
    font-size: 3rem;
  }

  .element-title {
    font-size: 2rem;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

  .element-navigation {
    flex-direction: column;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    transform: none;
  }

  .nav-btn {
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .element-actions {
    justify-content: center;
  }

  .btn-hologram,
  .btn-plasma {
    flex: 1;
    min-width: 0;
    text-align: center;
  }
}

/* Full width panel for description */
.detail-panel.full-width {
  grid-column: span 2;
}

/* Enhanced content styling - Merged from duplicate rules */
.element-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.element-description h3 {
  color: var(--accent-cyan);
  margin: 1.5rem 0 1rem;
  font-size: 1.4rem;
}

.element-description h4 {
  color: var(--accent-blue);
  margin: 1.2rem 0 0.8rem;
  font-size: 1.2rem;
}

.element-description p {
  margin-bottom: 1rem;
}

.element-description ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.element-description li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.element-description li:before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
  font-weight: bold;
}

.element-description .highlight {
  background: rgba(0, 255, 255, 0.1);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.element-description .warning {
  background: rgba(255, 77, 77, 0.2);
  color: #ff6b6b;
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 3px solid #ff4d4d;
  margin: 1rem 0;
  display: block;
}

/* Lists styling for applications and occurrence - Merged rules */
.applications-list ul,
.occurrence-info ul {
  list-style: none;
  padding: 0;
}

.applications-list li,
.occurrence-info li {
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.applications-list li:last-child,
.occurrence-info li:last-child {
  border-bottom: none;
}

.safety-info .warning {
  margin-top: 1rem;
}

/* Special Properties & Hazards */
.special-properties {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hazard-indicator {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 2px solid;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.hazard-indicator::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.1;
  z-index: -1;
}

.hazard-indicator i {
  font-size: 2rem;
  width: 3rem;
  text-align: center;
}

.hazard-label {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.hazard-description {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-left: auto;
}

/* Radioactive */
.hazard-indicator.radioactive {
  background: rgba(255, 255, 0, 0.1);
  border-color: #ffff00;
  color: #ffff00;
}

.hazard-indicator.radioactive::before {
  background: radial-gradient(circle, #ffff00, transparent);
  animation: pulse 2s ease-in-out infinite;
}

/* Toxic */
.hazard-indicator.toxic {
  background: rgba(255, 0, 255, 0.1);
  border-color: #ff00ff;
  color: #ff00ff;
}

/* Highly Reactive */
.hazard-indicator.reactive {
  background: rgba(255, 77, 0, 0.1);
  border-color: #ff4d00;
  color: #ff4d00;
}

/* Inert */
.hazard-indicator.inert {
  background: rgba(0, 255, 255, 0.1);
  border-color: #00ffff;
  color: #00ffff;
}

/* Safe/Stable */
.hazard-indicator.safe {
  background: rgba(0, 255, 0, 0.1);
  border-color: #00ff00;
  color: #00ff00;
}

/* Abundance Info */
.abundance-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.abundance-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.abundance-item i {
  color: var(--accent-cyan);
  font-size: 1.2rem;
}

.abundance-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.abundance-value {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-cyan);
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.2;
  }
}

/* Additional responsive rules for hazards */
@media (max-width: 768px) {
  .hazard-description {
    display: none;
  }

  .hazard-indicator {
    padding: 0.75rem;
  }

  .hazard-indicator i {
    font-size: 1.5rem;
    width: 2rem;
  }

  .hazard-label {
    font-size: 1rem;
  }
}
