/* =============================================================================
   Football Database — Front-end styles
   Designed to match the reference screenshots.
   ============================================================================= */

/* ---- Reset / base --------------------------------------------------------- */
.fdb-app,
.fdb-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    max-width: 1300px;
}

.fdb-pane { width: 100%; }

.fdb-notice {
    padding: 12px 16px;
    background: #fff3cd;
    border-left: 4px solid #f0ad4e;
    border-radius: 2px;
    margin: 10px 0;
}

/* ---- Breadcrumb ----------------------------------------------------------- */
.fdb-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}

.fdb-back-schools {
    background: none;
    border: 1px solid #2271b1;
    color: #2271b1;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}
.fdb-back-schools:hover { background: #2271b1; color: #fff; }

.fdb-bc-team { font-weight: 600; color: #333; }

/* ---- Section title -------------------------------------------------------- */
.fdb-section-title {
    font-size: 1.6em;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

/* ---- Toolbar -------------------------------------------------------------- */
.fdb-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.fdb-search-input {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 240px;
    outline: none;
}
.fdb-search-input:focus { border-color: #2271b1; box-shadow: 0 0 0 2px rgba(34,113,177,.15); }

/* ---- Scrollable wrapper --------------------------------------------------- */
.fdb-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 4px;
}

/* ---- Base table ----------------------------------------------------------- */
.fdb-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 600px;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.fdb-table th,
.fdb-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #ebebeb;
    white-space: nowrap;
    font-size: 13px;
}

.fdb-table th {
    background: #f7f8fa;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .3px;
    color: #555;
    border-bottom: 2px solid #d0d4da;
    position: sticky;
    top: 0;
    z-index: 2;
    user-select: none;
}

.fdb-table tbody tr:hover { background: #f2f5fa; }
.fdb-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.banner-col { text-align: center !important; }

/* ---- Sortable headers ----------------------------------------------------- */
.fdb-sort { cursor: pointer; padding-right: 20px !important; position: relative; }
.fdb-sort::after { content: "⇅"; position: absolute; right: 4px; opacity: .3; font-size: 11px; }
.fdb-sort.asc::after  { content: "↑"; opacity: .75; }
.fdb-sort.desc::after { content: "↓"; opacity: .75; }

/* ---- Schools table -------------------------------------------------------- */
.fdb-school-name-cell { min-width: 160px; }

.fdb-team-link {
    background: none;
    border: none;
    padding: 0;
    color: #1a6ea8;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    font-weight: 500;
}
.fdb-team-link:hover { text-decoration: underline; color: #0d4f7a; }

.fdb-schools-table .pos { color: #197a3e; font-weight: 500; }
.fdb-schools-table .neg { color: #c0392b; font-weight: 500; }

/* ---- Team / seasons header ------------------------------------------------ */
.fdb-team-title { font-size: 1.5em; margin: 0 0 4px; font-weight: 700; }
.fdb-team-meta  { color: #666; margin: 0 0 14px; font-size: 12px; }

/* ---- Seasons table -------------------------------------------------------- */
.fdb-expand-col { width: 26px; padding: 0 !important; }
.fdb-expand-btn {
    cursor: pointer;
    color: #2271b1;
    font-size: 11px;
    text-align: center;
    width: 26px;
    padding: 6px 4px !important;
    display: inline-block;
    transition: transform .15s;
}
.fdb-expand-btn.open { color: #1a6ea8; }

.fdb-year { font-weight: 600; color: #1a6ea8; }

/* Championship row highlight */
.fdb-seasons-table .is-champ { background: #fffdf0 !important; }
.fdb-seasons-table .is-champ:hover { background: #fffae0 !important; }
.fdb-seasons-table .is-champ .fdb-year { color: #b8860b; }

/* ---- Banners ------------------------------------------------------------- */
.fdb-banners-cell { text-align: center; min-width: 50px; }
.fdb-banner { font-size: 16px; display: inline-block; line-height: 1; }
.fdb-banner-gold  { filter: sepia(1) saturate(4) hue-rotate(5deg);  }   /* golden */
.fdb-banner-green { filter: sepia(1) saturate(3) hue-rotate(85deg); }   /* green  */
.fdb-banner-blue  { filter: sepia(1) saturate(2) hue-rotate(190deg); }  /* blue   */

/* ---- Playoff labels ------------------------------------------------------- */
.fdb-playoff-label { font-weight: 700; font-size: 12px; min-width: 50px; }
.playoff-champ  { color: #b8860b; }
.playoff-runner { color: #6c757d; }
.playoff-sf     { color: #0d6efd; }
.playoff-qf     { color: #0d6efd; }
.playoff-2r     { color: #6c757d; }
.playoff-1r     { color: #aaa; }
.playoff-seed   { color: #555; }

/* ---- Expanded games row --------------------------------------------------- */
.fdb-games-row > td {
    padding: 0 !important;
    background: #f5f7fa;
    border-bottom: 2px solid #c8cdd5;
}

.fdb-games-inner {
    padding: 0 12px 14px 32px;
}

.fdb-loading {
    padding: 14px 8px;
    color: #888;
    font-style: italic;
    font-size: 13px;
}

.fdb-loading-team {
    padding: 40px;
    text-align: center;
    font-size: 15px;
}

/* ---- Game detail table ---------------------------------------------------- */
.fdb-games-table {
    border-collapse: collapse;
    font-size: 12.5px;
    min-width: 520px;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #dde0e5;
}

.fdb-games-table th,
.fdb-games-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #e8eaee;
    text-align: left;
    white-space: nowrap;
}

.fdb-games-table th {
    background: #edf0f4;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #555;
    border-bottom: 2px solid #c8cdd5;
}

.fdb-games-table .num { text-align: right; }
.fdb-date  { color: #555; min-width: 60px; }
.fdb-loc   { font-weight: 700; color: #777; text-align: center; width: 28px; }
.fdb-coach { color: #555; }

/* Section header rows (Regular season / Playoffs) */
.fdb-section-header td {
    background: #e6eaf0;
    font-weight: 700;
    font-size: 12px;
    color: #444;
    padding: 4px 10px !important;
    letter-spacing: .3px;
    border-bottom: 1px solid #c0c6ce;
}

/* Result cell */
.fdb-result { font-weight: 700; }
.fdb-result.w { color: #1a7a42; }
.fdb-result.l { color: #c0392b; }
.fdb-result.t { color: #7a7a00; }

/* Row colouring by result */
.fdb-game-w { background: #f2fbf5; }
.fdb-game-l { background: #fdf4f4; }
.fdb-game-t { background: #fdfdf0; }

/* Non-region games (diagonal stripe overlay) */
.fdb-nonregion {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(0,0,0,.03) 5px,
        rgba(0,0,0,.03) 10px
    );
}
.fdb-game-w.fdb-nonregion { background-color: #f2fbf5; }
.fdb-game-l.fdb-nonregion { background-color: #fdf4f4; }

/* Region-game dot */
.fdb-region-dot { color: #1a6ea8; font-size: 8px; vertical-align: middle; margin-right: 3px; }

/* Watch link */
.fdb-watch-link { color: #1a6ea8; text-decoration: none; font-size: 14px; }
.fdb-watch-link:hover { color: #0d4f7a; }

/* Empty state */
.fdb-empty {
    text-align: center !important;
    color: #999;
    font-style: italic;
    padding: 20px !important;
}

/* =============================================================================
   Admin styles
   ============================================================================= */
.fdb-admin-wrap h1 { margin-bottom: 20px; }

.fdb-admin-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 20px;
    max-width: 900px;
}
.fdb-admin-card h2 {
    margin-top: 0;
    font-size: 1.1em;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 14px;
}

.fdb-progress-bar-wrap {
    background: #e9ecef;
    border-radius: 4px;
    height: 18px;
    overflow: hidden;
    margin-bottom: 6px;
}
.fdb-progress-bar {
    background: linear-gradient(90deg, #2271b1, #1a6ea8);
    height: 100%;
    transition: width .3s ease;
    border-radius: 4px;
}

#fdb-upload-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.fdb-team-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
}
.fdb-team-badge {
    background: #f0f0f1;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 7px;
    font-size: 12px;
}
.fdb-team-badge code { color: #2271b1; font-size: 11px; }
