/* ===================================
   EXPLORE PAGE - Civic Blueprint
   Discover the pulse of civic innovation
   =================================== */

.explore-page {
  min-height: 100vh;
  padding-top: 64px;
}

/* ===================================
   HERO SECTION
   =================================== */
.explore-hero {
  position: relative;
  padding: var(--space-16) 0 var(--space-12);
  overflow: hidden;
}

/* Subtle flat background tint */
.explore-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-accent-soft);
  opacity: 0.5;
}

@keyframes hero-gradient {
  0% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.1) rotate(3deg); }
}

.explore-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.explore-hero h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
  animation: slide-up var(--duration-slow) var(--ease-out) forwards;
}

.explore-hero-subtitle {
  font-size: var(--text-lg);
  color: var(--c-text-soft);
  margin-bottom: var(--space-8);
  animation: slide-up var(--duration-slow) var(--ease-out) 100ms forwards;
  opacity: 0;
}

/* Live stats ticker */
.explore-stats-ticker {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  animation: slide-up var(--duration-slow) var(--ease-out) 200ms forwards;
  opacity: 0;
}

.ticker-stat {
  text-align: center;
}

.ticker-value {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--c-accent);
}

.ticker-value.highlight-idea { color: var(--c-idea); }
.ticker-value.highlight-converge { color: var(--c-converge); }
.ticker-value.highlight-reality { color: var(--c-reality); }

.ticker-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
  margin-top: var(--space-1);
}

/* ===================================
   FILTERS SECTION
   =================================== */
.explore-filters {
  position: sticky;
  top: 64px;
  z-index: var(--z-sticky);
  background: var(--c-header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-border);
  padding: var(--space-4) 0;
}

.filters-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Filter pills */
.filter-pills {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-pill {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--c-text-muted);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-pill:hover {
  border-color: var(--c-border-bright);
  color: var(--c-text);
}

.filter-pill.active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-on-accent);
}

/* Filter dropdowns */
.filter-dropdown {
  position: relative;
}

.filter-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--c-text-soft);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.filter-dropdown-trigger:hover {
  border-color: var(--c-border-bright);
}

.filter-dropdown-trigger svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* Search */
.filter-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.filter-search input {
  width: 100%;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-10);
  font-size: var(--text-sm);
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.filter-search input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}

.filter-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--c-text-muted);
  pointer-events: none;
}

/* View toggle */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 2px;
  margin-left: auto;
}

.view-toggle-btn {
  padding: var(--space-2);
  background: transparent;
  border: none;
  color: var(--c-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.view-toggle-btn:hover {
  color: var(--c-text);
}

.view-toggle-btn.active {
  background: var(--c-accent);
  color: var(--c-on-accent);
}

.view-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* ===================================
   IDEAS GRID
   =================================== */
.explore-content {
  padding: var(--space-8) 0 var(--space-16);
}

/* Filtered result count (RU-4b run 5) - announced via role="status",
   re-rendered on every filter change and language switch. */
.results-count {
  margin: 0 0 var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-6);
}

/* ===================================
   IDEA CARD
   =================================== */
.idea-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
  cursor: pointer;
  position: relative;
}

.idea-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cat-color, var(--c-accent));
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.idea-card:hover {
  border-color: var(--c-border-bright);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

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

/* Card visual (mini-map or placeholder) */
.idea-card-visual {
  height: 160px;
  background: var(--c-abyss);
  position: relative;
  overflow: hidden;
}

.idea-card-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--c-grid) 1px, transparent 1px),
    linear-gradient(var(--c-grid) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.3;
}

.idea-card-visual-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cat-color, var(--c-accent));
  border-radius: 50%;
  font-size: 24px;
  color: var(--c-on-accent);
  box-shadow: var(--shadow-sm);
}

/* Card status indicator */
.idea-card-status {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--c-header-bg);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
}

.idea-card-status.active {
  color: var(--c-idea);
}

.idea-card-status.converging {
  color: var(--c-converge);
}

.idea-card-status.funded {
  color: var(--c-reality);
}

.idea-card-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Card body */
.idea-card-body {
  padding: var(--space-5);
}

.idea-card-category {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cat-color, var(--c-accent));
  margin-bottom: var(--space-2);
}

.idea-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: var(--space-3);
  color: var(--c-text);
}

.idea-card-location {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--space-4);
}

.idea-card-location svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* Card stats */
.idea-card-stats {
  display: flex;
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--c-border);
}

.idea-card-stat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

.idea-card-stat svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.idea-card-stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--c-text);
}

/* Convergence indicator */
.idea-card-convergence {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.convergence-mini-bar {
  width: 50px;
  height: 4px;
  background: var(--c-abyss);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.convergence-mini-fill {
  height: 100%;
  background: var(--c-accent);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow);
}

.convergence-mini-value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--c-converge);
}

