/* Base */
:root {
  --bg: #0b0d10;
  --surface: #111418;
  --text: #e6e8eb;
  --muted: #96a0aa;
  --primary: #7c5cff;
  --primary-700: #6a49ff;
  --ring: rgba(124, 92, 255, 0.35);
  --border: #1b2026;
  --font-family: 'Source Serif 4', Georgia, 'Times New Roman', Times, serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 12px;
  color: var(--text);
  background: 
    /* Purple glow top-left */
    radial-gradient(70% 60% at 110% 50%, rgba(26, 72, 255, 0.10), transparent 60%),
    /* Base */
    linear-gradient(180deg, #0b0d10, #0b0d10);
  /* Ensure background scrolls with content (avoid fixed jitter) */
  background-attachment: scroll;
}

/* Layout */
.app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #181b20, #0f1216);
  color: var(--text);
  font-weight: 700; /* bolder text */
  text-decoration: none; /* prevent underline when used as <a> */
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 6px 18px -10px rgba(0, 0, 0, 0.8);
  transition: background 120ms ease, filter 120ms ease, transform 60ms ease, box-shadow 120ms ease;
}
.btn:link,
.btn:visited { text-decoration: none; }
.btn:hover {
  filter: brightness(1.06);
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.18);
  outline-offset: 2px;
}

