/* ============================================================
   DollarDrop — Light Theme
   ============================================================ */

:root {
    --bg:            #f0f5f1;
    --surface:       #ffffff;
    --border:        #e2e8df;
    --border-light:  #edf2ea;
    --primary:       #0d6e48;
    --primary-btn:   #16a34a;
    --primary-hover: #15803d;
    --primary-tint:  #dcfce7;
    --accent:        #10b981;
    --text:          #111827;
    --text-2:        #374151;
    --muted:         #6b7280;
    --muted-light:   #9ca3af;
    --danger:        #dc2626;
    --danger-light:  #fee2e2;
    --orange:        #f97316;
    --green-wa:      #25D366;
    --won-bg:        #f0fdf4;
    --won-border:    #16a34a;
    --shadow-sm:     0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:     0 4px 20px rgba(0,0,0,.08);
    --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
    --r:             10px;
    --r-lg:          16px;
    --r-xl:          20px;
    --r-pill:        9999px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary-btn);
    color: #fff;
    border: none;
    padding: .65rem 1.4rem;
    border-radius: var(--r);
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn-primary:hover  { background: var(--primary-hover); }
.btn-primary:active { transform: scale(.97); }

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: .58rem 1.2rem;
    border-radius: var(--r);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    display: inline-block;
    text-align: center;
}
.btn-secondary:hover { border-color: #bbb; background: #fafafa; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: .55rem 1.1rem;
    border-radius: var(--r);
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s;
}
.btn-danger:hover { background: #b91c1c; }

.btn-full { width: 100%; padding: .85rem; font-size: .95rem; }

/* ── Header ────────────────────────────────────────────────── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 200;
    gap: 1.5rem;
}

.logo {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -.5px;
    color: var(--primary);
    flex-shrink: 0;
}

.site-nav {
    display: flex;
    gap: .15rem;
    flex: 1;
    justify-content: center;
}
.site-nav a {
    padding: .42rem .9rem;
    border-radius: var(--r);
    font-size: .88rem;
    font-weight: 600;
    color: var(--muted);
    transition: color .15s, background .15s;
}
.site-nav a:hover  { color: var(--text); background: var(--border-light); }
.site-nav a.active { color: var(--primary); font-weight: 700; }

.header-right {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-shrink: 0;
}
.header-username { font-size: .85rem; color: var(--muted); }
.header-username strong { color: var(--text); }

.header-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-btn), var(--primary));
    color: #fff;
    font-size: .8rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--border);
}

/* ── Live ticker bar ───────────────────────────────────────── */
.live-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    padding: .38rem 2rem;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary-btn);
    flex-shrink: 0;
    animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.live-text        { font-size: .78rem; color: var(--muted); }
.live-text strong { color: var(--primary); }

/* ── Pop-ups ───────────────────────────────────────────────── */
#popup-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: .4rem;
    pointer-events: none;
}
.popup {
    background: var(--primary);
    border-left: 3px solid var(--accent);
    padding: .62rem 1.1rem;
    border-radius: var(--r);
    font-size: .85rem;
    color: #fff;
    max-width: 300px;
    box-shadow: var(--shadow-md);
    animation: slideInRight .25s ease, slideOutRight .35s ease 3.8s forwards;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.popup strong { color: #a7f3d0; }
@keyframes slideInRight { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:none} }
@keyframes slideOutRight { from{opacity:1} to{opacity:0;transform:translateX(20px)} }

/* ── Market page ───────────────────────────────────────────── */
.market-wrap {
    max-width: 1160px;
    margin: 0 auto;
    padding: 1.75rem 2rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Hero banner */
.hero-banner {
    background: linear-gradient(135deg, #0a5c3a 0%, #0d6e48 60%, #0f5c3c 100%);
    border-radius: var(--r-xl);
    padding: 2.5rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    color: #fff;
    overflow: hidden;
    position: relative;
}
.hero-banner::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 75% 50%, rgba(16,185,129,.18) 0%, transparent 60%);
    pointer-events: none;
}
.hero-text { position: relative; z-index: 1; }
.hero-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 900; line-height: 1.15;
    margin-bottom: .55rem;
}
.hero-sub {
    font-size: .95rem; opacity: .82;
    max-width: 400px; line-height: 1.6;
}
.hero-social {
    display: flex; align-items: center; gap: .75rem;
    flex-shrink: 0; position: relative; z-index: 1;
}
.hero-avatars { display: flex; }
.hero-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.18);
    margin-left: -12px;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 800; color: #fff;
    overflow: hidden;
}
.hero-avatars .hero-avatar:first-child { margin-left: 0; }
.hero-count {
    width: 42px; height: 42px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.13);
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 900; color: #fff;
    margin-left: -12px;
}

