/* ==========================================================
   FCPL Pickleball Tournament — theme
   Court green + ball orange + sunshine yellow, mobile-first.
   ========================================================== */

:root {
    --court-green: #2ec4b6;
    --court-green-dark: #0f6b62;
    --ball-orange: #ff6b35;
    --sun-yellow: #ffd60a;
    --grape: #7b2cbf;
    --sky: #4cc9f0;
    --ink: #1d3557;
    --bg: #f4faf9;
    --surface: #ffffff;
    --danger: #e63946;
    --radius-lg: 1.1rem;
    --radius-md: 0.75rem;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding-bottom: 4.5rem; /* room for mobile bottom nav */
}

.pb-icon { width: 1.2em; height: 1.2em; vertical-align: -0.2em; }
.icon-lg { width: 2.2rem; height: 2.2rem; }
.icon-xl { width: 3.5rem; height: 3.5rem; }

/* ---------- Navbar ---------- */
.pb-navbar {
    background: linear-gradient(120deg, var(--court-green-dark), var(--court-green) 70%);
    box-shadow: 0 2px 12px rgba(15, 107, 98, 0.25);
}
.pb-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: #fff !important;
    letter-spacing: 0.02em;
}
.pb-navbar .navbar-brand img { width: 2.3rem; height: 2.3rem; }
.pb-navbar .nav-link {
    color: rgba(255,255,255,0.88) !important;
    font-weight: 500;
    border-radius: 999px;
    padding: 0.4rem 0.9rem !important;
    transition: background 0.15s ease;
}
.pb-navbar .nav-link.active,
.pb-navbar .nav-link:hover { background: rgba(255,255,255,0.16); color: #fff !important; }
.pb-navbar .navbar-toggler { border-color: rgba(255,255,255,0.4); }

/* ---------- Bottom mobile nav (public site) ---------- */
.pb-bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1030;
    background: var(--surface);
    border-top: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    display: flex;
}
.pb-bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.2rem 0.4rem;
    font-size: 0.68rem;
    color: #7a8a93;
    text-decoration: none;
    font-weight: 600;
}
.pb-bottom-nav a svg { display: block; margin: 0 auto 0.15rem; }
.pb-bottom-nav a.active { color: var(--court-green-dark); }
@media (min-width: 992px) {
    .pb-bottom-nav { display: none; }
    body { padding-bottom: 0; }
}

/* ---------- Hero ---------- */
.pb-hero {
    background: radial-gradient(circle at 15% 20%, rgba(255,255,255,0.18), transparent 45%),
                linear-gradient(135deg, var(--court-green-dark), var(--court-green) 55%, var(--sky));
    color: #fff;
    border-radius: 0 0 2rem 2rem;
    padding: 2.75rem 1.25rem 3rem;
    position: relative;
    overflow: hidden;
}
.pb-hero::after {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.12) 2px, transparent 2px);
    background-size: 26px 26px;
    opacity: 0.5;
}
.pb-hero h1 { font-weight: 800; letter-spacing: -0.02em; }
.pb-hero .pb-hero-icon { opacity: 0.9; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15)); }

