:root {
  --card-bg: #020617;
  --accent: #22c55e;
  --accent-soft: #16a34a;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
  --error: #f97373;
  --radius: 10px;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0d1322;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

main.container {
  /* main should take all remaining space between top and footer */
  flex: 1 0 auto;
}

.site-footer {
  border-bottom: 1px solid var(--border);
}

.site-footer {
  padding: 1.5rem 1.5rem 1.75rem;
  font-size: 0.8rem;
  color: var(--muted-text, #9ca3af);
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: none;
  margin-top: 2rem;
  flex-shrink: 0;
  margin-bottom: 0;
}

.site-footer a {
  color: var(--accent, #22c55e);
  text-decoration: underline;
}

.site-footer a:hover {
  text-decoration: none;
}

.footer-separator {
  margin: 0 0.35rem;
  opacity: 0.6;
  user-select: none;     /* cannot highlight/select */
  pointer-events: none;  /* no click / hover change */
  cursor: default;       /* no link-style cursor */
}

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

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
}

.tagline {
  color: var(--muted);
  margin-bottom: 2rem;
}

.primary-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #0f172a;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.primary-button:hover {
  filter: brightness(1.05);
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.5rem;
}

.form-field {
  margin-bottom: 0.55rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

input[type='text'],
input[type='password'],
input[type="number"],
select {
  width: 100%;
  padding: 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
}

/* Custom dropdown arrow with extra padding on the right */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* keep your existing background color */
  background-color: #020617;

  /* custom SVG arrow, light gray, theme-friendly */
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23e5e7eb' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center; /* ← controls how far from the right edge */
  background-size: 10px;

  padding-right: 0.75rem; /* space so text doesn’t overlap arrow */
}

/* Smooth focus styles for fields (text, password, number, select, textarea) */
input[type='text'],
input[type='password'],
.form-field input[type="number"],
select,
textarea {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Soothing focus ring matching the theme */
input[type='text']:focus,
input[type='password']:focus,
.form-field input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
  background-color: #02081a;
}

.form-actions {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

/* Remove default spin buttons */
.form-field input[type="number"]::-webkit-outer-spin-button,
.form-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-field input[type="number"] {
  -moz-appearance: textfield;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

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

.listings-filter {
  margin: 0.75rem 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.listings-filter label {
  font-size: 0.9rem;
}

.listings-filter select {
  width: auto;        /* override global width: 100% */
  min-width: 180px;
  flex: 0 0 auto;     /* keep it only as wide as needed + min-width */
}

.listing-item {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
  background: #020617;
}

.listing-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* Type pills */
.pill--type-buy {
  background-color: #22c55e;   /* Buying */
  border-color: transparent;
  color: #020617;
}

.pill--type-sell {
  background-color: #fc0303;   /* Selling */
  border-color: transparent;
  color: #f9fafb;
}

/* Crypto pills */
.pill--crypto-btc {
  background-color: #f9931a;   /* BTC */
  border-color: transparent;
  color: #020617;
}

.pill--crypto-eth {
  background-color: #6d25e0;   /* ETH */
  border-color: transparent;
  color: #f9fafb;
}

.pill--crypto-sol {
  background-color: #1afa9c;   /* SOL */
  border-color: transparent;
  color: #020617;
}

.pill--crypto-bnb {
  background-color: #f1b80a;   /* BNB */
  border-color: transparent;
  color: #020617;
}

.pill--crypto-usdt {
  background-color: #039292;   /* USDT */
  border-color: transparent;
  color: #e5e7eb;
}

.pill--crypto-usdc {
  background-color: #2677cb;   /* USDC */
  border-color: transparent;
  color: #e5e7eb;
}

.summary-list {
  list-style: none;
  padding: 0;
}

.summary-list li {
  margin-bottom: 0.35rem;
}

.donation-list {
  list-style: none;
  padding: 0;
}

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

.error {
  color: var(--error);
  margin-bottom: 1rem;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.admin-table th,
.admin-table td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #020617;
}

.admin-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

/* works for both <button> and <a> */
.admin-tab {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none; /* <<< no underline */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-tab:visited {
  color: var(--text);
  text-decoration: none;
}

.admin-tab:hover {
  text-decoration: none;
}

.admin-tab.active {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent-soft);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.admin-button {
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.admin-button--approve {
  background: var(--accent);
  border-color: var(--accent-soft);
  color: #0f172a;
}

.admin-button--decline {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.admin-button--delete {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.4);
  color: #e5e7eb;
}

.admin-button--block {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

.admin-button--unblock {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
}

.admin-tab-panel-hidden {
  display: none;
}

.faq-item h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.faq-item p {
  font-size: 0.9rem;
  color: var(--muted-text, #9ca3af);
}

.faq-list {
  margin-top: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.4);
}

.faq-item + .faq-item {
  border-top: 1px solid var(--border);
}

.faq-item-header {
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.faq-question {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Hide the radio controls */
.faq-toggle {
  display: none;
}

/* Icon (plus/minus) defined via ::before */
.faq-icon::before {
  content: '+';
  font-size: 1rem;
  opacity: 0.8;
}

/* Answer hidden by default */
.faq-answer {
  display: none;
  padding: 0 1rem 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--muted-text, #9ca3af);
}

/* When the radio is checked, show answer */
.faq-toggle:checked ~ .faq-answer {
  display: block;
}

/* When radio is checked, change icon to minus */
.faq-toggle:checked + .faq-item-header .faq-icon::before {
  content: '−';
}

a {
  color: var(--accent);
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  font-size: 0.85em;
}

hr {
  border: none;               /* remove default styling */
  height: 1px;
  background-color: #9ca3af;  /* your desired color */
}

/* Tighten layout on very small screens */
@media (max-width: 355px) {
  /* Outer cards (including Active listings) */
  .card {
    padding: 1rem;          /* was 1.5rem */
  }

  /* Listing cards inside the Active listings card */
  .listing-item {
    padding: 0.75rem;       /* slightly tighter */
  }

  /* Force a single column and allow shrinking below 260px */
  .listings-grid {
    grid-template-columns: 1fr;   /* no min-width constraint */
  }

  /* Make sure nothing overflows horizontally */
  .card,
  .listings-grid,
  .listing-item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}