/* Section header with filter pills */
.section-header {
    display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap; gap: .75rem;
}
.section-title { font-size: 1.3rem; font-weight: 800; color: var(--text); }

.filter-pills { display: flex; gap: .45rem; }
.pill {
    padding: .38rem 1rem; border-radius: var(--r-pill);
    font-size: .8rem; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface); color: var(--muted);
    transition: all .15s;
}
.pill.active, .pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Campaigns grid */
.campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* Campaign card */
.campaign-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.campaign-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-img-wrap {
    position: relative; height: 200px;
    background: var(--border-light); overflow: hidden;
}
.card-img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s;
}
.campaign-card:hover .card-img { transform: scale(1.04); }
.card-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 5.5rem;
    background: linear-gradient(135deg, #e8f5ee, #d4edd9);
}

/* Badges */
.badge {
    position: absolute; top: .75rem; right: .75rem;
    padding: .26rem .68rem; border-radius: var(--r-pill);
    font-size: .62rem; font-weight: 800;
    letter-spacing: 1px; text-transform: uppercase;
    display: flex; align-items: center; gap: .35rem;
}
.badge-live    { background: var(--primary); color: #fff; }
.badge-ending  { background: var(--danger); color: #fff; }
.badge-won     { background: var(--primary-btn); color: #fff; }
.badge-claimed { background: var(--muted); color: #fff; }
.badge .live-dot { background: #a7f3d0; width: 6px; height: 6px; flex-shrink: 0; }

.card-body {
    padding: 1.2rem;
    display: flex; flex-direction: column; gap: .7rem;
}
.card-title {
    font-size: 1rem; font-weight: 800; color: var(--text); line-height: 1.3;
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--primary); }

.card-desc {
    font-size: .83rem; color: var(--muted); line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card progress */
.card-progress { display: flex; flex-direction: column; gap: .4rem; }
.funded-row { display: flex; justify-content: space-between; align-items: center; }
.funded-label {
    font-size: .82rem; font-weight: 700; color: var(--primary-btn);
}
.funded-count { font-size: .76rem; color: var(--muted); }

.progress-track {
    background: var(--border);
    border-radius: var(--r-pill);
    height: 8px; overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: var(--r-pill);
    background: linear-gradient(90deg, var(--accent), var(--primary-btn));
    transition: width .8s ease;
}

/* Card footer */
.card-footer {
    display: flex; align-items: center;
    justify-content: space-between; gap: .75rem;
    padding-top: .2rem;
}
.ticket-label  { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted-light); }
.ticket-amount { font-size: 1.1rem; font-weight: 900; color: var(--text); }

.btn-pay { padding: .62rem 1.2rem; font-size: .88rem; border-radius: var(--r); }

/* Won card on market */
.campaign-card.won-card { border-color: var(--won-border); }
.won-card-body {
    padding: 1.2rem;
    background: var(--won-bg);
    display: flex; flex-direction: column; gap: .4rem;
}
.won-card-badge {
    display: inline-block;
    background: var(--primary-btn); color: #fff;
    font-size: .62rem; font-weight: 800;
    padding: .2rem .6rem; border-radius: var(--r-pill);
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: .2rem; width: fit-content;
}
.won-card-name { font-size: .98rem; font-weight: 800; color: var(--primary); line-height: 1.3; }
.won-card-sub  { font-size: .78rem; color: var(--muted); }

/* ── Recent Winners on homepage ────────────────────────────── */
.winners-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
}
.winners-bar-title {
    font-size: .98rem; font-weight: 800; color: var(--text);
    display: flex; align-items: center; gap: .45rem;
    margin-bottom: 1rem;
}
.winners-chips { display: flex; gap: .7rem; flex-wrap: wrap; }
.winner-chip {
    display: flex; align-items: center; gap: .6rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--r); padding: .55rem .85rem;
    transition: border-color .15s;
    cursor: default;
}
.winner-chip:hover { border-color: var(--primary-btn); }
.winner-chip-av {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-btn), var(--primary));
    color: #fff; font-size: .78rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.winner-chip-name { font-size: .86rem; font-weight: 700; color: var(--text); }
.winner-chip-item { font-size: .74rem; color: var(--muted); }
.winner-chip-badge {
    background: #f3f4f6; color: var(--muted);
    font-size: .58rem; font-weight: 800;
    padding: .16rem .45rem; border-radius: var(--r-pill);
    text-transform: uppercase; letter-spacing: .5px;
    margin-left: .2rem;
}

/* ── Sell section ──────────────────────────────────────────── */
.sell-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 3rem 2rem; text-align: center;
    box-shadow: var(--shadow-sm);
}
.sell-section h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 900; margin-bottom: .6rem; }
.sell-section h2 span { color: var(--primary); }
.sell-section p  { color: var(--muted); max-width: 460px; margin: 0 auto 2rem; line-height: 1.7; }
.btn-whatsapp {
    display: inline-flex; align-items: center; gap: .6rem;
    background: var(--green-wa); color: #fff;
    padding: .85rem 2rem; border-radius: var(--r-pill);
    font-weight: 800; font-size: .95rem;
    transition: background .2s, transform .15s;
    box-shadow: 0 4px 20px rgba(37,211,102,.3);
}
.btn-whatsapp:hover { background: #20ba5a; transform: scale(1.04); }

/* ── Footer ────────────────────────────────────────────────── */
footer {
    text-align: center; padding: 2rem 1rem 1.5rem;
    color: var(--muted-light); font-size: .78rem;
    border-top: 1px solid var(--border);
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: .75rem;
    margin-bottom: 1rem;
}
.footer-links a {
    display: inline-block;
    padding: .55rem 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text-2);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.footer-links a:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}
