/* ============================================================
   iBid — "Night Auction" design system
   Dark trading-floor aesthetic: near-black surfaces, warm gold,
   pulsing live-green, mono numerals for money and time.
   ============================================================ */

:root {
  --ink: #0a0c10;
  --surface: #12161d;
  --surface-2: #1a202b;
  --surface-3: #222a37;
  --line: #242d3c;
  --gold: #f0b541;
  --gold-bright: #ffd166;
  --gold-dim: #8a6a2a;
  --live: #3ddc84;
  --danger: #ff5d5d;
  --info: #5db9ff;
  --text: #e9e7e1;
  --muted: #8b93a3;
  --radius: 14px;
  --font-display: "Syne", sans-serif;
  --font-body: "Archivo", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

/* ---- Bootstrap dark-mode variable overrides ---- */
[data-bs-theme="dark"] {
  --bs-body-bg: var(--ink);
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-link-color: var(--gold-bright);
  --bs-link-hover-color: #fff;
  --bs-emphasis-color: #fff;
}

html { font-size: 15px; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(240, 181, 65, 0.07), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(61, 220, 132, 0.05), transparent 55%),
    var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

h1, h2, h3, .navbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 { margin-bottom: 1rem; }

/* ---- Navbar ---- */
.navbar {
  background: rgba(10, 12, 16, 0.85) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--text) !important;
}

.navbar-brand .brand-dot { color: var(--gold); }

.navbar .nav-link {
  color: var(--muted) !important;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.45rem 0.85rem !important;
  transition: color 0.15s ease, background 0.15s ease;
}

.navbar .nav-link:hover {
  color: var(--text) !important;
  background: var(--surface-2);
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  border-color: var(--gold-dim);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.card-img-top { border-radius: var(--radius) var(--radius) 0 0; }

/* ---- Buttons ---- */
.btn { border-radius: 10px; font-weight: 600; }

.btn-primary {
  --bs-btn-bg: var(--gold);
  --bs-btn-border-color: var(--gold);
  --bs-btn-color: #161102;
  --bs-btn-hover-bg: var(--gold-bright);
  --bs-btn-hover-border-color: var(--gold-bright);
  --bs-btn-hover-color: #161102;
  --bs-btn-active-bg: var(--gold-bright);
  --bs-btn-active-border-color: var(--gold-bright);
  --bs-btn-active-color: #161102;
}

.btn-success {
  --bs-btn-bg: var(--live);
  --bs-btn-border-color: var(--live);
  --bs-btn-color: #04150c;
  --bs-btn-hover-bg: #5ce89a;
  --bs-btn-hover-border-color: #5ce89a;
  --bs-btn-hover-color: #04150c;
  --bs-btn-active-bg: #5ce89a;
  --bs-btn-active-border-color: #5ce89a;
  --bs-btn-active-color: #04150c;
}

.btn-outline-primary {
  --bs-btn-color: var(--gold);
  --bs-btn-border-color: var(--gold-dim);
  --bs-btn-hover-bg: var(--gold);
  --bs-btn-hover-border-color: var(--gold);
  --bs-btn-hover-color: #161102;
}

/* ---- Status badges ---- */
.badge { font-weight: 600; letter-spacing: 0.03em; border-radius: 7px; }

.badge.bg-success {
  background: rgba(61, 220, 132, 0.15) !important;
  color: var(--live);
  border: 1px solid rgba(61, 220, 132, 0.4);
}

.badge.bg-info {
  background: rgba(93, 185, 255, 0.12) !important;
  color: var(--info);
  border: 1px solid rgba(93, 185, 255, 0.35);
}

.badge.bg-warning {
  background: rgba(240, 181, 65, 0.14) !important;
  color: var(--gold-bright);
  border: 1px solid rgba(240, 181, 65, 0.4);
}

.badge.bg-danger {
  background: rgba(255, 93, 93, 0.12) !important;
  color: var(--danger);
  border: 1px solid rgba(255, 93, 93, 0.35);
}

.badge.bg-secondary, .badge.bg-light {
  background: var(--surface-3) !important;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* Pulsing dot for LIVE */
.badge.bg-success::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--live);
  animation: live-pulse 1.4s ease-in-out infinite;
  vertical-align: 1px;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); }
  60% { box-shadow: 0 0 0 6px rgba(61, 220, 132, 0); }
}

