/* GridironSync — bold, modern UI
   Big type, high-contrast color, chunky cards. */

:root {
    --bg:        #0d1117;
    --bg-2:      #161b22;
    --surface:   #1c2230;
    --surface-2: #232b3b;
    --line:      #2d3748;
    --text:      #e6edf3;
    --muted:     #8b97a8;

    --primary:   #ff5a1f;   /* bold gridiron orange */
    --primary-2: #ff7a45;
    --accent:    #1f6feb;   /* electric blue */
    --green:     #2ea043;
    --red:       #e5484d;
    --yellow:    #d29922;

    --radius:    14px;
    --radius-sm: 9px;
    --shadow:    0 10px 30px rgba(0,0,0,.35);
    --font:      'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.theme {
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(255,90,31,.12), transparent 60%),
        radial-gradient(900px 500px at -10% 10%, rgba(31,111,235,.12), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.5;
    min-height: 100vh;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top bar -------------------------------------------------------------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem; border-bottom: 1px solid var(--line);
    background: rgba(13,17,23,.7); backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--primary); }
.brand-accent { color: var(--accent); }
.topnav { display: flex; align-items: center; gap: 1.1rem; }
.topnav a { color: var(--text); font-weight: 600; }
.topnav a:hover { color: var(--text); text-decoration: none; }
.who { color: var(--text); font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; }
.who:hover { text-decoration: none; color: var(--text); filter: brightness(1.1); }
.role-chip {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
    background: var(--surface-2); color: var(--muted);
    padding: .15rem .5rem; border-radius: 999px; border: 1px solid var(--line);
}
.inline { display: inline; }

/* Layout --------------------------------------------------------------- */
.container { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.footer { text-align: center; color: var(--muted); padding: 2rem; border-top: 1px solid var(--line); }
.page-title { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin: 0 0 1.25rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.section-label { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; margin: 1.8rem 0 .6rem; }
.muted { color: var(--muted); }

/* Hero ----------------------------------------------------------------- */
.hero { text-align: center; padding: 3.5rem 0 2.5rem; }
.hero-title { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 900; letter-spacing: -.04em; margin: 0 auto 1rem; max-width: 18ch; }
.hl { color: var(--primary); }
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 60ch; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }
.hero-meta { margin-top: 1.5rem; color: var(--muted); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 2.5rem; }
.feature-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.feature-card h3 { margin: 0 0 .4rem; font-size: 1.1rem; }
.feature-card p { margin: 0; color: var(--muted); }

/* Buttons -------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
    white-space: nowrap;
    padding: .6rem 1.1rem; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
    transition: transform .05s ease, filter .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .4rem .75rem; font-size: .85rem; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-color: transparent; color: #1a0d06; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(229,72,77,.12); }

/* Cards / panels ------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 .5rem; }
.task-list { list-style: none; padding: 0; margin: .6rem 0 0; }
.task-list li { padding: .5rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.task-list li:last-child { border-bottom: none; }
.soon { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--yellow); border: 1px solid rgba(210,153,34,.4); border-radius: 999px; padding: .1rem .5rem; }

.season-banner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin-bottom: 1.5rem; }
.season-banner h2 { margin: .2rem 0 0; }
.season-dates { display: flex; gap: 1.8rem; flex-wrap: wrap; }
.season-dates > div { display: flex; flex-direction: column; }
.season-dates .muted { font-size: .8rem; }

/* Status pills --------------------------------------------------------- */
.status-pill { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--line); }
.status-draft { color: var(--yellow); border-color: rgba(210,153,34,.4); }
.status-published, .status-active { color: var(--green); border-color: rgba(46,160,67,.4); }
.status-locked { color: var(--accent); border-color: rgba(31,111,235,.4); }
.status-invited { color: var(--yellow); border-color: rgba(210,153,34,.4); }
.status-disabled { color: var(--muted); }

