/* ==================================================================
   Giveaway Platform theme - dark / violet
   A thin layer over Bootstrap 5 (data-bs-theme="dark" is set on every
   <html> tag, so dropdowns/offcanvas/alerts/close-buttons/forms already
   render dark by default). This file overrides the brand variables and
   adds the handful of components Bootstrap does not ship (sidebar, stat
   tiles, giveaway cards).
   ================================================================== */

:root {
  --gp-ink:        #f1f2fb;
  --gp-ink-soft:   #8d92b3;
  --gp-line:       rgba(255,255,255,.09);
  --gp-canvas:     #0a0c18;
  --gp-surface:    #12142a;
  --gp-surface-2:  #191b38;
  --gp-brand:      #8b5cf6;   /* violet: primary action colour          */
  --gp-brand-dark: #7c4ce8;
  --gp-brand-tint: rgba(139,92,246,.14);
  --gp-pink:       #ec4899;   /* pairs with brand for accent gradients  */
  --gp-gold:       #f2b640;   /* prize pools and money highlights       */
  --gp-gold-tint:  rgba(242,182,64,.12);
  --gp-success:    #34d399;
  --gp-success-tint: rgba(52,211,153,.13);
  --gp-danger:     #f87171;
  --gp-danger-tint:  rgba(248,113,113,.13);
  --gp-info:       #38bdf8;
  --gp-info-tint:  rgba(56,189,248,.13);

  --bs-primary: #8b5cf6;
  --bs-primary-rgb: 139, 92, 246;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-bg: var(--gp-canvas);
  --bs-body-color: var(--gp-ink);
  --bs-border-color: var(--gp-line);
  --bs-border-radius: .6rem;
  --bs-link-color: #b79bff;
  --bs-link-hover-color: #cdb8ff;
  --bs-secondary-color: var(--gp-ink-soft);
  --bs-tertiary-bg: var(--gp-surface-2);
  --bs-emphasis-color: #fff;
}

body {
  font-family: var(--bs-body-font-family);
  color: var(--gp-ink);
  background: var(--gp-canvas);
  font-size: .95rem;
}

