@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #0b111b;
  color: #f2f5f9;
  --accent: #5ad0ff;
  --muted: #93a0b5;
  --panel: #141c2b;
  --panel-border: #1f2b3f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1.5rem;
  min-height: 100vh;
  background: radial-gradient(circle at top, #142238, #080c15 60%);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 21, 0.78);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.loading-overlay.hidden {
  display: none;
}

.loading-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(90, 208, 255, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.loading-copy p {
  margin: 0;
}

.loading-subtitle {
  margin-top: 0.25rem;
  color: var(--muted);
}

.loading-progress {
  margin-top: 0.65rem;
  height: 10px;
  width: 220px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #5ad0ff, #6ef3c5);
  box-shadow: 0 0 12px rgba(90, 208, 255, 0.55);
  transition: width 0.25s ease;
}

.inline-loader {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.inline-loader.hidden {
  display: none;
}

.inline-loader p {
  margin: 0;
  color: var(--muted);
}

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(90, 208, 255, 0.5);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(90, 208, 255, 0.35);
  }

  50% {
    transform: scale(1.2);
    box-shadow: 0 0 0 10px rgba(90, 208, 255, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(90, 208, 255, 0);
  }
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--panel-border);
}

.processing-notice {
  margin: 0.75rem 0;
  padding: 0.6rem 1rem;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  color: #ffc107;
  font-size: 0.9rem;
}

.processing-notice strong {
  color: #ffca2c;
}

.filter-wait-note {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: rgba(90, 208, 255, 0.12);
  border: 1px solid rgba(90, 208, 255, 0.3);
  color: #d9efff;
  font-size: 0.85rem;
}

header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

header p {
  margin: 0;
  color: var(--muted);
}

.support-link {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: rgba(90, 208, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(90, 208, 255, 0.3);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.support-link:hover {
  background: rgba(90, 208, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(90, 208, 255, 0.2);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: #031420;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(90, 208, 255, 0.3);
}

.controls {
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.control-group {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.control-group.stretch {
  grid-column: span 2;
}

.control-group.small {
  max-width: 180px;
}

.control-group label {
  color: var(--muted);
  font-size: 0.9rem;
}

.control-group input,
.control-group select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: inherit;
  padding: 0.45rem 0.6rem;
}

select[multiple] {
  min-height: 120px;
}

.choices {
  width: 100%;
}

.choices.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.choices__inner {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: inherit;
  min-height: 2.75rem;
  padding: 0.45rem 0.5rem;
}

.choices__placeholder {
  opacity: 0.6;
}

.choices__input {
  background: transparent !important;
  color: inherit !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  flex: 1;
  min-width: 110px !important;
  line-height: 1.4rem !important;
}

.choices__list--dropdown {
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  top: calc(100% + 6px);
  min-width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.choices.is-open {
  overflow: visible;
}

.choices__list--multiple .choices__item {
  background-color: rgba(90, 208, 255, 0.15);
  border: 1px solid rgba(90, 208, 255, 0.35);
  color: #d9efff;
}

.choices__list--dropdown,
.choices__item {
  color: #0b111b;
}

@media (min-width: 769px) {
  .choices__list--dropdown .choices__item {
    white-space: nowrap;
  }

  .choices__list--dropdown {
    width: max-content;
    max-width: 400px;
  }
}

.choices__list--dropdown .choices__item--selectable::after {
  display: none !important;
  content: "";
}

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

.summary>div {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1rem;
}

.metric-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.metric-value {
  margin: 0.35rem 0 0;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent);
}

.grid-panel {
  height: 520px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 0.5rem;
}

#grid {
  width: 100%;
  height: 100%;
}

.cell-headline {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  overflow: hidden;
  max-height: 100%;
}

.cell-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.3;
}

.cell-filename {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.score-cell {
  font-weight: 600;
  color: #ffb347;
}

.ag-theme-alpine {
  --ag-foreground-color: #f2f5f9;
  --ag-background-color: #0f1726;
  --ag-header-background-color: #162034;
  --ag-border-color: #1f2b3f;
  --ag-row-hover-color: rgba(90, 208, 255, 0.12);
  --ag-header-foreground-color: #d9e3f2;
  --ag-cell-horizontal-padding: 8px;
}

.ag-theme-alpine .ag-cell {
  padding-top: 6px;
  padding-bottom: 6px;
  display: flex;
  align-items: center;
}

.detail-panel {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  line-height: 1.4;
}

.detail-panel section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
}

.detail-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--accent);
}