.footer-links a:active { transform: scale(.97); }
.footer-copy { font-size: .75rem; }

/* ── Item detail page ──────────────────────────────────────── */
.detail-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 2rem 5rem;
}
.detail-back {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .85rem; color: var(--muted);
    margin-bottom: 1.5rem; transition: color .15s;
}
.detail-back:hover { color: var(--primary); }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem; align-items: start;
}

.detail-gallery { display: flex; flex-direction: column; gap: 1rem; }
.gallery-main {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    aspect-ratio: 4/3;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm);
}
.gallery-main-img { width: 100%; height: 100%; object-fit: cover; }
.gallery-placeholder { font-size: 7rem; user-select: none; }

.detail-live-badge {
    position: absolute; top: .9rem; right: .9rem;
    background: var(--primary); color: #fff;
    font-size: .62rem; font-weight: 900;
    padding: .28rem .75rem; border-radius: var(--r-pill);
    display: flex; align-items: center; gap: .4rem;
    text-transform: uppercase; letter-spacing: 1.5px; z-index: 2;
}
.detail-live-badge .live-dot { background: #a7f3d0; }

.detail-won-overlay-badge {
    position: absolute; top: .9rem; right: .9rem;
    background: var(--primary-btn); color: #fff;
    font-size: .62rem; font-weight: 900;
    padding: .28rem .75rem; border-radius: var(--r-pill);
    text-transform: uppercase; letter-spacing: 1px; z-index: 2;
}

.detail-right { display: flex; flex-direction: column; gap: 1.2rem; }
.detail-title-block { display: flex; flex-direction: column; gap: .4rem; }
.detail-verified-tag {
    font-size: .68rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px; color: var(--primary);
    display: flex; align-items: center; gap: .3rem;
}
.detail-admin-tag {
    font-size: .68rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px; color: var(--orange);
    display: flex; align-items: center; gap: .3rem;
}
.detail-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 900; line-height: 1.15; color: var(--text);
}
.detail-desc    { color: var(--muted); font-size: .95rem; line-height: 1.7; }
.detail-winner-highlight { color: var(--primary); font-weight: 700; }

