/* Lair Marketplace — minimal gallery styling */

:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface-hover: #242424;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --text-muted: #888;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --featured: #f59e0b;
  --official: #10b981;
  --group: #8b5cf6;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ──────────────────────────────────────────────── */

header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

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

/* ─── Main ────────────────────────────────────────────────── */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  flex: 1;
}

/* ─── Product Hero ────────────────────────────────────────── */

.product-hero {
  text-align: center;
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.product-hero-content {
  max-width: 680px;
  margin: 0 auto;
}

.product-eyebrow {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.product-title {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.product-subtitle {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

.product-desc {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

/* ─── Feature Grid ────────────────────────────────────────── */

.product-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  text-align: left;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.feature:hover {
  background: var(--surface);
}

.feature-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.feature-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.feature-text strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.feature-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─── App Store Badge ─────────────────────────────────────── */

.app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1.5rem;
  background: #fff;
  color: #000;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.15s ease;
  margin-bottom: 1rem;
}

.app-store-badge:hover {
  background: #e8e8e8;
  transform: translateY(-1px);
}

.apple-logo {
  width: 1.25rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.app-store-badge-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.app-store-badge-small {
  font-size: 0.5625rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.app-store-badge-large {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.product-price {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ─── Marketplace Section ─────────────────────────────────── */

.marketplace-header {
  text-align: center;
  padding: 1rem 0 1.5rem;
}

.marketplace-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}

.marketplace-header p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
  .product-title {
    font-size: 2.75rem;
  }

  .product-subtitle {
    font-size: 1.25rem;
  }

  .product-features {
    grid-template-columns: 1fr;
  }

  .product-hero {
    padding: 2.5rem 0 2rem;
  }
}

/* ─── Legacy Hero (detail pages) ──────────────────────────── */

.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

.search-form {
  display: flex;
  gap: 0.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.search-form input {
  flex: 1;
  padding: 0.625rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  outline: none;
}

.search-form input:focus {
  border-color: var(--accent);
}

.search-form button {
  padding: 0.625rem 1.25rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  cursor: pointer;
  font-weight: 500;
}

.search-form button:hover {
  background: var(--accent-hover);
}

/* ─── Filters ─────────────────────────────────────────────── */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 0 2rem;
  justify-content: center;
}

.chip {
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ─── Grid ────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s ease;
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-preview {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.card-header h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-icon {
  color: var(--text-muted);
  font-size: 0.875rem;
  width: 1.25rem;
  text-align: center;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Badges ──────────────────────────────────────────────── */

.badge {
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge.featured { background: var(--featured); color: #000; }
.badge.official { background: var(--official); color: #000; }
.badge.group { background: var(--group); color: #fff; }

/* ─── Collection Detail ───────────────────────────────────── */

.collection-detail {
  max-width: 720px;
  margin: 0 auto;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-block;
  margin-bottom: 1rem;
}

.back-link:hover { text-decoration: underline; }

.detail-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.detail-preview {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

.detail-description {
  color: var(--text-muted);
  margin: 1.5rem 0;
  line-height: 1.7;
}

/* ─── Field List ──────────────────────────────────────────── */

.field-list {
  margin: 1.5rem 0;
}

.field-list h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.field-list h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.field-group {
  margin-bottom: 1rem;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.field-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.625rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
}

.field-name {
  color: var(--text);
  font-weight: 500;
}

.field-type {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

/* ─── Stats ───────────────────────────────────────────────── */

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.detail-stats dt {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-stats dd {
  font-size: 1.25rem;
  font-weight: 600;
}

.detail-actions {
  margin: 2rem 0;
}

.download-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.15s ease;
}

.download-btn:hover { background: var(--accent-hover); }

.detail-date {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.category {
  background: var(--surface);
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  grid-column: 1 / -1;
}

/* ─── Static Pages (Privacy, Support) ────────────────────── */

.static-page {
  max-width: 720px;
  margin: 0 auto;
}

.static-page h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.static-page .effective-date {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-bottom: 2rem;
}

.static-page h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.static-page p {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.static-page ul {
  color: var(--text-muted);
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.static-page a {
  color: var(--accent);
  text-decoration: none;
}

.static-page a:hover {
  text-decoration: underline;
}

/* ─── Footer ──────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ─── Admin Dashboard ────────────────────────────────────── */

body.admin {
  background: var(--bg);
}

body.admin nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
}

.admin-nav-link:hover {
  color: var(--accent);
}

.admin-nav-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: var(--font);
}

.admin-nav-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ─── Admin Login ────────────────────────────────────────── */

.admin-login {
  max-width: 380px;
  margin: 4rem auto;
  text-align: center;
}

.admin-login h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.admin-login-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.admin-login .admin-form {
  text-align: left;
}

/* ─── Admin Dashboard Table ──────────────────────────────── */

.admin-dashboard-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-dashboard-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

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

.admin-table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table-name {
  white-space: normal;
  min-width: 160px;
}

.admin-table tbody tr:hover {
  background: var(--surface);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table-slug {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: monospace;
}

.admin-table-actions {
  display: flex;
  gap: 0.375rem;
  white-space: nowrap;
}

/* ─── Admin Forms ────────────────────────────────────────── */

.admin-form-page {
  max-width: 600px;
  margin: 0 auto;
}

.admin-form-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.admin-form-slug {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-bottom: 1.5rem;
}

.admin-form-slug code {
  background: var(--surface);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.8125rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-form label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: -0.375rem;
}

.admin-form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: -0.25rem 0 0;
}

.admin-form-hint code {
  background: var(--surface);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="file"],
.admin-form textarea,
.admin-form select {
  padding: 0.625rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font);
  outline: none;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  border-color: var(--accent);
}

.admin-form textarea {
  resize: vertical;
  min-height: 80px;
}

.admin-checkbox-row {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.admin-checkbox-row label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.admin-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ─── Admin File Info ────────────────────────────────────── */

.admin-file-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.admin-file-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.375rem 1rem;
  font-size: 0.875rem;
}

.admin-file-info dt {
  color: var(--text-muted);
  font-weight: 500;
}

.admin-file-info code {
  font-size: 0.8125rem;
  background: var(--bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

/* ─── Admin Danger Zone ──────────────────────────────────── */

.admin-danger-zone {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.admin-danger-zone p {
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.admin-danger-zone dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.375rem 1rem;
  font-size: 0.8125rem;
}

.admin-danger-zone dt {
  color: var(--text-muted);
  font-weight: 500;
}

.admin-danger-zone code {
  font-size: 0.8125rem;
}

/* ─── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: all 0.15s ease;
}

.btn-small {
  padding: 0.3125rem 0.625rem;
  font-size: 0.75rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ─── Flash Messages ─────────────────────────────────────── */

.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.flash-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--official);
}

.flash-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}