.detail-panel ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.detail-panel pre {
  margin: 0;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-drawer {
  margin-top: 1rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1rem;
}

.detail-drawer.hidden {
  display: none;
}

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

.detail-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.detail-header h2 {
  margin: 0.2rem 0 0;
  font-size: 1.4rem;
}

.detail-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.detail-content article {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.9rem;
}

.detail-content h3 {
  margin: 0 0 0.4rem;
  color: var(--accent);
}

.detail-content p {
  margin: 0 0 0.6rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.detail-content ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  max-height: 200px;
  overflow: auto;
}

.detail-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

.detail-content article.detail-text {
  grid-column: 1 / -1;
  max-height: none;
  order: 999;
}

.detail-text-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.detail-text-header h3 {
  margin: 0;
}

.text-toggle {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  background: rgba(90, 208, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(90, 208, 255, 0.3);
}

.text-toggle:hover {
  background: rgba(90, 208, 255, 0.25);
  transform: none;
  box-shadow: none;
}

.text-preview {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.text-full {
  margin: 0;
  max-height: none;
  min-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 1200px) {
  .detail-content {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }

  .detail-content article.detail-text {
    grid-column: 1 / -1;
  }
}

.hidden {
  display: none;
}

/* Default: 4x1 grid (all in one row) for wide screens */
.charts {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* Desktop & Mobile: 2x2 grid */
@media (max-width: 1400px) {
  .charts {
    grid-template-columns: repeat(2, 1fr);
  }
}

.charts article {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1rem;
  height: 320px;
  overflow: hidden;
}

.charts canvas {
  max-width: 100%;
}

.charts h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  margin-top: 2rem;
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.methodology {
  margin-top: 2rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1rem;
  line-height: 1.6;
}

.methodology-collapse {
  margin: 0;
}

.methodology-collapse>summary {
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.5rem 0;
  list-style: none;
}

.methodology-collapse>summary::-webkit-details-marker {
  display: none;
}

.methodology-collapse>summary::before {
  content: "▶ ";
  font-size: 0.8em;
  margin-right: 0.5rem;
}

.methodology-collapse[open]>summary::before {
  content: "▼ ";
}

.methodology-collapse>p {
  margin-top: 0.75rem;
}

.methodology h2 {
  margin-top: 0;
}

.credits {
  margin-top: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.5rem;
  line-height: 1.6;
}

.credits h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.credits p {
  margin: 0;
  color: var(--muted);
}

.methodology ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0 1rem;
}

.methodology-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.accordion {
  margin: 1rem 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.accordion summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  margin: -0.75rem -1rem 0.25rem;
  padding: 0.75rem 1rem;
}

.accordion pre {
  white-space: pre-wrap;
  font-size: 0.85rem;
  color: #d7e2f5;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 1rem;
  max-height: 360px;
  overflow: auto;
}

/* Tablet: intermediate text sizing for better space utilization */
@media (min-width: 769px) and (max-width: 1024px) {
  body {
    font-size: 15px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  header p {
    font-size: 0.85rem;
  }

  .charts h2 {
    font-size: 1rem;
  }

  .detail-drawer h2 {
    font-size: 1.15rem;
  }

  .detail-content h3 {
    font-size: 0.95rem;
  }

  .detail-content p,
  .detail-content ul {
    font-size: 0.9rem;
  }

  .methodology-collapse>summary {
    font-size: 1.1rem;
  }

  .methodology-note {
    font-size: 0.9rem;
  }

  footer {
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  body {
    padding: 0.75rem;
    font-size: 14px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  header h1 {
    font-size: 1.15rem;
    line-height: 1.3;
  }

  header p {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .processing-notice {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
  }

  .site-footer {
    padding: 1rem;
    gap: 0.5rem;
  }

  .support-link {
    flex: 1;
    min-width: 140px;
    text-align: center;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  /* Compact filters - 2 column layout */
  .controls {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin: 0.5rem 0;
  }

  .control-group {
    padding: 0.4rem;
    border-radius: 6px;
    min-width: 0;
  }

  /* Score takes full width on its own row */
  .control-group:first-child {
    grid-column: span 2;
  }

  /* Search takes full width */
  .control-group.stretch {
    grid-column: span 2;
  }

  /* Max Rows and Reset side by side */
  .control-group.small {
    max-width: none;
  }

  .control-group label {
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .control-group input,
  .control-group select {
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    width: 100%;
    box-sizing: border-box;
  }

  .control-group input[type="range"] {
    width: 100%;
  }

  /* Choices.js mobile fixes */
  .choices__inner {
    min-height: 2.2rem;
    padding: 0.25rem;
    font-size: 0.8rem;
  }

  .choices__list--multiple .choices__item {
    font-size: 0.7rem;
    padding: 2px 5px;
    margin: 1px;
  }

  .choices__input {
    font-size: 0.8rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .choices__list--dropdown .choices__item {
    font-size: 0.85rem;
    padding: 0.5rem;
  }

  .choices__placeholder {
    font-size: 0.75rem;
    opacity: 0.7;
  }

  .choices[data-type*="select-multiple"] .choices__inner {
    padding-right: 0.25rem;
  }

  .choices__list--single {
    padding: 0;
  }

  /* Compact summary */
  .summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.75rem;
  }

  .summary>div {
    padding: 0.5rem;
  }

  .metric-value {
    font-size: 1.1rem;
  }

  .metric-label {
    font-size: 0.7rem;
  }

  .grid-panel {
    height: 350px;
    padding: 0.25rem;
    border-radius: 10px;
  }

  .detail-drawer {
    padding: 0.6rem;
    border-radius: 10px;
    margin-top: 0.75rem;
  }

  .detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
  }

  .detail-header h2 {
    font-size: 0.95rem;
    word-break: break-word;
    line-height: 1.3;
  }

  .detail-label,
  .detail-hint {
    font-size: 0.75rem;
  }

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

  .detail-content article {
    padding: 0.6rem;
  }

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

  .detail-content p {
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
  }

  .detail-content ul {
    font-size: 0.8rem;
    padding-left: 1rem;
    max-height: 120px;
  }

  .detail-content article.detail-text {
    grid-column: 1 / -1;
  }

  .text-preview {
    font-size: 0.8rem;
  }

  .text-toggle {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  .text-full {
    min-height: 150px;
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .charts {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .charts article {
    height: 280px;
    padding: 0.6rem;
  }

  .charts h2 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .methodology {
    padding: 0.75rem;
    border-radius: 10px;
    margin-top: 1rem;
  }

  .methodology-collapse>summary {
    font-size: 1rem;
    padding: 0.25rem 0;
  }

  .methodology h2 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .methodology p,
  .methodology li {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .credits {
    padding: 0.75rem;
    border-radius: 10px;
    margin-top: 0.75rem;
  }

  .credits h2 {
    font-size: 1rem;
  }

  .credits p {
    font-size: 0.8rem;
  }

  .accordion {
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
  }

  .accordion summary {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    margin: -0.5rem -0.75rem 0.25rem;
  }

  .accordion pre {
    font-size: 0.7rem;
    padding: 0.5rem;
    max-height: 200px;
  }

  .loading-card {
    flex-direction: column;
    text-align: center;
    margin: 1rem;
    padding: 1rem;
  }

  .loading-progress {
    width: 100%;
  }

  /* Reset filters button */
  #resetFilters {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
    font-size: 13px;
  }

  header h1 {
    font-size: 1rem;
  }

  header p {
    font-size: 0.75rem;
  }

  .site-footer {
    padding: 0.75rem;
    gap: 0.4rem;
  }

  .support-link {
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
    min-width: 120px;
  }

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

  .control-group {
    padding: 0.35rem;
  }

  .control-group label {
    font-size: 0.65rem;
  }

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

  .summary>div {
    padding: 0.4rem;
  }

  .metric-value {
    font-size: 1rem;
  }

  .metric-label {
    font-size: 0.65rem;
  }

  .grid-panel {
    height: 300px;
  }

  .ag-theme-alpine {
    --ag-cell-horizontal-padding: 4px;
    font-size: 0.8rem;
  }

  .detail-header h2 {
    font-size: 0.85rem;
  }

  .detail-content h3 {
    font-size: 0.8rem;
  }

  .detail-content p,
  .detail-content ul {
    font-size: 0.75rem;
  }

  .charts article {
    height: 320px;
  }
}

/* Highlight styles for search and filter matches */
mark.highlight {
  background: rgba(255, 193, 7, 0.35);
  color: #ffd54f;
  padding: 0.1em 0.2em;
  border-radius: 3px;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.5);
}

/* Loading Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 21, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 2rem;
  min-width: 320px;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.modal-content h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.4rem;
  color: var(--accent);
}

.modal-content p {
  margin: 0.5rem 0;
  color: var(--muted);
}

.modal-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 1.5rem auto;
  border: 4px solid rgba(90, 208, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Apply Filters Button - Prominent Action Button */
.control-group.action-buttons {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.apply-filters-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #3da8d5 100%);
  color: #0b111b;
  border: none;
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.3s ease;
  box-shadow:
    0 2px 8px rgba(90, 208, 255, 0.25),
    0 0 12px rgba(90, 208, 255, 0.15);
  animation: pulse-glow 2.5s ease-in-out infinite;
  white-space: nowrap;
}

.apply-filters-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 12px rgba(90, 208, 255, 0.4),
    0 0 20px rgba(90, 208, 255, 0.3);
  animation: none;
}

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

.apply-filters-btn .btn-icon {
  font-size: 1rem;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow:
      0 2px 8px rgba(90, 208, 255, 0.25),
      0 0 12px rgba(90, 208, 255, 0.15);
  }
  50% {
    box-shadow:
      0 3px 10px rgba(90, 208, 255, 0.35),
      0 0 18px rgba(90, 208, 255, 0.25);
  }
}
