/* ============================================================================
   PrimeBet Predict — "Pitch Night" Design System
   Dark green stadium aesthetic. Shared across all public/admin views.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Archivo+Expanded:wght@600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* -- Pitch Night palette -- */
    --pn-bg-base:        #0a1510;   /* near-black pitch at night */
    --pn-bg-surface:     #0f1f17;   /* card/panel base */
    --pn-bg-surface-2:   #14291e;   /* elevated surface */
    --pn-bg-glass:       rgba(20, 41, 30, 0.55);
    --pn-border:         rgba(120, 200, 150, 0.14);
    --pn-border-strong:  rgba(120, 200, 150, 0.28);

    --pn-turf:           #1b6b3f;   /* primary pitch green */
    --pn-turf-bright:    #2fae63;   /* floodlight green accent */
    --pn-turf-glow:      #4ade80;   /* highest-energy accent (confidence high) */
    --pn-chalk:          #eef7f0;   /* line-marking white */
    --pn-gold:           #d4af37;   /* premium / VIP accent */
    --pn-amber:          #f5a524;   /* medium risk */
    --pn-crimson:        #ef4444;   /* high risk / error */

    --pn-text-primary:   #eef7f0;
    --pn-text-secondary: #9fb8a8;
    --pn-text-muted:     #6b8578;

    --pn-font-display:   'Archivo Expanded', 'Inter', sans-serif;
    --pn-font-body:      'Inter', -apple-system, sans-serif;
    --pn-font-mono:      'JetBrains Mono', ui-monospace, monospace;

    --pn-radius-sm: 8px;
    --pn-radius-md: 14px;
    --pn-radius-lg: 22px;
    --pn-radius-full: 999px;

    --pn-shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
    --pn-shadow-glow: 0 0 40px rgba(47, 174, 99, 0.15);

    color-scheme: dark;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    font-family: var(--pn-font-body);
    background:
        radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(47, 174, 99, 0.12), transparent 60%),
        linear-gradient(180deg, var(--pn-bg-base) 0%, #081210 100%);
    color: var(--pn-text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Faint turf-line texture behind hero/marketing sections */
.pn-turf-lines {
    position: relative;
    overflow: hidden;
}
.pn-turf-lines::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0, transparent 78px,
        rgba(120, 200, 150, 0.045) 78px, rgba(120, 200, 150, 0.045) 80px
    );
    pointer-events: none;
    mask-image: linear-gradient(180deg, black, transparent 85%);
}

h1, h2, h3, h4, .pn-display {
    font-family: var(--pn-font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; color: var(--pn-text-secondary); }

a { color: var(--pn-turf-bright); text-decoration: none; }
a:hover { color: var(--pn-turf-glow); }

.pn-mono { font-family: var(--pn-font-mono); font-variant-numeric: tabular-nums; }

:focus-visible {
    outline: 2px solid var(--pn-turf-glow);
    outline-offset: 2px;
    border-radius: 4px;
}

/* -- Layout -- */
.pn-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.pn-grid { display: grid; gap: 20px; }
.pn-grid-2 { grid-template-columns: repeat(2, 1fr); }
.pn-grid-3 { grid-template-columns: repeat(3, 1fr); }
.pn-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Hero split layout (text + sample card). Needs its own breakpoint since
   its column ratio (1.1fr/0.9fr) differs from the generic .pn-grid-2, and
   it must stack to a single column well before the card gets clipped off
   the edge of small screens. */
.pn-hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 48px;
}

/* General-purpose responsive split for two-column detail layouts (used
   across admin + dashboard pages: profile, analytics, prediction detail,
   user detail, etc). Column ratio is set per-instance via inline
   grid-template-columns for the desktop layout (kept, since each of these
   panels needs a different ratio), but this class guarantees every one of
   them collapses to a single column below 860px instead of being clipped
   off the edge of the viewport on mobile — the desktop ratio through
   `style=""` always loses to this rule at narrow widths because the media
   query is more specific at that breakpoint. */
