/* ==============================================================================
   Infranite Global - Demo Catalog Hub Stylesheet
   Responsive Grid, Filter Pills, Card Badges, Accessibility
   ============================================================================== */

:root {
  --bg-main: #0a0d14;
  --bg-surface: #121824;
  --bg-surface-elevated: #1a2335;
  --bg-surface-glass: rgba(18, 24, 36, 0.85);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #38bdf8;
  --accent-hover: #0ea5e9;
  --accent-glow: rgba(56, 189, 248, 0.18);
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);

  --status-live-bg: rgba(34, 197, 94, 0.15);
  --status-live-text: #4ade80;
  --status-soon-bg: rgba(234, 179, 8, 0.15);
  --status-soon-text: #facc15;
  --status-retired-bg: rgba(148, 163, 184, 0.15);
  --status-retired-text: #94a3b8;

  --border-subtle: #1e293b;
  --border-focus: #38bdf8;

  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --max-width: 1200px;
  --header-height: 4.5rem;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-system);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  height: var(--header-height);
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.125rem;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 150ms ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

/* Hero & Filter Controls */
.catalog-hero {
  padding: 3.5rem 0 2rem 0;
  text-align: center;
}

.catalog-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.catalog-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
}

.controls-bar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 3rem;
  background: var(--bg-surface);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1.25rem 0.875rem 2.75rem;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 150ms ease;
}

.search-input:focus {
  border-color: var(--accent-primary);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.tags-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-btn {
  padding: 0.4rem 0.9rem;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.tag-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.tag-btn.active {
  background: var(--accent-primary);
  color: #0a0d14;
  border-color: var(--accent-primary);
  font-weight: 600;
}

/* Card Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.demo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.demo-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: 0 10px 30px -10px var(--accent-glow);
}

.card-thumbnail-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-main);
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.live {
  background: var(--status-live-bg);
  color: var(--status-live-text);
}

.status-badge.coming-soon {
  background: var(--status-soon-bg);
  color: var(--status-soon-text);
}

.status-badge.retired {
  background: var(--status-retired-bg);
  color: var(--status-retired-text);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-tagline {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.card-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  margin-bottom: 1.5rem;
}

.card-tag {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.card-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.launch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.launch-btn:hover {
  opacity: 0.9;
}

/* Retired and Coming-Soon states */
.demo-card.retired {
  opacity: 0.6;
  filter: grayscale(80%);
}

.demo-card.retired:hover {
  transform: none;
  border-color: var(--border-subtle);
  box-shadow: none;
}

.disabled-action {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  cursor: not-allowed;
}

/* Empty & Error States */
.state-box {
  grid-column: 1 / -1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
}

.state-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.state-desc {
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.copyright {
  color: var(--text-muted);
  font-size: 0.875rem;
}