/* Primary (black/graphite) */
.btn.primary {
  background: linear-gradient(180deg, #1e2228, #0b0d10);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 28px -14px rgba(0, 0, 0, 0.9);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #222730, #0e1115);
}
.btn.primary:active {
  background: linear-gradient(180deg, #1b1f25, #0a0c0f);
}
/* Outline (subtle border, transparent) */
.btn.outline {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.btn.outline:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

/* Light (white/gray) */
.btn.light {
  color: #0b0d10;
  background: linear-gradient(180deg, #ffffff, #f1f3f5);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 24px -14px rgba(0, 0, 0, 0.4);
}
.btn.light:hover {
  background: linear-gradient(180deg, #ffffff, #e9ecef);
}
.btn.light:active {
  background: linear-gradient(180deg, #f8f9fa, #e6e9ed);
}

/* Search */
.search-form {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 720px;
  margin: 20px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 8px 32px -16px rgba(0, 0, 0, 0.6), 0 10px 30px -18px var(--ring);
}
.leading-icon {
  position: absolute;
  left: 16px;
  color: var(--muted);
}
.search-input {
  width: 100%;
  height: 56px;
  padding: 0 54px 0 46px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  outline: none;
}
.search-input::placeholder {
  color: #7e8894;
}
.clear-btn {
  position: absolute;
  right: 8px;
  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.clear-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.search-input:not(:placeholder-shown) ~ .clear-btn {
  display: inline-flex; /* show when user typed */
}
.search-form.has-value .clear-btn {
  display: inline-flex; /* JS fallback for browsers without :placeholder-shown */
}
  .hint {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    color: var(--muted);
    margin-top: 12px;
    font-size: 14px;
  }

  /* --- Stats Section --- */
  .stats {
    margin: 2rem 0;
    text-align: center;
  }
  .stats-title {
    margin: 0 0 1.2rem;
    text-align: center;
    font-size: clamp(1.8rem, 4.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.01em;
  }
  .stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.35); /* green border */
    background: rgba(34, 197, 94, 0.12);       /* faded green */
    color: #22c55e; 
    margin: 1rem 0 3rem 0; 
  }
  .stats-grid {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
  .stats-grid .stat {
    border: none;                 /* remove border */
    border-radius: 0;             /* no rounding since no border */
    background: none;             /* clean background */
    text-align: center;
  }
  .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
    font-family: var(--font-family);
  }
  .stat-label {
    color: var(--muted);
    font-size: 1.2rem;
    font-weight: 400;
  }
  

/* --- About Short Section --- */
.about-short {
  padding: 36px 0 64px;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* equal widths */
  gap: 28px;
  align-items: stretch; /* same height */
}
.about-media {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;           /* clip image corners */
  height: 100%;               /* match right column height */
}
.about-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* fill and crop */
  display: block;
}
.about-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  padding: 2rem;
  height: 100%;               /* defines row height so image matches */
  display: grid;
  align-content: start;
  gap: 12px;
}
.about-title {
  margin: 0 0 6px;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
}
.about-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 400;
  text-align: center;
}
.about-list {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* two cards side-by-side */
}
.about-list li {
  display: grid;
  grid-auto-rows: max-content;
  align-items: start;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(64, 132, 255, 0.12), rgba(64, 132, 255, 0.06)); /* faded blue-ish gradient */
  text-align: left;
}

/* Icon row inside card */
.about-list li > .material-symbols-outlined {
  display: block;
  font-size: 28px;
  line-height: 1;
  color: #8db3ff; /* soft blue accent */
}

/* Title row */
.about-list li > .card-title {
  margin: 1rem 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Description row */
.about-list li > .card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 400;
}
  .about-cta {
    display: flex;
    gap: 10px;
    justify-content: center; /* center the Read more button */
    margin: 4px 0 6px;
  }
  
  /* --- CTA Section --- */
  .cta-section {
    margin: 5rem 0;
    padding: 2rem 0;
    text-align: center;
  }
  .cta-title {
    margin: 0 0 10px;
    font-size: 4rem;
    font-weight: 800;
    text-align: center;
  }
  .cta-desc {
    margin: 0 auto 18px;
    max-width: 780px;
    color: var(--muted);
    font-size: clamp(1.1rem, 2.2vw, 1.3rem);
    line-height: 1.6;
  }
  .cta-actions {
    display: flex;
    justify-content: center;
  }
  .cta-btn {
    height: 48px;
    padding: 0 18px;
    font-size: 1.1rem;
  }
  

  /* Hide native browser clear (x) icon for search inputs; we use our own .clear-btn */
  .search-input::-webkit-search-decoration,
  .search-input::-webkit-search-cancel-button,
  .search-input::-webkit-search-results-button,
  .search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
  }
  .search-input::-ms-clear,
  .search-input::-ms-reveal {
    display: none;
    width: 0;
    height: 0;
  }

/* --- Feedback Form --- */
.feedback-form { margin: 0 0 5rem; }
.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  max-width: 900px;
  margin: 0 auto;
}
.form-full { grid-column: 1 / -1; }
.form-field { display: grid; gap: 6px; }
.form-field label { font-weight: 700; }
.form-field select,
.form-field textarea,
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="search"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-family);
  font-size: 1rem;
  outline: none;
  box-shadow: 0 8px 24px -18px rgba(0,0,0,0.8);
}
.form-field select:focus,
.form-field textarea:focus,
.form-field input[type="text"]:focus,
.form-field input[type="email"]:focus,
.form-field input[type="search"]:focus { box-shadow: 0 0 0 3px var(--ring); }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 6px;
}
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
  @media (max-width: 720px) {
    .form-grid { grid-template-columns: 1fr; }
  }

  /* --- About Page Body --- */
  .about-body { padding: 0 0 64px; }
  .about-body .about-body-container {
    max-width: 900px;
    margin: 0 auto;
  }
  .about-body .about-title { /* override centered title in body */
    text-align: left;
    margin-top: 1.8rem;
  }
  .about-body p {
    margin: 0 0 1rem;
    line-height: 1.50;
    color: var(--muted);
    font-size: 1.3rem;
  }
  .about-body .about-lead {
    color: var(--muted);
    font-size: 1.15rem;
    text-align: left;
  }

  /* --- Promo Card (About marketplace teaser) --- */
  .promo { padding: 8px 0 64px; }
  .promo .promo-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    padding: 24px;
    display: grid;
    gap: 10px;
    text-align: center;
    overflow: hidden; /* clip child media to rounded corners */
  }
  .promo .promo-title {
    margin: 1rem auto 2rem auto;
    font-size: 3.5rem;
    font-weight: 700;
    max-width: 40%;
    line-height: 1;
  }
  .promo .promo-desc {
    margin: 0 auto 2rem auto;
    color: var(--muted);
    font-size: 1.2rem;
    font-weight: 400;
    max-width: 60%;
  }
  .promo .promo-media { margin: -4px -4px 8px; }
  .promo .promo-media img {
    width: 100%;
    max-width: 20%;
    height: auto;
    display: block;
    margin: 1rem auto;
  }
  .promo .actions { justify-content: center; }