.pn-split {
    align-items: start;
}
@media (max-width: 860px) {
    .pn-split { grid-template-columns: 1fr !important; }
}

@media (max-width: 900px) {
    .pn-grid-3, .pn-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .pn-hero-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 600px) {
    .pn-grid-2, .pn-grid-3, .pn-grid-4 { grid-template-columns: 1fr; }
}

/* -- Glassmorphism card -- */
.pn-card {
    background: var(--pn-bg-glass);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--pn-border);
    border-radius: var(--pn-radius-lg);
    padding: 28px;
    box-shadow: var(--pn-shadow-card);
    transition: border-color 0.25s ease, transform 0.25s ease;
}
.pn-card:hover { border-color: var(--pn-border-strong); }
.pn-card--flat { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--pn-bg-surface); }

/* -- Buttons -- */
.pn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--pn-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 13px 24px;
    border-radius: var(--pn-radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.pn-btn:active { transform: scale(0.97); }

.pn-btn--primary {
    background: linear-gradient(135deg, var(--pn-turf-bright), var(--pn-turf));
    color: #04140b;
    box-shadow: 0 4px 20px rgba(47, 174, 99, 0.35);
}
.pn-btn--primary:hover { box-shadow: 0 6px 28px rgba(47, 174, 99, 0.5); color: #04140b; }

.pn-btn--ghost {
    background: transparent;
    border-color: var(--pn-border-strong);
    color: var(--pn-text-primary);
}
.pn-btn--ghost:hover { border-color: var(--pn-turf-bright); color: var(--pn-turf-glow); }

.pn-btn--gold {
    background: linear-gradient(135deg, #f0d474, var(--pn-gold));
    color: #241c02;
}

.pn-btn--danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}
.pn-btn--danger:hover { background: rgba(239, 68, 68, 0.2); }

.pn-btn--sm { padding: 8px 16px; font-size: 0.85rem; }
.pn-btn--block { width: 100%; }
.pn-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* -- Forms -- */
.pn-field { margin-bottom: 18px; }
.pn-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pn-text-secondary);
    margin-bottom: 8px;
}
.pn-input, .pn-select, .pn-textarea {
    width: 100%;
    background: rgba(8, 18, 13, 0.6);
    border: 1px solid var(--pn-border);
    border-radius: var(--pn-radius-sm);
    padding: 12px 16px;
    color: var(--pn-text-primary);
    font-family: var(--pn-font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pn-input:focus, .pn-select:focus, .pn-textarea:focus {
    outline: none;
    border-color: var(--pn-turf-bright);
    box-shadow: 0 0 0 3px rgba(47, 174, 99, 0.15);
}
.pn-input::placeholder { color: var(--pn-text-muted); }
.pn-textarea { resize: vertical; min-height: 120px; }
.pn-error-text { color: #fca5a5; font-size: 0.82rem; margin-top: 6px; }
.pn-help-text { color: var(--pn-text-muted); font-size: 0.82rem; margin-top: 6px; }

.pn-checkbox-row { display: flex; align-items: center; gap: 10px; }
.pn-checkbox-row input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--pn-turf-bright);
}

/* -- Badges -- */
.pn-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--pn-radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--pn-font-mono);
}
.pn-badge--low, .pn-badge--success { background: rgba(74, 222, 128, 0.15); color: var(--pn-turf-glow); }
.pn-badge--medium, .pn-badge--warning { background: rgba(245, 165, 36, 0.15); color: var(--pn-amber); }
.pn-badge--high, .pn-badge--danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.pn-badge--neutral { background: rgba(159, 184, 168, 0.12); color: var(--pn-text-secondary); }
.pn-badge--gold { background: rgba(212, 175, 55, 0.15); color: var(--pn-gold); }