/* Money and counts line up in tables when the figures are tabular. */
.num, td.num, .stat-value, .sidebar-balance, .money {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.015em; color: #fff; }
a { text-decoration: none; }
.text-muted { color: var(--gp-ink-soft) !important; }

/* A phrase within a headline, gradient-lit rather than flat white. Used
   sparingly - one moment per page, never a whole sentence. */
.accent {
  background: linear-gradient(100deg, #c9b3ff 0%, var(--gp-brand) 45%, var(--gp-pink) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- buttons ---------- */
.btn { font-weight: 600; border-radius: .6rem; }
.btn-primary {
  --bs-btn-bg: linear-gradient(135deg, var(--gp-brand), #6d3ce0);
  background-image: linear-gradient(135deg, var(--gp-brand), #6d3ce0);
  --bs-btn-border-color: var(--gp-brand);
  --bs-btn-hover-bg: var(--gp-brand-dark);
  --bs-btn-hover-border-color: var(--gp-brand-dark);
  --bs-btn-active-bg: var(--gp-brand-dark);
  --bs-btn-active-border-color: var(--gp-brand-dark);
  --bs-btn-disabled-bg: var(--gp-brand);
  --bs-btn-disabled-border-color: var(--gp-brand);
  box-shadow: 0 6px 18px -8px rgba(139,92,246,.65);
}
.btn-primary:hover, .btn-primary:active { background-image: none; box-shadow: 0 8px 20px -6px rgba(139,92,246,.75); }
.btn-outline-primary {
  --bs-btn-color: #cbb8ff;
  --bs-btn-border-color: #5c4499;
  --bs-btn-hover-bg: var(--gp-brand);
  --bs-btn-hover-border-color: var(--gp-brand);
  --bs-btn-hover-color: #fff;
}
.btn-outline-dark, .btn-outline-light {
  --bs-btn-color: var(--gp-ink);
  --bs-btn-border-color: var(--gp-line);
  --bs-btn-hover-bg: var(--gp-surface-2);
  --bs-btn-hover-border-color: var(--gp-line);
  --bs-btn-hover-color: #fff;
}
.btn-icon {
  background: var(--gp-surface-2);
  border: 1px solid var(--gp-line);
  color: var(--gp-ink);
  border-radius: .55rem;
}
.btn-icon:hover { background: #22254a; color: #fff; }
.btn-wallet {
  background: var(--gp-brand-tint);
  color: #cbb8ff;
  border: 1px solid rgba(139,92,246,.35);
  font-weight: 700;
}
.btn-wallet:hover { background: rgba(139,92,246,.22); color: #fff; }

:focus-visible { outline: 2px solid var(--gp-brand); outline-offset: 2px; }

/* ---------- navbar ---------- */
.site-nav, .panel-nav {
  background: rgba(10,12,24,.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--gp-line);
  z-index: 1030;
}
.navbar-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: #fff; }
.navbar-brand:hover { color: #fff; }
.brand-logo {
  display: block; width: 176px; height: 42px; object-fit: contain;
}
.panel-brand-logo { width: 164px; height: 38px; }
.footer-brand-logo { width: 176px; height: 42px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: .55rem;
  background: linear-gradient(135deg, var(--gp-brand), var(--gp-pink)); color: #fff;
  display: grid; place-items: center; font-size: .85rem;
}
.brand-text { letter-spacing: -.02em; }
.site-nav .nav-link { font-weight: 600; color: var(--gp-ink-soft); }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: #fff; }
.nav-search { min-width: 240px; }
.nav-search .input-group-text { background: var(--gp-surface-2); border-right: 0; color: var(--gp-ink-soft); border-color: var(--gp-line); }
.nav-search .form-control { border-left: 0; }

.notif-dot {
  position: absolute; top: -5px; right: -5px;
  background: var(--gp-danger); color: #1a0505;
  font-size: .62rem; font-weight: 700;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; display: grid; place-items: center;
}

/* ---------- home hero ---------- */
.hero {
  background:
    radial-gradient(70% 90% at 82% -10%, rgba(139,92,246,.30) 0%, transparent 60%),
    radial-gradient(50% 60% at 8% 110%, rgba(236,72,153,.16) 0%, transparent 60%),
    var(--gp-canvas);
  color: #fff;
  padding: 4.5rem 0 6rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--gp-line);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--gp-brand-tint); border: 1px solid rgba(139,92,246,.4);
  color: #d8c9ff; font-size: .78rem; font-weight: 700;
  padding: .35rem .8rem; border-radius: 99px; margin-bottom: 1.1rem;
}
.hero-badge-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gp-success);
  box-shadow: 0 0 0 0 rgba(52,211,153,.6);
  animation: gp-pulse 2s ease-out infinite;
}
@keyframes gp-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.12; margin-bottom: 1rem; color: #fff; }
.hero p.lead { color: var(--gp-ink-soft); max-width: 54ch; }
.hero-stats { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.2rem; }
.hero-stats > div {
  background: var(--gp-surface); border: 1px solid var(--gp-line);
  border-radius: .7rem; padding: .7rem 1.1rem; min-width: 122px;
}
.hero-stat-value { font-size: 1.4rem; font-weight: 800; line-height: 1; color: #cbb8ff; }
.hero-stat-label { font-size: .74rem; color: var(--gp-ink-soft); margin-top: .3rem; }
.hero-search { max-width: 520px; margin-top: 2rem; }
.hero-search .form-control, .hero-search .btn { height: 48px; }
.hero-search .form-control {
  border: 1px solid var(--gp-line); background: var(--gp-surface); color: #fff;
  border-top-left-radius: 99px; border-bottom-left-radius: 99px; padding-left: 1.2rem;
}
.hero-search .form-control::placeholder { color: var(--gp-ink-soft); }
.hero-search .form-control:focus { background: var(--gp-surface); color: #fff; box-shadow: none; border-color: var(--gp-brand); }
.hero-search .btn { border-top-right-radius: 99px; border-bottom-right-radius: 99px; }

.section { padding: 3.5rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-head h2 { font-size: 1.35rem; margin: 0; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--gp-line); border-radius: .8rem; background: var(--gp-surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--gp-line); font-weight: 700; padding: .9rem 1.1rem; color: #fff; }

/* ---------- giveaway card ---------- */
.gw-card {
  border: 1px solid var(--gp-line);
  border-radius: .9rem;
  background: var(--gp-surface);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .15s ease;
}
.gw-card:hover { border-color: rgba(139,92,246,.45); transform: translateY(-2px); }
.gw-banner { position: relative; aspect-ratio: 16 / 9; background: var(--gp-surface-2); overflow: hidden; }
.gw-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gw-banner-empty { display: grid; place-items: center; height: 100%; color: var(--gp-brand); font-size: 2rem; }
.gw-banner .gw-chip {
  position: absolute; top: .6rem; left: .6rem;
  background: rgba(10,12,24,.82); color: #fff; border: 1px solid var(--gp-line);
  font-size: .7rem; font-weight: 600;
  padding: .25rem .6rem; border-radius: .4rem;
}
.gw-banner .gw-chip-end { left: auto; right: .6rem; background: rgba(10,12,24,.82); color: #f2b640; }
.gw-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }

.gw-tag {
  display: inline-block; align-self: flex-start;
  font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: .45rem;
}
.gw-tag-0 { color: #38bdf8; } /* cyan   */
.gw-tag-1 { color: #b794ff; } /* violet */
.gw-tag-2 { color: #f2b640; } /* gold   */
.gw-tag-3 { color: #34d399; } /* teal   */
.gw-tag-4 { color: #fb923c; } /* coral  */

.gw-title { font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: .2rem; }
.gw-title:hover { color: #cbb8ff; }
.gw-leader { font-size: .78rem; color: var(--gp-ink-soft); margin-bottom: .8rem; }

.gw-prize-box {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px dashed rgba(242,182,64,.45); background: var(--gp-gold-tint);
  border-radius: .6rem; padding: .6rem .75rem; margin-bottom: .75rem;
}
.gw-prize-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #d1a552; }
.gw-prize-value { font-size: 1.25rem; font-weight: 800; color: var(--gp-gold); letter-spacing: -.02em; }

.gw-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .8rem; color: var(--gp-ink-soft); padding: .3rem 0;
}
.gw-meta-row span { display: inline-flex; align-items: center; gap: .4rem; }
.gw-meta-row i { width: 14px; text-align: center; color: var(--gp-ink-soft); font-size: .78rem; }
.gw-refundable { color: var(--gp-success) !important; font-weight: 600; }
.gw-refundable i { color: var(--gp-success) !important; }

.gw-cta { margin-top: .75rem; width: 100%; }

/* Progress bar (still used standalone, e.g. dashboard "open entries") */
.gw-progress { height: 5px; border-radius: 3px; background: var(--gp-surface-2); margin: .7rem 0 .35rem; overflow: hidden; }
.gw-progress span { display: block; height: 100%; background: var(--gp-brand); border-radius: 3px; }
.gw-progress-text { font-size: .72rem; color: var(--gp-ink-soft); }

/* ---------- badges ---------- */
.badge-soft { font-weight: 600; padding: .35em .6em; border-radius: .4rem; }
.badge-success   { background: var(--gp-success-tint); color: var(--gp-success); }
.badge-primary   { background: var(--gp-brand-tint);   color: #cbb8ff; }
.badge-warning   { background: var(--gp-gold-tint);    color: var(--gp-gold); }
.badge-danger    { background: var(--gp-danger-tint);  color: var(--gp-danger); }
.badge-info      { background: var(--gp-info-tint);    color: var(--gp-info); }
.badge-secondary { background: rgba(255,255,255,.08);  color: var(--gp-ink-soft); }

/* ---------- stat tiles ---------- */
.stat {
  background: var(--gp-surface); border: 1px solid var(--gp-line);
  border-radius: .8rem; padding: 1rem 1.1rem; height: 100%;
}
.stat-label { font-size: .78rem; color: var(--gp-ink-soft); margin-bottom: .35rem; }
.stat-value { font-size: 1.35rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: #fff; }
.stat-foot { font-size: .74rem; color: var(--gp-ink-soft); margin-top: .3rem; }
.stat-icon {
  width: 34px; height: 34px; border-radius: .5rem;
  display: grid; place-items: center; font-size: .85rem;
  background: var(--gp-brand-tint); color: #cbb8ff;
  float: right;
}
.stat.gold .stat-icon { background: var(--gp-gold-tint); color: var(--gp-gold); }
.stat.gold .stat-value { color: var(--gp-gold); }
.stat-icon-0 { background: var(--gp-gold-tint);    color: var(--gp-gold); }
.stat-icon-1 { background: var(--gp-info-tint);    color: var(--gp-info); }
.stat-icon-2 { background: var(--gp-success-tint); color: var(--gp-success); }
.stat-icon-3 { background: var(--gp-brand-tint);   color: #cbb8ff; }

/* ---------- panel shell ---------- */
.panel-body { background: var(--gp-canvas); }
.panel-shell { display: flex; align-items: flex-start; }

/* .panel-sidebar doubles as Bootstrap's .offcanvas-lg component. Keep this
   base rule neutral - width/position/flex/background must NOT live here,
   or they fight Bootstrap's own <992px offcanvas behaviour (position:fixed
   + transform, needed to hide/slide the panel) and its >=992px !important
   reset (background-color:transparent, .offcanvas-body{display:flex}).
   Those are handled explicitly in the max-width/min-width blocks below. */
.panel-sidebar {
  --bs-offcanvas-width: 280px; /* off-canvas panel width on mobile */
  color: #b7bcd6;
}
.panel-sidebar .offcanvas-header { background: var(--gp-surface); border-bottom: 1px solid var(--gp-line); }
.panel-sidebar .offcanvas-body { padding: 1rem .85rem; background: var(--gp-surface); }
.sidebar-card { background: rgba(255,255,255,.05); border: 1px solid var(--gp-line); border-radius: .65rem; padding: .85rem; margin-bottom: 1.1rem; }
.sidebar-balance-label { font-size: .72rem; color: var(--gp-ink-soft); }
.sidebar-balance { font-size: 1.3rem; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.sidebar-card .btn-outline-light { border-color: rgba(255,255,255,.25); }
.sidebar-group-label {
  font-size: .72rem; font-weight: 700; color: #6b7096;
  padding: .55rem .6rem .35rem;
}
.sidebar-nav { list-style: none; margin: 0 0 .5rem; padding: 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .6rem; border-radius: .5rem;
  color: #b7bcd6; font-size: .88rem; font-weight: 500;
}
.sidebar-nav a i { width: 18px; text-align: center; font-size: .85rem; opacity: .85; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: var(--gp-brand); color: #fff; font-weight: 600; }
.sidebar-nav a.active i { opacity: 1; }

.panel-content { flex: 1; min-width: 0; padding: 1.5rem 1.35rem 3rem; }
.panel-head { margin-bottom: 1.25rem; }
.panel-title { font-size: 1.45rem; margin: 0; letter-spacing: -.02em; color: #fff; }
.panel-subtitle { color: var(--gp-ink-soft); margin: .3rem 0 0; font-size: .9rem; }

@media (max-width: 991.98px) {
  .panel-content { padding: 1.1rem .9rem 2.5rem; }
}

/* Desktop: Bootstrap turns .offcanvas-lg into a normal in-flow block and
   forces (with !important) its background transparent and its body into a
   row flex layout. Re-assert the fixed dark sidebar column here, matching
   !important where Bootstrap uses it, so this actually wins the cascade. */
@media (min-width: 992px) {
  .panel-sidebar {
    width: 258px; flex: 0 0 258px;
    min-height: calc(100vh - 57px);
    position: sticky; top: 57px;
    background: var(--gp-surface) !important;
    border-right: 1px solid var(--gp-line);
  }
  .panel-sidebar .offcanvas-body {
    display: block !important;
    background: transparent !important;
  }
}

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--gp-ink); margin-bottom: 0; }
.table > thead th {
  font-size: .74rem; font-weight: 700; color: var(--gp-ink-soft);
  border-bottom: 1px solid var(--gp-line); padding: .7rem .85rem; white-space: nowrap;
}
.table > tbody td { padding: .75rem .85rem; vertical-align: middle; border-color: var(--gp-line); }
.table-wrap { overflow-x: auto; }
.tx-id { font-size: .78rem; color: var(--gp-ink-soft); word-break: break-all; }
.amount-in  { color: var(--gp-success); font-weight: 700; }
.amount-out { color: var(--gp-danger);  font-weight: 700; }

/* ---------- forms ---------- */
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .35rem; color: var(--gp-ink); }
.form-control, .form-select {
  border-radius: .55rem; border-color: var(--gp-line);
  background-color: var(--gp-surface-2); color: var(--gp-ink); padding: .55rem .75rem;
}
.form-control::placeholder { color: #6b7096; }
.form-control:focus, .form-select:focus {
  background-color: var(--gp-surface-2); color: var(--gp-ink);
  border-color: var(--gp-brand);
  box-shadow: 0 0 0 .2rem rgba(139,92,246,.18);
}
.form-text { font-size: .78rem; }
.form-section-title {
  font-size: .95rem; font-weight: 700; color: #fff;
  padding-bottom: .5rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--gp-line);
}

/* ---------- auth screens ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(139,92,246,.22) 0%, transparent 60%),
    var(--gp-canvas);
}
.auth-card { width: 100%; max-width: 440px; background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: 1rem; padding: 2rem; }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head h1 { font-size: 1.35rem; margin-bottom: .3rem; color: #fff; }
.auth-head p { color: var(--gp-ink-soft); font-size: .88rem; margin: 0; }

/* ---------- giveaway detail ---------- */
.detail-banner { border-radius: .9rem; overflow: hidden; background: var(--gp-surface-2); aspect-ratio: 16/6; }
.detail-banner img { width: 100%; height: 100%; object-fit: cover; }
.detail-banner-empty { display: grid; place-items: center; height: 100%; color: var(--gp-brand); font-size: 3rem; }
.prize-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem; border: 1px solid var(--gp-line);
  border-radius: .6rem; margin-bottom: .5rem;
}
.prize-pos {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gp-gold-tint); color: var(--gp-gold);
  display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none;
}
.prize-row.top .prize-pos { background: var(--gp-gold); color: #1a1200; }
.prize-amount { margin-left: auto; font-weight: 800; color: #fff; }
.join-box { border: 1px solid var(--gp-line); border-radius: .9rem; background: var(--gp-surface); padding: 1.2rem; }
.join-price { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.share-input { font-size: .8rem; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--gp-ink-soft); }
.empty-state i { font-size: 2.2rem; color: #3c4066; margin-bottom: .75rem; display: block; }
.empty-state h5 { color: #fff; font-size: 1rem; }

/* ---------- prize builder rows ---------- */
.prize-input-row { display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; }
.prize-input-row .pos-badge {
  width: 34px; height: 34px; border-radius: .5rem; flex: none;
  background: var(--gp-gold-tint); color: var(--gp-gold);
  display: grid; place-items: center; font-weight: 800; font-size: .8rem;
}
.calc-box { background: var(--gp-brand-tint); border: 1px solid rgba(139,92,246,.35); border-radius: .7rem; padding: 1rem; }
.calc-row { display: flex; justify-content: space-between; padding: .3rem 0; font-size: .88rem; }
.calc-row.total { border-top: 1px solid rgba(139,92,246,.35); margin-top: .4rem; padding-top: .6rem; font-weight: 800; color: #fff; }

/* ---------- footer ---------- */
.site-main { min-height: 60vh; }
.site-footer { background: var(--gp-surface); color: var(--gp-ink-soft); padding: 3rem 0 1.5rem; margin-top: 4rem; border-top: 1px solid var(--gp-line); }
.site-footer .navbar-brand, .site-footer h6 { color: #fff; }
.site-footer h6 { font-size: .85rem; margin-bottom: .75rem; }
.footer-blurb { font-size: .86rem; max-width: 40ch; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--gp-ink-soft); font-size: .86rem; line-height: 2; }
.footer-links a:hover { color: #cbb8ff; }
.footer-base {
  border-top: 1px solid var(--gp-line);
  margin-top: 2.5rem; padding-top: 1.25rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  font-size: .8rem;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
