/* ==========================================================================
   Football Fam Admin: OUR additions to the designer's dark theme.
   ff-admin.css is the designer's file (replace it wholesale when a new one arrives);
   anything that is specific to this app and not in the style guide goes here, using
   the same --ff-* variables. Loaded straight after ff-admin.css.
   ========================================================================== */

/* The environment banner styles itself (partials/environment-banner.blade.php): it also appears on pages that do not load this file. */

/* ---------- Header: who is signed in ---------- */
.ff-user-chip { display: flex; align-items: center; gap: 12px; padding-right: 8px; }
.ff-user-name { color: var(--ff-text-2); font-size: 14px; }
.ff-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none;
  border-radius: 50%; background: var(--ff-elevated-3); color: var(--ff-text); font-size: 12px; font-weight: 600;
}
@media (max-width: 767.98px) { .ff-user-name { display: none; } }

/* ---------- Sidebar ---------- */
.c-sidebar .c-sidebar-brand .ff-logo-mark { display: none; }
.c-sidebar .c-sidebar-brand a { display: flex; align-items: center; }
/* the sidebar's own brand row is d-md-down-none; keep a logo on small screens too */
.c-header .c-header-brand .ff-logo { height: 28px; }

/* ---------- Login / password pages (layouts/app.blade.php) ---------- */
body.login-page, body.login-page .c-app { background: var(--ff-base); }
.ff-login-card { max-width: 420px; margin: 0 auto; padding: 8px; }
.ff-login-card .card-body { padding: 32px; }
.ff-login-card h1 { margin: 0 0 4px; }
.ff-login-card .ff-login-sub { color: var(--ff-text-3); font-size: 14px; margin-bottom: 24px; }
.ff-login-card .form-group { margin-bottom: 16px; }
.ff-login-card .input-group { flex-wrap: nowrap; }
.ff-login-card .ff-login-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 24px; }
.ff-login-card .ff-login-row .form-check { padding-left: 0; display: flex; align-items: center; gap: 10px; }
.ff-login-card .ff-login-row .form-check-input { position: static; margin: 0; }
.ff-login-card .ff-login-row .form-check-label { margin: 0; font-weight: 400; }
.ff-login-card .ff-login-row a { font-weight: 600; font-size: 14px; }
.ff-login-card .btn-block { width: 100%; }