/* --- Home Cards Section --- */
.home-cards { margin: 5rem auto 2rem auto; }
.home-cards .panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  padding: 16px;
}
.home-cards .panel + .panel { margin-top: 16px; }
.home-cards .panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.home-cards .dash-heading { margin:0; font-size: 1.6rem; font-weight: 800; }

  /* Compact search when embedded in the home cards panel head */
  .home-cards .panel-head .search { padding: 0; margin: 0; flex: 1; }
  .home-cards .panel-head .search .container { padding: 0; margin: 0; width: 100%; }
  .home-cards .panel-head .search-form {
    margin: 0;
    max-width: 100%;
    border-radius: 14px;
    box-shadow: 0 10px 36px -18px rgba(0, 0, 0, 0.75), 0 10px 28px -16px var(--ring);
  }
  .home-cards .panel-head .search-form .leading-icon {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
  }
  .home-cards .panel-head .search-input {
    height: 48px;
    padding: 0 48px 0 38px;
    font-size: 16px;
  }
  .home-cards .panel-head .clear-btn {
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
  }

  /* Inline filters styling */
  .home-cards .panel-head .filters { display:flex; align-items:center; gap:8px; }
  .home-cards .panel-head .filter-select {
    height: 40px;
    padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    outline: none;
    box-shadow: 0 6px 20px -16px rgba(0,0,0,0.8);
  }
  .home-cards .panel-head .filter-select:focus { box-shadow: 0 0 0 3px var(--ring); }

  /* Icon-only action buttons on the right */
  .home-cards .panel-head .actions { gap: 6px; }
  .home-cards .panel-head .actions .icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .home-cards .panel-head .actions .icon-btn .material-symbols-outlined { font-size: 22px; line-height: 1; }

  /* Responsive: wrap controls on small screens */
  @media (max-width: 720px) {
    .home-cards .panel-head { flex-wrap: wrap; }
    .home-cards .panel-head .search { order: 1; width: 100%; }
    .home-cards .panel-head .filters { order: 2; width: 100%; }
    .home-cards .panel-head .actions { order: 3; width: 100%; justify-content: flex-end; margin-top: 8px; }
  }

/* Minimal table styling to match admin-table look */
.home-cards .admin-table { width: 100%; border-collapse: collapse; }
.home-cards .admin-table thead th {
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  font-size: 1.2rem;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.home-cards .admin-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.home-cards .admin-table tbody tr:last-child td { border-bottom: none; }

/* Hover popover for image icon (homepage list view) */
.home-cards .img-icon.with-preview { position: relative; display: inline-flex; align-items: center; }
.home-cards .img-icon.with-preview .img-popover {
  display: none;
  position: absolute;
  left: 40px;
  top: -4px;
  z-index: 10;
  padding: 6px;
  background: rgba(15, 18, 22, 0.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.home-cards .img-icon.with-preview:hover .img-popover { display: block; }

/* Card grid meta (homepage) */
.home-cards .card-tile { display: grid; gap: 8px; }
.home-cards .card-meta { padding: 6px 2px 0; }
.home-cards .card-title { margin: 6px 0 2px; font-weight: 800; font-size: 1rem; text-align: left; }
.home-cards .card-row { display: grid; grid-template-columns: 1fr auto; align-items: center; color: var(--muted); font-size: 0.95rem; }
.home-cards .card-row .rarity { justify-self: start; }
.home-cards .card-row .number { justify-self: end; }