.detail-progress-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.25rem;
    display: flex; flex-direction: column; gap: .85rem;
    box-shadow: var(--shadow-sm);
}
.detail-progress-header { display: flex; justify-content: space-between; align-items: flex-end; }
.detail-progress-label {
    font-size: .63rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 2px; color: var(--muted); margin-bottom: .3rem;
}
.detail-progress-count { font-size: 1.3rem; font-weight: 900; color: var(--primary); }
.detail-progress-target { font-size: .9rem; color: var(--muted); font-weight: 400; }
.detail-progress-pct   { font-size: 1.8rem; font-weight: 900; color: var(--text); line-height: 1; }

.detail-progress-track {
    background: var(--border); border-radius: var(--r-pill);
    height: 16px; overflow: hidden;
}
.detail-progress-fill {
    height: 100%; border-radius: var(--r-pill);
    background: linear-gradient(90deg, var(--accent), var(--primary-btn));
    transition: width .8s ease;
    position: relative; overflow: hidden;
}
.detail-progress-fill::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.3) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2.2s infinite;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.detail-progress-meta { font-size: .76rem; color: var(--muted); text-align: center; }

.detail-cta { font-size: 1rem; padding: 1rem; border-radius: var(--r-lg); }
.detail-trust-row {
    display: flex; justify-content: center; gap: 1.4rem; flex-wrap: wrap;
}
.detail-trust-item {
    font-size: .7rem; color: var(--muted);
    font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: .3rem;
}
.detail-admin-note {
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: var(--r); padding: .85rem 1rem;
    font-size: .84rem; color: #92400e; text-align: center;
}

.detail-entries { display: flex; flex-direction: column; gap: .75rem; }
.detail-entries-title {
    font-size: .88rem; font-weight: 800; color: var(--text);
    padding-bottom: .6rem; border-bottom: 1px solid var(--border);
}
.entries-list { display: flex; flex-direction: column; gap: .4rem; }
.entry-row {
    display: flex; align-items: center; gap: .85rem;
    padding: .65rem .9rem;
    background: var(--bg); border-radius: var(--r);
    border: 1px solid transparent;
    transition: border-color .15s, background .15s;
}
.entry-row:hover { background: var(--surface); border-color: var(--border); }
.entry-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-btn), var(--primary));
    color: #fff; font-size: .78rem; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.entry-info { flex: 1; min-width: 0; }
.entry-name { font-size: .88rem; font-weight: 700; color: var(--text); }
.entry-sub  { font-size: .74rem; color: var(--muted); }
.entry-time { font-size: .72rem; color: var(--muted-light); white-space: nowrap; flex-shrink: 0; }