/* Forms ---------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; }
.field span { font-size: .9rem; }
.field input, .field select {
    font-family: inherit; font-size: 1rem; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .8rem;
}
.field input:focus, .field select:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.auth-card, .form-card { max-width: 420px; margin: 2rem auto; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.form-card { max-width: 520px; margin: 0; }
.auth-title { margin: 0 0 .3rem; font-size: 1.6rem; font-weight: 800; }

/* Tables --------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg-2); }
.table tr:last-child td { border-bottom: none; }
.row-actions { text-align: right; }

/* Flash / states ------------------------------------------------------- */
.flash { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 600; border: 1px solid var(--line); }
.flash-success { background: rgba(46,160,67,.12); border-color: rgba(46,160,67,.4); color: #7ee787; }
.flash-error { background: rgba(229,72,77,.12); border-color: rgba(229,72,77,.4); color: #ff9a9d; }
.flash-info { background: rgba(31,111,235,.12); border-color: rgba(31,111,235,.4); color: #79c0ff; }

.empty-state, .error-state { text-align: center; padding: 3rem 1rem; }
.error-code { font-size: 4rem; font-weight: 900; margin: 0; color: var(--primary); }

/* Declaration area ----------------------------------------------------- */
.assoc-switch { display: inline-flex; align-items: center; gap: .5rem; }
.assoc-switch select { font-family: inherit; font-size: .95rem; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .7rem; }

.subnav { display: flex; flex-wrap: wrap; gap: .4rem; border-bottom: 1px solid var(--line); margin: 0 0 1.5rem; }
.subnav-tab { padding: .6rem .95rem; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav-tab:hover { color: var(--text); text-decoration: none; }
.subnav-tab.is-active { color: var(--text); border-bottom-color: var(--primary); }

.help { color: var(--muted); margin: 0 0 1.25rem; max-width: 70ch; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.toolbar .field { flex: 0 0 auto; }
.grade-block { margin-bottom: 1.8rem; }
.grade-block > h3 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .6rem; }
.count-chip { font-size: .75rem; font-weight: 700; color: var(--muted); background: var(--surface-2);
    border: 1px solid var(--line); border-radius: 999px; padding: .12rem .55rem; }

.row-inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.row-inline .field { flex: 1 1 160px; }
.checkbox-row { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.checkbox-row input { width: 1.05rem; height: 1.05rem; accent-color: var(--primary); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-size: .78rem; font-weight: 600; color: var(--text); background: var(--surface-2);
    border: 1px solid var(--line); border-radius: 999px; padding: .18rem .6rem; }
.chip-muted { color: var(--muted); }
.chip-good { color: #7ee787; border-color: rgba(46,160,67,.5); background: rgba(46,160,67,.10); }
.chip-warn { color: var(--yellow); border-color: rgba(210,153,34,.5); background: rgba(210,153,34,.10); }
.chip-bad  { color: #ff9a9d; border-color: rgba(229,72,77,.5); background: rgba(229,72,77,.10); }

/* Field-availability X-grid -------------------------------------------- */
.grid-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.grid-table { border-collapse: collapse; min-width: 100%; background: var(--surface); }
.grid-table th, .grid-table td { border: 1px solid var(--line); padding: .45rem .55rem; text-align: center; white-space: nowrap; }
.grid-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--bg-2); }
.grid-table th.date-col, .grid-table td.date-col { text-align: left; position: sticky; left: 0; background: var(--bg-2); z-index: 1; }
.grid-table td.date-col { background: var(--surface); font-weight: 600; }
.grid-table tr.super td.date-col { color: var(--primary); }
.grid-cell input { width: 1.15rem; height: 1.15rem; accent-color: var(--primary); cursor: pointer; }
.grid-actions { display: flex; gap: .6rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }

/* Slot-menu editor (field form) ---------------------------------------- */
.slot-editor { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.slot-editor input[type=time] { font-family: inherit; font-size: 1rem; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .6rem; }
.slot-pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface-2);
    border: 1px solid var(--line); border-radius: 999px; padding: .25rem .3rem .25rem .7rem; font-weight: 600; }
.slot-pill button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .25rem; }
.slot-pill button:hover { color: var(--red); }

.empty-hint { color: var(--muted); background: var(--surface); border: 1px dashed var(--line);
    border-radius: var(--radius); padding: 1.5rem; text-align: center; }

/* Guides --------------------------------------------------------------- */
.guide { max-width: 70ch; }
.guide h2 { margin: 1.8rem 0 .6rem; font-size: 1.3rem; }
.guide h3 { margin: 1.4rem 0 .4rem; font-size: 1.05rem; }
.guide p, .guide li { color: var(--text); }
.guide ol.steps { counter-reset: step; list-style: none; padding: 0; margin: .6rem 0; }
.guide ol.steps > li { position: relative; padding: .2rem 0 1rem 2.6rem; border-left: 2px solid var(--line); margin-left: .8rem; }
.guide ol.steps > li::before { counter-increment: step; content: counter(step);
    position: absolute; left: -1.05rem; top: 0; width: 2rem; height: 2rem; border-radius: 50%;
    background: var(--primary); color: #1a0d06; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.guide ol.steps > li:last-child { border-left-color: transparent; }
.guide ul.bullets { margin: .4rem 0; }
.guide .callout { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm); padding: .8rem 1rem; margin: 1rem 0; }
.guide code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: .05rem .35rem; font-size: .9em; }

@media (max-width: 640px) {
    /* Stack the header: brand on its own row, nav wraps full-width beneath it. */
    .topbar { flex-wrap: wrap; padding: .7rem 1rem; gap: .35rem .9rem; }
    .brand { font-size: 1.15rem; }
    .topnav {
        width: 100%; flex-wrap: wrap; justify-content: flex-start;
        gap: .5rem .9rem; row-gap: .5rem;
    }
    .topnav a { font-size: .95rem; }
    .topnav .who { display: none; }
    .container { padding: 1.5rem 1.1rem 3rem; }
    .season-dates { gap: 1rem; }
}