/* ---- Money & time: always mono ---- */
.price, #current-price, #countdown, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

#current-price {
  font-weight: 700;
  color: var(--gold-bright);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

#countdown {
  font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--danger);
  letter-spacing: 0.06em;
}

#countdown.bg-warning {
  background: transparent !important;
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(240, 181, 65, 0.7);
}

/* ---- Bid console ---- */
.bid-console {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  position: sticky;
  top: 84px;
}

.bid-console .input-group .form-control {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
}

#bid-history { max-height: 320px; overflow-y: auto; }

#bid-history .list-group-item {
  background: transparent;
  border-color: var(--line);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  animation: bid-in 0.35s ease;
}

@keyframes bid-in {
  from { opacity: 0; transform: translateY(-6px); background: rgba(240, 181, 65, 0.12); }
  to { opacity: 1; transform: none; }
}

/* ---- Forms ---- */
.form-control, .form-select {
  background: var(--surface-2);
  border-color: var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
}

.form-control:focus, .form-select:focus {
  background: var(--surface-2);
  border-color: var(--gold);
  box-shadow: 0 0 0 0.2rem rgba(240, 181, 65, 0.15);
}

.form-label { color: var(--muted); font-weight: 500; font-size: 0.92rem; }

/* ---- Auth / narrow page card ---- */
.page-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.btn-google:hover { background: #ececec; color: #1f1f1f; }

.divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 1.2rem 0;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---- Tables ---- */
.table { --bs-table-bg: transparent; border-color: var(--line); }
.table > :not(caption) > * > * { border-bottom-color: var(--line); padding: 0.7rem 0.75rem; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: rgba(255, 255, 255, 0.02); }
.table thead th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

/* ---- Alerts ---- */
.alert { border-radius: var(--radius); border-width: 1px; }
.alert-info { background: rgba(93, 185, 255, 0.08); border-color: rgba(93, 185, 255, 0.3); color: #bfe1ff; }
.alert-success { background: rgba(61, 220, 132, 0.08); border-color: rgba(61, 220, 132, 0.3); color: #b8f2d3; }
.alert-warning { background: rgba(240, 181, 65, 0.08); border-color: rgba(240, 181, 65, 0.3); color: #f6dfa9; }
.alert-danger { background: rgba(255, 93, 93, 0.08); border-color: rgba(255, 93, 93, 0.3); color: #ffc4c4; }

/* ---- Hero (home) ---- */
.hero { padding: 3.2rem 0 2.4rem; }

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
}

.hero h1 .accent { color: var(--gold); }

.hero p { color: var(--muted); font-size: 1.05rem; max-width: 520px; }

/* Auction card meta */
.auction-card .card-title { font-size: 1.05rem; }
.auction-card .price { color: var(--gold-bright); font-weight: 700; font-size: 1.15rem; }
.auction-card .meta { color: var(--muted); font-size: 0.83rem; }

.countdown-chip {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--danger);
  background: rgba(255, 93, 93, 0.08);
  border: 1px solid rgba(255, 93, 93, 0.25);
  border-radius: 7px;
  padding: 0.15rem 0.5rem;
  display: inline-block;
}

/* Image placeholder when auction has no photo */
.img-placeholder {
  height: 180px;
  border-radius: var(--radius) var(--radius) 0 0;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(240, 181, 65, 0.05) 14px 15px),
    linear-gradient(160deg, var(--surface-2), var(--surface-3));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dim);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
}

/* ---- Stat cards (admin dashboard) ---- */
.stat-card h1 {
  font-family: var(--font-mono);
  color: var(--gold-bright);
  font-size: 2.4rem;
}

.stat-card p { color: var(--muted); margin-bottom: 0.6rem; }

/* ---- Admin dashboard: count tiles + menu cards ---- */
.dash-label { color: var(--muted); font-size: 0.85rem; margin: 1.6rem 0 0.6rem; }
/* Phones: 2 count tiles / 1 menu card per row; tablets 2 menu cards; desktop 4 tiles / 3 cards. */
.dash-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid.menu { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 576px) { .dash-grid.menu { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) {
  .dash-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-grid.menu { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.dash-tile {
  display: block; height: 100%; padding: 1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s;
}
.dash-tile:hover { border-color: var(--gold-dim); color: var(--text); }
.dash-tile:active { transform: translateY(1px); }
.dash-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.dash-tile .label, .dash-tile .desc { color: var(--muted); font-size: 0.85rem; }
.dash-tile .count { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 700; line-height: 1.2; }
.dash-tile.attention { border-color: var(--gold-dim); background: rgba(240, 181, 65, 0.08); }
.dash-tile.attention .count { color: var(--gold-bright); }
.dash-tile .bi { font-size: 1.35rem; color: var(--gold); }
.dash-tile .name { font-weight: 600; margin-top: 0.4rem; }
@media (max-width: 575px) {
  .dash-grid { gap: 0.6rem; }
  .dash-tile { padding: 0.85rem 0.9rem; }
  .dash-tile .count { font-size: 1.5rem; }
}

/* ---- dl rows ---- */
dl.row dt { color: var(--muted); font-weight: 500; }

/* ---- Admin member detail ---- */
.member-hero {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem 1.6rem;
}
.avatar {
  width: 60px; height: 60px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.4rem;
  color: #161102; background: linear-gradient(160deg, var(--gold-bright), var(--gold-dim));
}
.member-hero .who h2 { margin: 0; line-height: 1.12; }
.member-hero .who .email { color: var(--muted); font-size: 0.92rem; }
.hero-stats { display: flex; gap: 1.7rem; margin-left: auto; text-align: right; }
.hero-stats .label { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.hero-stats .val { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; color: var(--text); }

.section-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 0 0 1rem; }

.verdict {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.8rem 1rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); margin-bottom: 1.2rem;
}
.verdict .v-text { color: var(--muted); font-size: 0.9rem; }

.meter { flex: 1; min-width: 120px; height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 6px; }

.cmp-head, .cmp-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 0.6rem; align-items: center; padding: 0.55rem 0.25rem; }
.cmp-row { border-top: 1px solid var(--line); }
.cmp-head { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; }
.cmp-label { color: var(--muted); font-weight: 500; }
.cmp-entered, .cmp-detected { font-size: 0.95rem; word-break: break-word; }
.cmp-entered { font-family: var(--font-mono); }
.match-yes { color: var(--live); font-weight: 600; }
.match-no { color: var(--danger); font-weight: 600; }
.match-na { color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 0.45rem; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.75rem;
  font-size: 0.85rem; margin: 0 0.35rem 0.4rem 0; text-decoration: none;
}
.chip:hover { border-color: var(--gold-dim); }

.points-list { list-style: none; margin: 0; padding: 0; }
.points-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.points-list li:first-child { border-top: 0; }
.points-list .pts { font-family: var(--font-mono); color: var(--live); font-weight: 700; }
.points-list .when { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

.empty-state { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.empty-state .big { font-size: 2rem; display: block; margin-bottom: 0.3rem; }

@media (max-width: 575px) {
  .hero-stats { margin-left: 0; width: 100%; justify-content: flex-start; text-align: left; gap: 1.3rem; }
  .cmp-head { display: none; }
  .cmp-row { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--line) !important;
  color: var(--muted);
  padding: 1.1rem 0;
  font-size: 0.85rem;
  margin-top: 3rem;
  position: static !important;
  white-space: normal;
  line-height: inherit;
}

/* ---- Indicator banners ---- */
#highest-indicator, #outbid-indicator { font-weight: 600; }

/* ---- Responsive tweaks ---- */
@media (max-width: 767px) {
  .bid-console { position: static; }
  .hero { padding: 2rem 0 1.4rem; }
  .page-card { padding: 1.4rem; }
}

::selection { background: rgba(240, 181, 65, 0.35); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--line); }