/* ---------- Cards ---------- */
.pb-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(29, 53, 87, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pb-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(29, 53, 87, 0.14); }
.pb-card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(29,53,87,0.08);
    font-weight: 700;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.stat-tile {
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.stat-tile .stat-value { font-size: 1.7rem; font-weight: 800; }
.stat-tile.tile-green { background: linear-gradient(135deg, var(--court-green-dark), var(--court-green)); }
.stat-tile.tile-orange { background: linear-gradient(135deg, #e85d04, var(--ball-orange)); }
.stat-tile.tile-grape { background: linear-gradient(135deg, #5a189a, var(--grape)); }
.stat-tile.tile-sky { background: linear-gradient(135deg, #0077b6, var(--sky)); }

/* ---------- Buttons ---------- */
.btn-pb-primary {
    background: linear-gradient(120deg, var(--court-green-dark), var(--court-green));
    border: none; color: #fff; font-weight: 600; border-radius: 999px;
}
.btn-pb-primary:hover { color: #fff; filter: brightness(1.08); }
.btn-pb-accent {
    background: linear-gradient(120deg, #e85d04, var(--ball-orange));
    border: none; color: #fff; font-weight: 600; border-radius: 999px;
}
.btn-pb-accent:hover { color: #fff; filter: brightness(1.08); }
.btn-outline-pb {
    border: 2px solid var(--court-green); color: var(--court-green-dark);
    font-weight: 600; border-radius: 999px; background: transparent;
}
.btn-outline-pb:hover { background: var(--court-green); color: #fff; }
.rounded-pill-btn { border-radius: 999px !important; }

/* ---------- Badges ---------- */
.community-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.22rem 0.65rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 600; color: #fff;
}
.community-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; display: inline-block; }
.status-badge { font-weight: 600; border-radius: 999px; padding: 0.32em 0.7em; }

/* ---------- Tables ---------- */
.pb-table thead th {
    background: var(--ink); color: #fff; font-weight: 600;
    border: none; white-space: nowrap;
}
.pb-table tbody tr:nth-child(even) { background: rgba(46,196,182,0.06); }
.pb-table td, .pb-table th { vertical-align: middle; }
.rank-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.7rem; height: 1.7rem; border-radius: 50%;
    background: var(--bg); font-weight: 700; font-size: 0.85rem;
}
.rank-badge.rank-1 { background: #ffd60a; color: #7a5c00; }
.rank-badge.rank-2 { background: #d9d9d9; color: #444; }
.rank-badge.rank-3 { background: #e0a96d; color: #5b3a13; }

/* ---------- Bracket ---------- */
.bracket-wrap { display: flex; gap: 1.5rem; overflow-x: auto; padding-bottom: 1rem; }
.bracket-col { display: flex; flex-direction: column; justify-content: space-around; gap: 1rem; min-width: 220px; }
.bracket-match {
    background: var(--surface); border-radius: var(--radius-md);
    box-shadow: 0 3px 10px rgba(29,53,87,0.1); padding: 0.6rem 0.8rem; font-size: 0.85rem;
}
.bracket-match .team-row { display: flex; justify-content: space-between; padding: 0.15rem 0; }
.bracket-match .team-row.winner { font-weight: 700; color: var(--court-green-dark); }
.bracket-col-title { text-align: center; font-weight: 700; color: var(--ink); margin-bottom: 0.25rem; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }

/* ---------- Login ---------- */
.pb-auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--court-green-dark), var(--grape));
    padding: 1rem;
}
.pb-auth-card { background: #fff; border-radius: 1.25rem; box-shadow: 0 20px 45px rgba(0,0,0,0.25); padding: 2rem; max-width: 400px; width: 100%; }

/* ---------- Footer ---------- */
.pb-footer {
    background: var(--ink); color: rgba(255,255,255,0.75);
    padding: 1.25rem 1rem; text-align: center; font-size: 0.85rem;
    margin-top: 2.5rem;
}
.pb-footer strong { color: #fff; }
.pb-footer a { color: #fff; text-decoration: none; }
.pb-footer a:hover { color: var(--court-green); }

/* ---------- Misc ---------- */
.section-title { font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 0.5rem; }
.form-control, .form-select { border-radius: var(--radius-md); }
.form-control:focus, .form-select:focus { border-color: var(--court-green); box-shadow: 0 0 0 0.2rem rgba(46,196,182,0.2); }
/* Horizontally-scrollable table: a visible edge shadow hints there's more to
   see, and fades away as you scroll toward that side (classic scroll-shadow
   technique — two gradients scroll with the content, two stay pinned to the
   viewport edge, so the shadow only shows while there's unseen content past it). */
.table-responsive {
    border-radius: var(--radius-md);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    background:
        linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)) left,
        linear-gradient(to right, rgba(255,255,255,0), var(--surface) 70%) right,
        linear-gradient(to right, rgba(29,53,87,0.25), rgba(29,53,87,0)) left,
        linear-gradient(to left, rgba(29,53,87,0.25), rgba(29,53,87,0)) right;
    background-repeat: no-repeat;
    background-color: var(--surface);
    background-size: 24px 100%, 24px 100%, 10px 100%, 10px 100%;
    background-attachment: local, local, scroll, scroll;
}

@media (max-width: 576px) {
    .pb-hero { padding: 2rem 1rem 2.25rem; border-radius: 0 0 1.4rem 1.4rem; }
    .pb-hero h1 { font-size: 1.5rem; }
    .stat-tile .stat-value { font-size: 1.4rem; }
}
