/* Elements Pulse - Custom Scientific Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-obsidian: #070b14;
  --surface-card: #0d1527;
  --surface-card-hover: #131f38;
  --surface-elevated: #16223b;
  --border-subtle: rgba(56, 189, 248, 0.15);
  --border-card: rgba(255, 255, 255, 0.08);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --tactical-cyan: #38bdf8;
  --tactical-glow: rgba(56, 189, 248, 0.4);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-obsidian);
  color: var(--text-main);
  overflow-x: hidden;
}

.font-mono-tech {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #090e1a;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

/* 18-Column Periodic Grid System */
.periodic-grid-container {
  display: grid;
  grid-template-columns: repeat(18, minmax(62px, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 1140px;
}

.grid-cols-15 {
  display: grid;
  grid-template-columns: repeat(15, minmax(62px, 1fr));
  gap: 4px;
}

.grid-cols-18 {
  display: grid;
  grid-template-columns: repeat(18, minmax(62px, 1fr));
}

/* Element Card Styles */
.element-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  padding: 5px 6px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.element-card:hover {
  transform: translateY(-3px) scale(1.04);
  z-index: 20;
  box-shadow: 0 8px 24px -4px var(--card-glow, rgba(56, 189, 248, 0.35));
  border-color: var(--card-accent, #38bdf8);
}

.element-card:focus-visible {
  outline: 2px solid var(--tactical-cyan);
  outline-offset: 2px;
  z-index: 20;
}

/* Dimmed elements during search or category filtering */
.element-card.is-dimmed {
  opacity: 0.15;
  filter: grayscale(70%);
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

.element-card.is-matched {
  animation: pulseHighlight 1.6s ease-in-out infinite alternate;
}

@keyframes pulseHighlight {
  0% {
    box-shadow: 0 0 4px var(--card-glow, rgba(56, 189, 248, 0.4));
  }
  100% {
    box-shadow: 0 0 16px 2px var(--card-glow, rgba(56, 189, 248, 0.8));
    border-color: #ffffff;
  }
}

/* Period & Group Labels */
.grid-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* Placeholder series cells for Lanthanides & Actinides in main grid */
.series-placeholder {
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 84px;
}

.series-placeholder:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: var(--tactical-cyan);
}

/* Category Filter Button Pills */
.filter-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 21, 39, 0.7);
  backdrop-filter: blur(8px);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.filter-pill.active {
  color: #ffffff;
  border-color: var(--pill-accent, #38bdf8);
  background: var(--pill-bg, rgba(56, 189, 248, 0.16));
  box-shadow: 0 0 12px -2px var(--pill-glow, rgba(56, 189, 248, 0.4));
}

/* Range input styling */
input[type="range"] {
  -webkit-appearance: none;
  background: #1e293b;
  height: 6px;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
  box-shadow: 0 0 10px #38bdf8;
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Glassmorphism modal backdrop */
.glass-panel {
  background: rgba(13, 21, 39, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Ambient glow background effect */
.ambient-glow {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.04) 0%, rgba(7, 11, 20, 0) 70%);
  pointer-events: none;
  z-index: 0;
}