/* -- Signature component: Match Strip with Confidence Dial --
   This is the platform's memorable UI signature: each analyzed match
   renders as a horizontal "strip" echoing a scoreboard/ticket stub, with
   a circular SVG confidence dial standing in for a stadium floodlight. */
.pn-match-strip {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--pn-bg-surface);
    border: 1px solid var(--pn-border);
    border-radius: var(--pn-radius-md);
    padding: 18px 22px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}
.pn-match-strip::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--pn-turf-bright);
}
.pn-match-strip--low::before { background: var(--pn-turf-glow); }
.pn-match-strip--medium::before { background: var(--pn-amber); }
.pn-match-strip--high::before { background: var(--pn-crimson); }

.pn-match-strip__teams {
    flex: 1;
    min-width: 0;
}
.pn-match-strip__fixture {
    font-family: var(--pn-font-display);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pn-match-strip__meta {
    font-size: 0.82rem;
    color: var(--pn-text-muted);
    font-family: var(--pn-font-mono);
}

.pn-dial {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}
.pn-dial svg { transform: rotate(-90deg); }
.pn-dial__track { fill: none; stroke: rgba(159, 184, 168, 0.15); stroke-width: 6; }
.pn-dial__value { fill: none; stroke: var(--pn-turf-glow); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.pn-dial--medium .pn-dial__value { stroke: var(--pn-amber); }
.pn-dial--high .pn-dial__value { stroke: var(--pn-crimson); }
.pn-dial__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--pn-font-mono);
    font-weight: 600;
    font-size: 0.88rem;
}

/* -- Stat cards -- */
.pn-stat-card {
    background: var(--pn-bg-surface);
    border: 1px solid var(--pn-border);
    border-radius: var(--pn-radius-md);
    padding: 22px;
}
.pn-stat-card__label {
    font-size: 0.8rem;
    color: var(--pn-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.pn-stat-card__value {
    font-family: var(--pn-font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--pn-text-primary);
}
.pn-stat-card__delta { font-size: 0.82rem; margin-top: 6px; }
.pn-stat-card__delta--up { color: var(--pn-turf-glow); }
.pn-stat-card__delta--down { color: #fca5a5; }

/* -- Tables -- */
.pn-table-wrap { overflow-x: auto; border-radius: var(--pn-radius-md); border: 1px solid var(--pn-border); }
.pn-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pn-table th {
    text-align: left;
    padding: 14px 18px;
    background: var(--pn-bg-surface-2);
    color: var(--pn-text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.pn-table td {
    padding: 14px 18px;
    border-top: 1px solid var(--pn-border);
    vertical-align: middle;
}
.pn-table tbody tr { transition: background 0.15s ease; }
.pn-table tbody tr:hover { background: rgba(120, 200, 150, 0.04); }

/* -- Navigation -- */
.pn-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 21, 16, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--pn-border);
}
.pn-navbar__inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.pn-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--pn-font-display);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--pn-text-primary);
}
.pn-logo__mark {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--pn-turf-bright), var(--pn-turf));
    display: flex; align-items: center; justify-content: center;
    color: #04140b; font-weight: 800; font-size: 1.05rem;
}
.pn-nav-links { display: flex; align-items: center; gap: 28px; }
.pn-nav-links a { color: var(--pn-text-secondary); font-weight: 500; font-size: 0.92rem; }
.pn-nav-links a:hover, .pn-nav-links a.active { color: var(--pn-text-primary); }
.pn-nav-actions { display: flex; align-items: center; gap: 12px; }

@media (max-width: 860px) {
    .pn-nav-links { display: none; }
}