/* ── Winners page ──────────────────────────────────────────── */
.winners-wrap {
    max-width: 900px; margin: 0 auto;
    padding: 2rem 2rem 5rem;
    display: flex; flex-direction: column; gap: 2rem;
}
.winners-hero {
    background: linear-gradient(135deg, #0a5c3a, #0d6e48);
    border-radius: var(--r-xl);
    padding: 2.5rem 2rem; text-align: center; color: #fff;
}
.winners-hero-trophy { font-size: 3.5rem; margin-bottom: .6rem; }
.winners-hero-title  { font-size: 2rem; font-weight: 900; margin-bottom: .4rem; }
.winners-hero-sub    { opacity: .8; font-size: .95rem; }

.all-winners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.winner-card {
    background: var(--surface);
    border: 1px solid var(--won-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.winner-card-img { height: 160px; background: var(--won-bg); position: relative; overflow: hidden; }
.winner-card-img img { width: 100%; height: 100%; object-fit: cover; }
.winner-card-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 4rem; background: var(--won-bg);
}
.winner-card-body { padding: 1rem; background: var(--won-bg); }
.winner-card-badge {
    display: inline-block;
    background: var(--primary-btn); color: #fff;
    font-size: .6rem; font-weight: 800;
    padding: .18rem .55rem; border-radius: var(--r-pill);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: .5rem;
}
.winner-card-winner-name { font-size: .82rem; font-weight: 700; color: var(--primary); margin-bottom: .2rem; }
.winner-card-item   { font-size: .95rem; font-weight: 800; color: var(--text); line-height: 1.3; }
.winner-card-sub    { font-size: .76rem; color: var(--muted); margin-top: .2rem; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9000;
    align-items: center; justify-content: center;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 2rem; width: 100%; max-width: 400px;
    position: relative;
    animation: modalIn .25s ease;
    box-shadow: var(--shadow-lg);
}
@keyframes modalIn { from{opacity:0;transform:scale(.95)} to{opacity:1;transform:none} }
.modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; color: var(--muted);
    font-size: 1rem; cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal-title       { font-size: 1.4rem; font-weight: 900; margin-bottom: .3rem; color: var(--text); }
.modal-title span  { color: var(--primary); }
.modal-sub         { color: var(--muted); font-size: .88rem; margin-bottom: 1.4rem; }
.modal-user-greeting {
    background: var(--primary-tint);
    border: 1px solid #bbf7d0;
    border-radius: var(--r); padding: .65rem .9rem;
    font-size: .88rem; color: var(--primary); margin-bottom: 1.2rem;
}
.modal-user-greeting strong { color: var(--primary); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-label {
    display: block; font-size: .76rem; font-weight: 700;
    margin-bottom: .4rem; color: var(--text-2);
    text-transform: uppercase; letter-spacing: .5px;
}
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-input {
    width: 100%; background: var(--surface);
    border: 1px solid var(--border); color: var(--text);
    padding: .65rem .9rem; border-radius: var(--r);
    font-size: .95rem; margin-bottom: 1rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
    outline: none; border-color: var(--primary-btn);
    box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.form-error { color: var(--danger); font-size: .82rem; margin-top: .6rem; min-height: 1.2rem; }

/* ── Auth pages ────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: var(--bg);
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 2.5rem; width: 100%; max-width: 400px;
    box-shadow: var(--shadow-md);
}
.login-logo    { font-size: 1.6rem; font-weight: 900; color: var(--primary); margin-bottom: 1.5rem; text-align: center; }
.login-card h1 { font-size: 1.4rem; font-weight: 900; margin-bottom: .35rem; }
.login-card p  { color: var(--muted); font-size: .88rem; margin-bottom: 1.75rem; }
.login-footer  { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 1.25rem; }
.login-footer a { color: var(--primary); font-weight: 600; }
.login-footer a:hover { text-decoration: underline; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert { padding: .8rem 1rem; border-radius: var(--r); font-size: .88rem; margin-bottom: 1.25rem; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: var(--won-bg); border: 1px solid #bbf7d0; color: #166534; }

/* ── Admin ─────────────────────────────────────────────────── */
.admin-body { background: var(--bg); }
.admin-header {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0 2rem; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}
.admin-header .logo { font-size: 1.3rem; }
.admin-badge {
    background: #fef3c7; color: #92400e;
    font-size: .62rem; font-weight: 800;
    padding: .18rem .55rem; border-radius: var(--r-pill);
    border: 1px solid #fde68a; margin-left: .4rem;
    text-transform: uppercase; letter-spacing: 1px;
}
.admin-nav { display: flex; align-items: center; gap: .65rem; }
.admin-main { max-width: 1200px; margin: 0 auto; padding: 2.5rem 2rem; }
.admin-page-title { font-size: 1.8rem; font-weight: 900; }
.admin-page-sub   { color: var(--muted); font-size: .88rem; margin-top: .3rem; margin-bottom: 2rem; }

/* Admin dashboard two-col grid */
.admin-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.75rem; align-items: start;
}

.admin-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
}
.admin-section-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.live-monitor-badge {
    background: var(--primary); color: #fff;
    font-size: .6rem; font-weight: 800;
    padding: .22rem .65rem; border-radius: var(--r-pill);
    text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: .4rem;
}
.live-monitor-badge .live-dot { background: #a7f3d0; }

/* Pool cards */
.pool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.2rem;
    display: flex; gap: 1.1rem; align-items: flex-start;
    margin-bottom: .85rem;
    box-shadow: var(--shadow-sm);
}
.pool-thumb {
    width: 100px; height: 80px; border-radius: var(--r);
    object-fit: cover; background: var(--bg); flex-shrink: 0;
}
.pool-thumb-empty {
    width: 100px; height: 80px; border-radius: var(--r);
    background: var(--border-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; flex-shrink: 0;
}
.pool-info { flex: 1; min-width: 0; }
.pool-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .4rem; }
.pool-name   { font-size: .95rem; font-weight: 800; color: var(--text); }
.pool-id     { font-size: .7rem; color: var(--muted-light); margin-top: .1rem; }

.pool-status-pill {
    display: inline-block; padding: .2rem .6rem;
    border-radius: var(--r-pill); font-size: .62rem;
    font-weight: 800; text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0;
}
.pool-status-active  { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.pool-status-ending  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.pool-status-won     { background: #e0f2fe; color: #0c4a6e; border: 1px solid #bae6fd; }

.pool-progress-label {
    font-size: .6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--muted); margin-bottom: .35rem;
}
.pool-progress-row {
    display: flex; align-items: center; gap: .75rem; margin-bottom: .65rem;
}
.pool-pct { font-size: 1.15rem; font-weight: 900; color: var(--primary); min-width: 46px; }

.pool-private-box {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--r); padding: .55rem .85rem; margin-bottom: .85rem;
}
.pool-private-label  {
    font-size: .58rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--muted);
}
.pool-private-amount { font-size: 1.05rem; font-weight: 900; color: var(--primary); }
.pool-private-target { font-size: .82rem; color: var(--muted); font-weight: 400; }

.pool-actions { display: flex; gap: .45rem; flex-wrap: wrap; }

/* Transactions panel */
.tx-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg); overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.tx-panel-header {
    padding: .85rem 1.2rem; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.tx-panel-title {
    font-size: .72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--text);
}
.tx-live-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary-btn); animation: pulse 1.5s infinite;
}
.tx-row {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem 1.2rem; border-bottom: 1px solid var(--border-light);
    transition: background .15s;
}
.tx-row:hover { background: var(--bg); }
.tx-icon {
    width: 30px; height: 30px; border-radius: var(--r);
    background: var(--primary-tint);
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; flex-shrink: 0;
}
.tx-info { flex: 1; min-width: 0; }
.tx-name { font-size: .84rem; font-weight: 700; color: var(--text); }
.tx-item { font-size: .73rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amount { font-size: .88rem; font-weight: 800; color: var(--primary); flex-shrink: 0; }
.tx-view-all {
    display: block; text-align: center; padding: .75rem;
    font-size: .76rem; font-weight: 700; color: var(--primary);
    transition: background .15s; letter-spacing: .5px; text-transform: uppercase;
}
.tx-view-all:hover { background: var(--bg); }

.admin-stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: .75rem; }
.stat-box { border-radius: var(--r); padding: 1rem; text-align: center; }
.stat-box-dark  { background: var(--primary); color: #fff; }
.stat-box-green { background: var(--primary-btn); color: #fff; }
.stat-label { font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: .8; }
.stat-value { font-size: 1.3rem; font-weight: 900; margin-top: .25rem; }

/* Admin table (used in other admin pages) */
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th {
    text-align: left; padding: .65rem 1rem;
    background: var(--bg); color: var(--muted);
    font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px;
    border-bottom: 1px solid var(--border);
}
.admin-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg); }
.admin-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: var(--r); }
.admin-thumb-empty {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; background: var(--border-light); border-radius: var(--r);
}
.status-pill { display: inline-block; padding: .2rem .65rem; border-radius: var(--r-pill); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.status-active { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.status-won    { background: #e0f2fe; color: #0c4a6e; border: 1px solid #bae6fd; }
.amount-display { font-weight: 700; color: var(--primary); }

/* Admin form */
.admin-form { max-width: 520px; }
.admin-form .form-group { margin-bottom: 1.4rem; }
.admin-form .form-hint  { font-size: .76rem; color: var(--muted); margin-top: .35rem; }
.admin-form textarea.form-input { resize: vertical; min-height: 80px; }
.upload-preview {
    margin-top: .75rem; border-radius: var(--r); overflow: hidden;
    width: 120px; height: 120px;
    border: 2px dashed var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; color: var(--muted);
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── Header Avatar ───────────────────────────────────────── */
.header-avatar-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    overflow: hidden; border: 2.5px solid var(--primary);
    text-decoration: none; flex-shrink: 0;
    transition: border-color .15s, transform .15s;
}
.header-avatar-link:hover { transform: scale(1.07); border-color: var(--primary-hover); }
.header-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.header-avatar-fallback {
    width: 100%; height: 100%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .95rem;
}

/* ── Language Switcher ────────────────────────────────────── */
.lang-switcher {
    position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 999;
    display: flex; gap: .4rem;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 99px; padding: .35rem .6rem;
    box-shadow: var(--shadow-md);
}
.lang-switcher button {
    background: none; border: none; cursor: pointer;
    font-size: 1.2rem; padding: .1rem .15rem; border-radius: 50%;
    transition: transform .15s;
    line-height: 1;
}
.lang-switcher button:hover { transform: scale(1.25); }

/* ── Payment modal payment method selector ───────────────── */
.pay-method-row { display: flex; gap: .75rem; margin-bottom: 1.1rem; }
.pay-method-btn {
    flex: 1; padding: .75rem .5rem; border-radius: .65rem;
    border: 2px solid var(--border); background: var(--surface);
    cursor: pointer; font-size: .85rem; font-weight: 600;
    color: var(--text); transition: all .15s; text-align: center;
}
.pay-method-btn:hover, .pay-method-btn.active {
    border-color: var(--primary); background: var(--primary-tint); color: var(--primary);
}
.pay-method-btn .pay-icon { font-size: 1.3rem; display: block; margin-bottom: .25rem; }
#stripeCardPanel { margin-bottom: 1rem; }
#card-element {
    padding: .75rem 1rem; border: 1.5px solid var(--border);
    border-radius: .6rem; background: var(--surface);
    transition: border-color .15s;
}
#card-element.StripeElement--focus { border-color: var(--primary); }
#card-errors { color: var(--danger); font-size: .82rem; margin-top: .4rem; min-height: 1rem; }

/* ── Success toast ───────────────────────────────────────── */
.success-toast {
    position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #fff; padding: .75rem 1.5rem;
    border-radius: 99px; font-weight: 700; font-size: .9rem;
    box-shadow: var(--shadow-lg); z-index: 9999;
    animation: fadeInDown .3s ease;
}
@keyframes fadeInDown {
    from { opacity:0; transform: translateX(-50%) translateY(-12px); }
    to   { opacity:1; transform: translateX(-50%) translateY(0); }
}

/* Legacy item-name link on old pages */
.item-name { font-size: 1rem; font-weight: 800; margin-bottom: .2rem; display: block; color: var(--text); }
.item-name:hover { color: var(--primary); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-dashboard-grid { grid-template-columns: 1fr; }
    .pool-card { flex-direction: column; }
    .pool-thumb, .pool-thumb-empty { width: 100%; height: 140px; }
}

@media (max-width: 640px) {
    .market-wrap    { padding: 1rem 1rem 4rem; gap: 1.5rem; }
    .hero-banner    { padding: 1.75rem 1.5rem; flex-direction: column; gap: 1.25rem; }
    .hero-title     { font-size: 1.5rem; }
    .campaigns-grid { grid-template-columns: 1fr; }
    .site-nav       { display: none; }
    .detail-wrap    { padding: 1rem 1rem 4rem; }
    .detail-grid    { grid-template-columns: 1fr; gap: 1.5rem; }
    .detail-title   { font-size: 1.4rem; }
    .detail-trust-row { gap: 1rem; }
    .admin-main     { padding: 1.5rem 1rem; }
    .winners-chips  { flex-direction: column; }
}

/* ── Share modal ────────────────────────────────────────── */
.share-modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55);
    z-index: 9000; align-items: center; justify-content: center;
}
.share-modal-overlay.open { display: flex; }
.share-modal {
    background: var(--surface); border-radius: var(--r-xl);
    padding: 2rem 1.75rem 1.75rem; max-width: 380px; width: 90%;
    box-shadow: var(--shadow-lg); position: relative; text-align: center;
    animation: fadeInDown .25s ease;
}
.share-modal-icon  { font-size: 2.5rem; margin-bottom: .5rem; }
.share-modal-title { font-size: 1.25rem; font-weight: 800; margin-bottom: .3rem; }
.share-modal-sub   { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.share-btns        { display: flex; flex-direction: column; gap: .65rem; }
.share-btn-wa {
    display: flex; align-items: center; justify-content: center; gap: .55rem;
    background: #25D366; color: #fff; border: none; border-radius: var(--r);
    padding: .8rem 1rem; font-size: .95rem; font-weight: 700; cursor: pointer;
    text-decoration: none;
}
.share-btn-copy {
    display: flex; align-items: center; justify-content: center; gap: .55rem;
    background: var(--bg); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--r); padding: .8rem 1rem; font-size: .95rem; font-weight: 600;
    cursor: pointer;
}
.share-btn-copy:hover { border-color: var(--primary); }
.share-btn-dismiss {
    background: none; border: none; color: var(--muted); font-size: .85rem;
    cursor: pointer; margin-top: .4rem; padding: .4rem;
}
.share-btn-dismiss:hover { color: var(--text); }

/* ── Credit balance box (in pay modal) ──────────────────── */
.credit-balance-box {
    background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: var(--r);
    padding: .75rem 1rem; font-size: .9rem; color: #5b21b6; font-weight: 600;
    text-align: center;
}

/* ── Credential warning banner ──────────────────────────── */
.cred-warning {
    background: #fef3c7; border: 1px solid #f59e0b; border-radius: var(--r);
    padding: .9rem 1.25rem; margin-bottom: 1.25rem; font-size: .88rem;
    color: #92400e; display: flex; align-items: flex-start; gap: .65rem;
}
.cred-warning strong { display: block; margin-bottom: .25rem; font-size: .93rem; }

/* ── Verify email banner ────────────────────────────────── */
.verify-banner {
    background: #fef9c3; border: 1px solid #fbbf24; border-radius: var(--r);
    padding: .85rem 1.2rem; margin-bottom: 1.25rem; font-size: .88rem;
    color: #78350f; display: flex; align-items: center; gap: .65rem;
}