/* ---------- Dashboard additions ---------- */
.ffd-kpi .lbl .ff-icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.ffd-range .btn[aria-current="true"] { background: var(--ff-primary); color: var(--ff-on-primary); }
.ffd-legend { list-style: none; margin: 16px 0 0; padding: 0; }
.ffd-legend li { display: flex; align-items: center; gap: 10px; padding: 4px 0; color: var(--ff-text-2); font-size: 14px; }
.ffd-legend .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ffd-legend .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ffd-legend .num { color: var(--ff-text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ffd-ring { position: relative; height: 180px; max-width: 180px; margin: 12px auto 0; }
.ffd-ring-total { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.ffd-ring-total strong { font: 800 28px/32px var(--ff-display); color: var(--ff-text); }
.ffd-ring-total span { font-size: 12px; color: var(--ff-text-3); }
.ffd-chart.short { height: 70px; margin-top: 8px; }
.ffd-subhead { margin-top: 16px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ff-text-3); }
.ffd-tag { display: inline-block; min-width: 38px; text-align: center; border-radius: var(--ff-r-small); padding: 1px 8px; background: var(--ff-error-bg); color: var(--ff-error); font-size: 12px; font-weight: 600; margin-right: 8px; }
.ffd-list td { padding: 10px 0; }
.ffd-list a { font-weight: 600; }
.ffd-queue li { padding: 12px 0; }
.ffd-queue a { color: var(--ff-text); }
.ffd-queue .ffd-pill { min-width: 34px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.ffd-empty { padding: 32px 0; }

/* ---------- Page chrome used by many CMS screens ---------- */
.c-main .container-fluid > .row > [class*="col-"] > .btn { margin-bottom: 16px; }
.card + .card { margin-top: 16px; }
.table-responsive { background: transparent; }
.dataTables_wrapper .dataTables_scrollHead, .dataTables_wrapper .dataTables_scrollBody { background: transparent; }
.dataTables_wrapper .dataTables_scrollBody { border-bottom: 0 !important; border-radius: 0 0 var(--ff-r-control) var(--ff-r-control); }
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_length { padding-top: 0; }
.dataTables_wrapper .dataTables_paginate { padding-top: 0; }
.dataTables_wrapper .dataTables_filter { margin: 0 0 12px; }
.dataTables_wrapper .dataTables_filter label { margin: 0; }
.dataTables_wrapper .dt-buttons { margin: 0 0 12px; }
table.dataTable.table td, table.dataTable.table th { border-color: var(--ff-border); }
.modal-dialog-centered .modal-content { box-shadow: var(--ff-overlay); }

/* Row actions: the style guide makes View / Edit the green OUTLINE button and keeps the gradient for the one main action on the page.
   The shared partials now say btn-info; a few controllers still build "btn btn-xs btn-primary" View links, so catch those here. */
.table .btn-xs.btn-primary, .table .btn-xs.btn-success { background: transparent; border-color: var(--ff-primary); color: var(--ff-primary); }
.table .btn-xs.btn-primary:hover, .table .btn-xs.btn-success:hover { background: var(--ff-primary-bg); color: var(--ff-primary); }

/* ---------- DataTables fixes found by looking at the real list pages ---------- */
/* jquery.dataTables.css paints every row white (and odd/even rows another shade): let the card show through. */
table.dataTable tbody tr, table.dataTable tbody tr.odd, table.dataTable tbody tr.even,
table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd,
table.dataTable.display tbody tr.even, table.dataTable.hover tbody tr:hover { background-color: transparent; }
table.dataTable.table-striped tbody tr.odd, table.dataTable.table-striped tbody tr.even { background-color: transparent; }
table.dataTable tbody tr:hover { background-color: rgba(255, 255, 255, 0.03); }
table.dataTable tbody tr.selected, table.dataTable tbody tr.selected:hover { background-color: var(--ff-primary-bg); }
table.dataTable tbody td.sorting_1, table.dataTable tbody td.sorting_2, table.dataTable tbody td.sorting_3 { background: transparent; }
/* The row-action Delete is <input type="submit" class="btn btn-xs btn-danger">; the theme's ".dataTables_wrapper input" rule (search box
   look) must not win over the button classes. */
.dataTables_wrapper input.btn, .dataTables_wrapper input[type="submit"].btn {
  min-height: 32px; padding: 5px 12px; font-size: 12px; line-height: 20px; border-radius: var(--ff-r-pill); width: auto; display: inline-flex;
}
.dataTables_wrapper input.btn-danger { background: var(--ff-error-bg); border: 1px solid transparent; color: var(--ff-error); }
.dataTables_wrapper input.btn-danger:hover { background: rgba(248, 113, 113, 0.18); }
.dataTables_wrapper input.btn-info { background: transparent; border: 1px solid var(--ff-primary); color: var(--ff-primary); }
/* Row actions stay on one line; the table scrolls sideways rather than stacking three buttons. */
table.dataTable tbody td:last-child { white-space: nowrap; }
table.dataTable tbody td:last-child form { display: inline-block; margin: 0; }
table.dataTable tbody td:last-child .btn { vertical-align: middle; }

/* Wide list tables scroll sideways inside the card; keep the row actions (the last column) pinned at the right edge so
   View / Edit / Delete are always reachable. Sticky needs an opaque fill, so hover and selected get their blended colour. */
.dataTables_scrollBody table.dataTable tbody td:last-child {
  position: sticky; right: 0; z-index: 1; background: var(--ff-elevated); border-left: 1px solid var(--ff-border);
}
.dataTables_scrollBody table.dataTable tbody tr:hover td:last-child { background: #13171c; }
.dataTables_scrollBody table.dataTable tbody tr.selected td:last-child { background: #0f2425; }

/* ==========================================================================
   Sidebar: breathing room inside the selected item
   CoreUI gives .c-sidebar-nav-icon `margin-left: -1rem`, which dragged the icon onto the green outline of the active item.
   ========================================================================== */
.c-sidebar:not(.c-sidebar-minimized) .c-sidebar-nav-link,
.c-sidebar:not(.c-sidebar-minimized) .c-sidebar-nav-dropdown-toggle { padding-left: 16px; padding-right: 12px; }
.c-sidebar:not(.c-sidebar-minimized) .c-sidebar-nav-link .c-sidebar-nav-icon,
.c-sidebar:not(.c-sidebar-minimized) .c-sidebar-nav-dropdown-toggle .c-sidebar-nav-icon { margin-left: 0; }

/* ==========================================================================
   LIGHT MODE
   The designer's ff-admin.css is dark only; this is the matching light palette (same roles, same radii, same type). It re-points the
   --ff-* variables, then fixes the few rules in ff-admin.css that hard-code white-on-dark. Green is darkened for TEXT and borders
   (#0A7F61 on white = 5:1); the gradient button keeps the brand greens with dark text.
   Toggle: partials/theme-toggle + public/js/ff-theme.js, saved in the `ff_theme` cookie. Dark stays the default.
   ========================================================================== */
html[data-theme="light"] {
  --ff-primary: #0A7F61;
  --ff-primary-bg: rgba(10, 127, 97, 0.10);
  --ff-secondary: #A21CAF;
  --ff-secondary-bg: rgba(162, 28, 175, 0.09);

  --ff-base: #F3F5F8;
  --ff-elevated: #FFFFFF;
  --ff-elevated-2: #F1F4F8;
  --ff-elevated-3: #E3E8EF;
  --ff-pill: rgba(2, 7, 15, 0.07);
  --ff-input: rgba(2, 7, 15, 0.055);
  --ff-error-bg: rgba(198, 40, 40, 0.09);
  --ff-warning-bg: rgba(176, 112, 0, 0.12);

  --ff-border: rgba(2, 7, 15, 0.10);
  --ff-border-control: rgba(2, 7, 15, 0.38);

  --ff-text: #0B1320;
  --ff-text-2: rgba(11, 19, 32, 0.82);
  --ff-text-3: rgba(11, 19, 32, 0.62);
  --ff-text-disabled: rgba(11, 19, 32, 0.32);
  --ff-success: #0A7F61;
  --ff-warning: #8F5F00;
  --ff-error: #C62828;

  --ff-focus: 0 0 0 3px rgba(10, 127, 97, 0.30);
  --ff-overlay: 0 16px 40px rgba(2, 7, 15, 0.18);
  color-scheme: light;
}
html[data-theme="dark"] { color-scheme: dark; }

/* the logo art is white: darken it on light surfaces */
html[data-theme="light"] .ff-logo, html[data-theme="light"] .ff-logo-mark, html[data-theme="light"] .ff-login-logo { filter: invert(1) brightness(0.15); }

/* rules in ff-admin.css that hard-code white tints or dark-only filters */
html[data-theme="light"] .c-header .c-header-toggler-icon { filter: opacity(0.7); }
html[data-theme="light"] .c-sidebar .c-sidebar-nav-link:hover,
html[data-theme="light"] .c-sidebar .c-sidebar-nav-dropdown-toggle:hover { background: rgba(2, 7, 15, 0.05); }
html[data-theme="light"] .c-sidebar .c-sidebar-nav-dropdown-toggle::after { filter: opacity(0.6); }
html[data-theme="light"] .btn-danger:hover, html[data-theme="light"] .btn-outline-danger:hover,
html[data-theme="light"] .btn-danger:not(:disabled):not(.disabled):active { background: rgba(198, 40, 40, 0.16); }
html[data-theme="light"] .btn-warning:hover { background: rgba(176, 112, 0, 0.2); color: var(--ff-warning); }
html[data-theme="light"] .form-control:disabled, html[data-theme="light"] .form-control[readonly] { background: rgba(2, 7, 15, 0.04); }
html[data-theme="light"] .table-hover tbody tr:hover, html[data-theme="light"] table.dataTable tbody tr:hover { background-color: rgba(2, 7, 15, 0.035); }
html[data-theme="light"] .ffd-range .btn-primary, html[data-theme="light"] .ffd-range .btn[aria-current="true"] { background: var(--ff-primary); color: #fff; }
html[data-theme="light"] .page-item.active .page-link { color: var(--ff-primary); }
html[data-theme="light"] .bootstrap-datetimepicker-widget table td.active, html[data-theme="light"] .bootstrap-datetimepicker-widget table td span.active { color: #fff; }
html[data-theme="light"] .select2-container--default .select2-results__option[aria-selected="true"] { color: var(--ff-primary); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(2, 7, 15, 0.20); border-color: var(--ff-base); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(2, 7, 15, 0.32); }
html[data-theme="light"] .dataTable thead .sorting::before, html[data-theme="light"] .dataTable thead .sorting::after { color: var(--ff-text); }
html[data-theme="light"] .dataTables_scrollBody table.dataTable tbody tr:hover td:last-child { background: #F6F8FB; }
html[data-theme="light"] .dataTables_scrollBody table.dataTable tbody tr.selected td:last-child { background: #E5F2EE; }
html[data-theme="light"] .ffd-ring-total strong { color: var(--ff-text); }
html[data-theme="light"] .ffd-tag { color: var(--ff-error); }
html[data-theme="light"] .ffd-pill.hot { color: var(--ff-error); }
html[data-theme="light"] .alert-success, html[data-theme="light"] .badge-success { color: var(--ff-success); }
html[data-theme="light"] .modal-backdrop.show { background: #0B1320; opacity: 0.45; }

/* Light mode: CoreUI hard-codes white text on nested sidebar links (it assumes a dark sidebar) */
html[data-theme="light"] .c-sidebar .c-sidebar-nav-dropdown-items .c-sidebar-nav-link { color: var(--ff-text-2); }
html[data-theme="light"] .c-sidebar .c-sidebar-nav-dropdown-items .c-sidebar-nav-link:hover { color: var(--ff-text); background: rgba(2, 7, 15, 0.05); }
html[data-theme="light"] .c-sidebar .c-sidebar-nav-dropdown-items .c-sidebar-nav-link.c-active { color: var(--ff-primary); background: var(--ff-primary-bg); }
html[data-theme="light"] .c-sidebar .c-sidebar-nav-dropdown-items .c-sidebar-nav-link .c-sidebar-nav-icon { color: var(--ff-text-3); }
html[data-theme="light"] .c-sidebar .c-sidebar-nav-dropdown-items .c-sidebar-nav-link.c-active .c-sidebar-nav-icon { color: var(--ff-primary); }
html[data-theme="light"] .c-sidebar .c-sidebar-nav-dropdown.c-show { background: transparent; }
html[data-theme="light"] .c-sidebar .c-sidebar-nav-title { color: var(--ff-text-3); }
html[data-theme="light"] .c-sidebar .c-sidebar-nav-dropdown-toggle { color: var(--ff-text-2); }
