/* =========================================
   GOFTED — Global Styles
   ========================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; max-width: 100%; }


:root {
  /* Gofted brand colours — updated 24 April 2026 */
  --primary: #0D9E7E;        /* Teal/green — Gofted primary brand */
  --primary-mid: #0bb891;    /* Slightly lighter for hovers */
  --primary-light: #E6F7F4;  /* Soft teal tint */
  --accent: #FF6B6B;         /* Coral/orange accent */
  --accent-mid: #FF8E53;     /* Orange gradient end */

  /* Gradient — hero and key CTAs */
  --gradient: linear-gradient(135deg, #0D9E7E 0%, #0bb891 100%);

  /* Keep --green aliased to primary for any legacy references */
  --green: #0D9E7E;
  --green-mid: #0bb891;
  --green-light: #E6F7F4;

  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #1A1A1A;
  --muted: #6c757d;
  --border: #e9ecef;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 4px;
  --radius-sm: 3px;
  --font: 'DM Sans', 'Inter', -apple-system, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---- NAV ---- */
nav {
  background: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 1rem;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 64px;
}

.nav-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-logo .logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.nav-logo .logo-tag {
  font-size: 0.65rem;
  color: #666;
  letter-spacing: 0.5px;
}

.nav-search {
  flex: 1;
  max-width: 480px;
}
.nav-search form {
  display: flex;
  position: relative;
}
.nav-search input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.5rem;
  border: 1.5px solid #2a2a2a;
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: #141414;
  color: #ddd;
  outline: none;
  transition: border-color 0.2s;
}
.nav-search input:focus { border-color: var(--green); }
.nav-search input::placeholder { color: #444; }
.nav-search .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 0.9rem;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.18s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
/* Primary: outlined teal only — no solid fill */
.btn-green { background: transparent; color: var(--green); border-color: var(--green); }
.btn-green:hover { background: var(--green); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--green); border-color: var(--green); }
.btn-outline:hover { background: var(--green); color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: #ccc; border-color: #444; }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.btn-white { background: transparent; color: #fff; border-color: #fff; }
.btn-white:hover { background: rgba(255,255,255,0.1); text-decoration: none; color: #fff; }
.btn-outline-white { background: transparent; color: #ccc; border-color: #444; }
.btn-outline-white:hover { border-color: #888; color: #fff; text-decoration: none; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.7rem 1.75rem; font-size: 0.95rem; }
.btn-danger { background: transparent; color: #dc3545; border-color: #dc3545; }
.btn-danger:hover { background: #dc3545; color: #fff; }

/* ---- CARDS ---- */
.listing-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: none;
  overflow: hidden;
  transition: box-shadow 0.18s, border-color 0.18s;
  cursor: pointer;
  position: relative;
}
.listing-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); border-color: #bbb; }
.listing-card-featured { border-color: var(--green); }
.listing-card-featured:hover { border-color: var(--green); }
.listing-featured-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--green);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  z-index: 1;
}

.listing-card-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center;
  background: #f9f9f9;
}
.listing-card-img-placeholder {
  width: 100%;
  height: 240px;
  background: linear-gradient(135deg, #e8f5e9, #d8f3dc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.listing-card { display: flex; flex-direction: column; height: 100%; }
.listing-card-body { padding: 0.85rem; display: flex; flex-direction: column; flex: 1; }

.listing-card-brand {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
}
.listing-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.listing-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}

/* Condition badges — text only, no pills */
.badge {
  display: inline-block;
  padding: 0;
  border-radius: 0;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  background: none !important;
}
.badge-vgood { color: #059669; }
.badge-good { color: #2563eb; }
.badge-newt { color: #d97706; }
.badge-newwt { color: #7c3aed; }
.badge-satisfactory { color: #dc2626; }

.location-text { font-size: 0.78rem; color: var(--muted); }

.save-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem;
  color: var(--muted);
  transition: color 0.15s;
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.save-btn:hover, .save-btn.saved { color: #e83e8c; }

/* ---- GRID ---- */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 1024px) { .listings-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .listings-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .listings-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- CONTAINER ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; box-sizing: border-box; width: 100%; }
.section { padding: 2.5rem 0; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--green); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }

/* ---- ALERTS ---- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ---- TABS ---- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  padding: 0.75rem 1.25rem;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.tab-btn.active { color: var(--green); border-color: var(--green); }
.tab-btn:hover { color: var(--green); }
.tab-panel { display: none; padding: 1.5rem 0; }
.tab-panel.active { display: block; }

/* ---- FOOTER ---- */
footer, .site-footer {
  background: #0a0a0a;
  color: #444;
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
  margin-top: 4rem;
  border-top: 1px solid #151515;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.25rem;
  margin-bottom: 1.25rem;
}
.footer-links a {
  color: #555;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.15s;
}
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-copy { margin: 0; color: #333; font-size: 0.75rem; }
footer a { color: #555; }
footer a:hover { color: #fff; }

/* ---- STATUS BADGES ---- */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}
.status-active { background: #d1fae5; color: #065f46; }
.status-sold { background: #fee2e2; color: #991b1b; }
.status-awaiting { background: #fef3c7; color: #92400e; }
.status-shipped { background: #dbeafe; color: #1e40af; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-pending { background: #f3e8ff; color: #6b21a8; }
.status-accepted { background: #d1fae5; color: #065f46; }
.status-accepted_paid { background: #d1fae5; color: #065f46; }
.status-declined { background: #fee2e2; color: #991b1b; }

/* ---- MISC ---- */
.page-title { font-size: 1.6rem; font-weight: 800; color: var(--text); margin-bottom: 0.25rem; }
.page-sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.star { color: #f59e0b; }

/* ---- SPINNER ---- */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Desktop/mobile visibility helpers */
.mobile-only { display: none !important; }
.desktop-only { display: inline-flex !important; }

/* Nav dropdown (mobile menu) */
/* Nav user pill button */
.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1.5px solid #333;
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem 0.35rem 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ccc;
  transition: border-color 0.15s;
}
.nav-user-btn:hover { border-color: var(--green); color: #fff; }
.nav-user-icon { font-size: 1rem; }
.nav-user-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-caret { font-size: 0.7rem; color: var(--muted); }

/* ---- HAMBURGER MENU ---- */
.hamburger-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1.5px solid #333;
  border-radius: var(--radius);
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
}
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: #ccc;
  border-radius: 2px;
  transition: background 0.15s;
}
.hamburger-btn:hover span { background: #fff; }

.hamburger-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 299;
}
.hamburger-overlay.open { display: block; }

.hamburger-menu {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 90vw;
  height: 100vh;
  background: #111;
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
  overflow-y: auto;
}
.hamburger-menu.open { right: 0; }

.hamburger-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #222;
}
.hamburger-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.hamburger-close:hover { color: #fff; }

.hamburger-menu-links {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
}
.hamburger-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ccc;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.hamburger-menu-item:hover { background: #1a1a1a; color: #fff; text-decoration: none; }
.hamburger-menu-icon { font-size: 1.1rem; width: 1.4rem; text-align: center; }
.hamburger-menu-cta { color: var(--primary); }
.hamburger-menu-cta:hover { color: var(--primary-mid); }
.hamburger-menu-logout { color: #888; }
.hamburger-menu-logout:hover { color: #ff6b6b; }
.hamburger-menu-divider {
  height: 1px;
  background: #222;
  margin: 0.5rem 0;
}
/* ---- END HAMBURGER MENU ---- */

.nav-user-wrapper { position: relative; display: inline-flex; }
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #111;
  border: 1px solid #222;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 200;
  min-width: 170px;
  flex-direction: column;
  overflow: hidden;
}
.nav-dropdown.open { display: flex; }
.nav-dropdown a {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ccc;
  text-decoration: none;
  border-bottom: 1px solid #1e1e1e;
}
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover { background: #1a1a1a; color: #fff; }

/* Make nav position relative so dropdown anchors correctly */
nav { position: relative; }

/* Responsive nav */
@media (max-width: 640px) {
  .section { padding: 1.25rem 0; }
  .listing-card-img { height: 200px; object-fit: cover; background: #f9f9f9; }
  nav { padding: 0; }
  .nav-inner { padding: 0 0.75rem; width: 100%; box-sizing: border-box; }
  .nav-search { display: none !important; }
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }
  .nav-account-icon { display: flex !important; }
  .nav-actions { gap: 0.4rem; flex-shrink: 0; }
  .nav-logo img { height: 28px !important; }
}

/* Mobile account icon — hidden on desktop, shown on mobile */
.nav-account-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}

/* Toggle */
.toggle-group {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  width: fit-content;
}
.toggle-group label {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--muted);
  margin: 0;
}
.toggle-group input { display: none; }
.toggle-group input:checked + label {
  background: var(--green);
  color: #fff;
}

/* Admin table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th, .data-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th { font-weight: 700; color: var(--muted); background: var(--bg); }
.data-table tr:hover td { background: #fafafa; }
.data-table-wrap { overflow-x: auto; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 440px;
  width: 90%;
  position: relative;
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
}
