/* =========================================================================
   GoalPool design system
   Dark, glassmorphic, pitch-green + trophy-gold accents.
   ========================================================================= */

:root {
    --bg: #090c12;
    --bg-elevated: #0f1420;
    --surface: rgba(255, 255, 255, 0.055);
    --surface-strong: rgba(255, 255, 255, 0.09);
    --surface-border: rgba(255, 255, 255, 0.10);
    --text: #f3f5f8;
    --text-muted: #9aa4b6;
    --text-faint: #6b7488;

    --accent: #22c55e;         /* pitch green */
    --accent-dark: #16a34a;
    --accent-glow: rgba(34, 197, 94, 0.35);
    --gold: #f5b93d;           /* trophy gold */
    --gold-dark: #d99a1f;

    --danger: #f75c5c;
    --warning: #f5b93d;
    --success: #22c55e;
    --info: #38bdf8;

    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-glow-green: 0 8px 30px rgba(34, 197, 94, 0.25);
    --shadow-glow-gold: 0 8px 30px rgba(245, 185, 61, 0.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    position: relative;
    min-height: 100vh;
}

/* Ambient background glow - subtle radial mesh behind everything */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 12% 8%, rgba(34, 197, 94, 0.16), transparent 40%),
        radial-gradient(circle at 88% 15%, rgba(245, 185, 61, 0.10), transparent 35%),
        radial-gradient(circle at 50% 100%, rgba(56, 189, 248, 0.08), transparent 45%),
        var(--bg);
}

h1, h2, h3, h4, h5, h6, .display-6, .fw-bold {
    font-family: 'Outfit', 'Inter', sans-serif;
}

a { text-decoration: none; }

::selection { background: var(--accent); color: #04150a; }

/* ---------------------------------------------------------------------
   Navbar - fixed, blurred glass over hero content
   --------------------------------------------------------------------- */
.navbar.gp-nav {
    background: rgba(9, 12, 18, 0.72) !important;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--surface-border);
    padding-top: .85rem;
    padding-bottom: .85rem;
}

.gp-nav .navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 20%, var(--gold) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gp-nav .nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    position: relative;
    margin: 0 .35rem;
    transition: color .2s ease;
}

.gp-nav .nav-link::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
    border-radius: 2px;
}

.gp-nav .nav-link:hover,
.gp-nav .nav-link.active {
    color: var(--text) !important;
}

.gp-nav .nav-link:hover::after,
.gp-nav .nav-link.active::after {
    transform: scaleX(1);
}

/* ---------------------------------------------------------------------
   Hero sections - full-bleed background image + gradient scrim
   --------------------------------------------------------------------- */
.gp-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.gp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(6, 9, 14, 0.55) 0%, rgba(6, 9, 14, 0.88) 75%, var(--bg) 100%),
        linear-gradient(90deg, rgba(6, 9, 14, 0.75) 0%, rgba(6, 9, 14, 0.15) 55%);
}

.gp-hero > .container { position: relative; z-index: 1; }

.gp-hero-full {
    min-height: 100vh;
}

.gp-hero-banner {
    min-height: 300px;
    padding: 3.5rem 0 3rem;
}

@media (max-width: 767px) {
    .gp-hero-banner { min-height: 220px; padding: 2.5rem 0 2rem; }
}

.gp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(245, 185, 61, 0.12);
    border: 1px solid rgba(245, 185, 61, 0.28);
    padding: .35rem .85rem;
    border-radius: 100px;
}

.gp-title-xl {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: #fff;
}

.gp-title-lg {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.gp-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ---------------------------------------------------------------------
   Glass cards
   --------------------------------------------------------------------- */
.card, .gp-card {
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    color: var(--text);
}

.card:hover.gp-hover,
.gp-hover:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: var(--shadow-glow-green);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card, .gp-hover { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }

.gp-card-solid {
    background: var(--bg-elevated);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    border-radius: 100px;
    font-weight: 600;
    padding: .55rem 1.3rem;
    letter-spacing: -0.01em;
}

.btn-warning,
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    color: #04150a;
    box-shadow: 0 4px 18px rgba(34, 197, 94, 0.35);
}

.btn-warning:hover, .btn-warning:focus,
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #34d472 0%, var(--accent) 100%);
    color: #04150a;
    box-shadow: 0 6px 24px rgba(34, 197, 94, 0.5);
    transform: translateY(-1px);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    color: #241701;
    box-shadow: 0 4px 18px rgba(245, 185, 61, 0.35);
}