/* ===================================
   CTA SECTION
   =================================== */
.explore-cta {
  background: var(--c-depth);
  border-top: 1px solid var(--c-border);
  padding: var(--space-16) 0;
  position: relative;
  overflow: hidden;
}

.explore-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-accent-soft);
  opacity: 0.3;
}

.explore-cta-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.explore-cta h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.explore-cta p {
  font-size: var(--text-base);
  color: var(--c-text-soft);
  margin-bottom: var(--space-6);
  max-width: none;
}

/* ===================================
   LOADING STATE
   =================================== */
.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-6);
}

.loading-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.loading-card-visual {
  height: 160px;
  background: linear-gradient(90deg,
    var(--c-abyss) 0%,
    var(--c-surface) 50%,
    var(--c-abyss) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.loading-card-body {
  padding: var(--space-5);
}

.loading-line {
  height: 16px;
  background: linear-gradient(90deg,
    var(--c-abyss) 0%,
    var(--c-surface-glow) 50%,
    var(--c-abyss) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.loading-line.short { width: 40%; }
.loading-line.medium { width: 70%; }

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

/* ===================================
   EMPTY STATE
   =================================== */
.explore-empty {
  grid-column: 1 / -1;
  padding: var(--space-16);
  text-align: center;
}

.explore-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface);
  border-radius: 50%;
  color: var(--c-text-muted);
}

.explore-empty-icon svg {
  width: 40px;
  height: 40px;
}

.explore-empty h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.explore-empty p {
  color: var(--c-text-muted);
  max-width: 400px;
  margin: 0 auto;
}

/* ===================================
   FOOTER
   =================================== */
.footer {
  background: var(--c-abyss);
  border-top: 1px solid var(--c-border);
  padding: var(--space-8) 0;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer-brand-name {
  font-weight: 600;
  color: var(--c-text);
}

.footer-brand-tagline {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-link {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  transition: color var(--duration-fast);
}

.footer-link:hover {
  color: var(--c-accent);
}

/* ===================================
   EXPORT DROPDOWN
   =================================== */
.export-dropdown {
  position: relative;
}

.export-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.export-dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--duration-fast) var(--ease-out);
  z-index: var(--z-dropdown);
}

.export-dropdown.open .export-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.export-dropdown-header {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-muted);
  border-bottom: 1px solid var(--c-border);
}

.export-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--c-text-soft);
  transition: all var(--duration-fast) var(--ease-out);
}

.export-dropdown-item:hover {
  background: var(--c-surface-glow);
  color: var(--c-text);
}

.export-dropdown-item svg {
  color: var(--c-text-muted);
  flex-shrink: 0;
}

.export-dropdown-divider {
  height: 1px;
  background: var(--c-border);
  margin: var(--space-2) 0;
}

/* ===================================
   SENTIMENT BADGE POSITIONING
   =================================== */
.idea-card-sentiment {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 1;
}

.idea-card-sentiment .sentiment-badge {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  background: var(--c-header-bg);
  backdrop-filter: blur(4px);
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1024px) {
  .explore-hero {
    padding: var(--space-12) 0 var(--space-8);
  }

  .explore-hero h1 {
    font-size: var(--text-3xl);
  }

  .explore-stats-ticker {
    gap: var(--space-6);
  }

  .ticker-value {
    font-size: var(--text-2xl);
  }
}

@media (max-width: 768px) {
  .explore-hero {
    padding: var(--space-10) 0 var(--space-6);
  }

  .explore-hero h1 {
    font-size: var(--text-2xl);
  }

  .explore-stats-ticker {
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .ticker-stat {
    flex: 1;
    min-width: 100px;
  }

  .filters-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-pills {
    order: 2;
  }

  .filter-search {
    order: 1;
    min-width: 100%;
  }

  .view-toggle {
    display: none;
  }

  .ideas-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ===================================
   RU-3: real review-status badge on
   explore cards (replaces the invented
   funded/converging chip)
   =================================== */
.idea-card-status-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}

/* Completed keeps its solid green fill; the others get an opaque chrome
   backdrop so they stay readable over the card visual. */
.idea-card-status-badge .status-badge:not(.status-badge-completed) {
  background: var(--c-header-bg);
}

/* RU-6: seeded-idea provenance chip on explore cards */
.idea-card-seed-chip {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
}

.idea-card-seed-chip .seed-chip {
  background: var(--c-header-bg);
}

/* UF-10: share trigger on the card visual (bottom-right; status badge owns
   the top-right corner and the seed chip the bottom-left) */
.idea-card-share {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  z-index: 1;
}