/* -- Sidebar (dashboard/admin) -- */
.pn-shell { display: flex; min-height: 100vh; }
.pn-sidebar {
    width: 264px;
    flex-shrink: 0;
    background: var(--pn-bg-surface);
    border-right: 1px solid var(--pn-border);
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.pn-sidebar__section-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pn-text-muted);
    padding: 16px 12px 8px;
}
.pn-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--pn-radius-sm);
    color: var(--pn-text-secondary);
    font-weight: 500;
    font-size: 0.92rem;
    margin-bottom: 2px;
    transition: background 0.15s ease, color 0.15s ease;
}
.pn-sidebar__link:hover { background: rgba(120, 200, 150, 0.06); color: var(--pn-text-primary); }
.pn-sidebar__link.active {
    background: rgba(47, 174, 99, 0.14);
    color: var(--pn-turf-glow);
    font-weight: 600;
}
.pn-sidebar__link svg { flex-shrink: 0; width: 18px; height: 18px; }

.pn-main { flex: 1; min-width: 0; }
.pn-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    border-bottom: 1px solid var(--pn-border);
    background: rgba(10, 21, 16, 0.4);
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(10px);
}
.pn-content { padding: 32px; }

@media (max-width: 960px) {
    .pn-sidebar { position: fixed; left: -280px; z-index: 60; transition: left 0.25s ease; box-shadow: 20px 0 40px rgba(0,0,0,0.4); }
    .pn-sidebar.open { left: 0; }
    .pn-content { padding: 20px; }
    .pn-topbar { padding: 14px 20px; }
    .pn-topbar [data-sidebar-toggle] { display: inline-flex !important; }
}

/* -- Alerts / flash messages -- */
.pn-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--pn-radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.pn-alert--success { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.25); color: var(--pn-turf-glow); }
.pn-alert--error { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.pn-alert--info { background: rgba(120, 200, 150, 0.08); border-color: var(--pn-border-strong); color: var(--pn-text-primary); }

/* -- Progress / loading -- */
.pn-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(159, 184, 168, 0.12);
    border-radius: var(--pn-radius-full);
    overflow: hidden;
}
.pn-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pn-turf), var(--pn-turf-bright));
    border-radius: var(--pn-radius-full);
    transition: width 0.4s ease;
}

@keyframes pn-pulse-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.04); }
}
.pn-pulse { animation: pn-pulse-glow 1.8s ease-in-out infinite; }

@keyframes pn-spin { to { transform: rotate(360deg); } }
.pn-spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(159, 184, 168, 0.2);
    border-top-color: var(--pn-turf-bright);
    border-radius: 50%;
    animation: pn-spin 0.7s linear infinite;
}

@keyframes pn-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.pn-fade-up { animation: pn-fade-up 0.5s ease both; }

/* -- Utility -- */
.pn-flex { display: flex; }
.pn-flex-col { flex-direction: column; }
.pn-items-center { align-items: center; }
.pn-justify-between { justify-content: space-between; }
.pn-gap-8 { gap: 8px; } .pn-gap-12 { gap: 12px; } .pn-gap-16 { gap: 16px; } .pn-gap-24 { gap: 24px; }
.pn-mt-8 { margin-top: 8px; } .pn-mt-16 { margin-top: 16px; } .pn-mt-24 { margin-top: 24px; } .pn-mt-32 { margin-top: 32px; }
.pn-mb-8 { margin-bottom: 8px; } .pn-mb-16 { margin-bottom: 16px; } .pn-mb-24 { margin-bottom: 24px; }
.pn-text-muted { color: var(--pn-text-muted); }
.pn-text-secondary { color: var(--pn-text-secondary); }
.pn-text-center { text-align: center; }
.pn-w-full { width: 100%; }
.pn-hidden { display: none !important; }

.pn-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pn-turf-bright), var(--pn-turf));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #04140b; font-size: 0.95rem;
    object-fit: cover;
    flex-shrink: 0;
}

.pn-empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--pn-text-muted);
}
.pn-empty-state svg { margin-bottom: 16px; opacity: 0.5; }

.pn-footer {
    border-top: 1px solid var(--pn-border);
    padding: 48px 24px 32px;
    margin-top: 80px;
    color: var(--pn-text-muted);
    font-size: 0.88rem;
}