.btn-gold:hover { color: #241701; transform: translateY(-1px); }

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-light {
    border: 1px solid var(--surface-border);
    color: var(--text);
    background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-light:hover {
    background: var(--surface-strong);
    border-color: var(--accent);
    color: #fff;
}

.btn-outline-danger {
    border: 1px solid rgba(247, 92, 92, 0.5);
    color: #ff9b9b;
    background: transparent;
}

.btn-outline-danger:hover {
    background: rgba(247, 92, 92, 0.15);
    border-color: var(--danger);
    color: #fff;
}

.btn-link { color: var(--text-muted); }
.btn-link:hover { color: var(--text); }

.btn:disabled { opacity: .45; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: .65rem .9rem;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    color: var(--text);
}

.form-control::placeholder { color: var(--text-faint); }

.input-group-text {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
}

.form-label { color: var(--text-muted); font-weight: 500; font-size: .9rem; }

.otp-input {
    letter-spacing: 0.6em;
    font-size: 1.6rem;
    text-align: center;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table {
    color: var(--text);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
    --bs-table-hover-color: var(--text);
    border-color: var(--surface-border);
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    background: transparent;
    border-bottom-color: var(--surface-border);
    color: var(--text);
}

.table thead th {
    color: var(--text-faint);
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--surface-border);
}

/* ---------------------------------------------------------------------
   Leaderboard
   --------------------------------------------------------------------- */
.leaderboard-row.rank-1 {
    background: linear-gradient(90deg, rgba(245, 185, 61, 0.16), transparent);
    box-shadow: inset 3px 0 0 var(--gold);
}
.leaderboard-row.rank-2 {
    background: linear-gradient(90deg, rgba(200, 210, 224, 0.10), transparent);
    box-shadow: inset 3px 0 0 #c8d2e0;
}
.leaderboard-row.rank-3 {
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.12), transparent);
    box-shadow: inset 3px 0 0 #d97706;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: .85rem;
    background: rgba(255, 255, 255, 0.08);
}
.rank-1 .rank-badge { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #241701; }
.rank-2 .rank-badge { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #14181f; }
.rank-3 .rank-badge { background: linear-gradient(135deg, #f0985c, #b45309); color: #1c0d02; }

/* ---------------------------------------------------------------------
   Badges, progress, misc
   --------------------------------------------------------------------- */
.badge { font-weight: 600; letter-spacing: .01em; border-radius: 8px; padding: .4em .65em; }

.progress {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 100px;
    overflow: hidden;
}
.progress-bar {
    background: linear-gradient(90deg, var(--accent), var(--gold));
}

.pool-card .badge-status { font-size: 0.72rem; }

.pulse { animation: pulse-bg 1.1s ease; }
@keyframes pulse-bg {
    0% { background-color: rgba(34, 197, 94, 0.25); }
    100% { background-color: transparent; }
}

.gp-stat-icon {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--accent-glow), transparent);
    color: var(--accent);
}

.text-muted { color: var(--text-muted) !important; }

.alert {
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}
.alert-danger { background: rgba(247, 92, 92, 0.12); border-color: rgba(247, 92, 92, 0.35); color: #ffb4b4; }
.alert-success { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); color: #7be3a3; }

.modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    color: var(--text);
}
.modal-header, .modal-footer { border-color: var(--surface-border); }
.btn-close { filter: invert(1) grayscale(1) brightness(1.8); }

.nav-tabs { border-bottom: 1px solid var(--surface-border); }
.nav-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 600;
}
.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--text);
    border-bottom: 2px solid var(--accent);
}

.list-group-item {
    background: transparent;
    border-color: var(--surface-border);
    color: var(--text);
}

/* ---------------------------------------------------------------------
   Reveal-on-scroll utility (see footer.php)
   --------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade/slide the whole page in on load */
.gp-fade-in { animation: gp-fade-in .6s ease both; }
@keyframes gp-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Admin portal shell - sidebar + topbar layout
   ========================================================================= */
.gp-admin-shell {
    display: flex;
    min-height: 100vh;
}

.gp-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: rgba(10, 13, 20, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--surface-border);
    padding: 1.5rem 1.1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
    transition: transform .25s ease;
}

.gp-sidebar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #fff;
    padding: .4rem .6rem 1.5rem;
}

.gp-sidebar-eyebrow {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 0 .8rem;
    margin-bottom: .5rem;
    margin-top: 1.25rem;
}

.gp-sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .8rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: .92rem;
    margin-bottom: .15rem;
    transition: background .18s ease, color .18s ease;
}

.gp-sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; }

.gp-sidebar-link:hover {
    background: var(--surface-strong);
    color: #fff;
}

.gp-sidebar-link.active {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.03));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
}

.gp-sidebar-link .badge-count {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: .68rem;
    border-radius: 100px;
    padding: .15em .5em;
}

.gp-sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--surface-border);
}

.gp-admin-main {
    flex: 1;
    min-width: 0;
}

.gp-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(9, 12, 18, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--surface-border);
    padding: 1.1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gp-admin-content {
    padding: 2rem;
}

.gp-sidebar-toggle {
    display: none;
}

@media (max-width: 991px) {
    .gp-sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-soft);
    }
    .gp-sidebar.is-open { transform: translateX(0); }
    .gp-sidebar-toggle { display: inline-flex; }
    .gp-admin-content { padding: 1.25rem; }
    .gp-topbar { padding: 1rem 1.25rem; }
}

.gp-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9;
}
.gp-sidebar-backdrop.is-open { display: block; }

/* Scrollbar polish (WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #232a38; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #2e3648; }
