﻿/* =====================================
   PFS ADMIN PORTAL CSS
   /admin/css/admin.css
===================================== */

html,
body {
  height: 100%;
  min-height: 100%;
}

body {
  background: #f5f7fb;
}

/* ========================
   Nav
======================== */

.admin-nav {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .75rem;
  border-radius: .8rem;
  color: #212529;
  text-decoration: none;
  font-weight: 500;
}

.admin-nav i {
  width: 18px;
  text-align: center;
  opacity: .85;
}

.admin-nav:hover {
  background: rgba(13,110,253,.06);
}

.admin-nav.active {
  background: rgba(13,110,253,.10);
  border: 1px solid rgba(13,110,253,.20);
}

.admin-nav.security {
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.25);
}

.admin-nav.security:hover {
  background: rgba(255, 193, 7, 0.15);
}

.admin-nav.security i {
  color: #b68900;
}

/* ========================
   Content Panel
======================== */

.admin-content {
  background: rgba(13,110,253,.03);
  border: 1px solid rgba(13,110,253,.12);
  border-radius: 1rem;
}

/* ========================
   Cards
======================== */

.admin-card {
  padding: 1.25rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

/* ========================
   Role Badge
======================== */

.admin-role-badge {
  display: inline-block;
  padding: .35rem .6rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 50px;
  line-height: 1;
}

.role-director {
  background: rgba(13,110,253,.12);
  border-color: rgba(13,110,253,.25);
  color: #0b2e6b;
}

.role-admin {
  background: rgba(25,135,84,.12);
  border-color: rgba(25,135,84,.25);
  color: #0f5132;
}

.role-superadmin {
  background: linear-gradient(135deg, #ff9f1c, #ff7a00);
  border: 1px solid rgba(0,0,0,.08);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.admin-role-wrap {
  margin-top: 6px;
}

/* ========================
   Header tweaks
======================== */

.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

/* ========================
   Shared UI
======================== */

.event-highlight {
  background: rgba(25,135,84,0.12) !important;
  border-left: 4px solid #198754;
}

.event-hover {
  cursor: pointer;
  text-decoration: none;
}

.event-hover:hover {
  color: var(--bs-primary);
}

.tooltip-inner {
  max-width: 320px;
  text-align: left;
  font-size: 0.85rem;
  padding: .5rem .6rem;
}

.offcanvas .admin-sidebar {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.team-list {
  max-height: 280px;
  overflow: auto;
  background: #fff;
}

.team-item:hover {
  background: rgba(13,110,253,.06);
}

.team-item.hidden {
  display: none !important;
}

#pageAlert {
  transition: opacity .25s ease;
}

#pageAlert.d-none {
  opacity: 0;
}

.badge-compact {
  font-size: .72rem;
  padding: .25rem .45rem;
  border-radius: 6px;
  line-height: 1;
}

.badge {
  font-weight: 600;
  letter-spacing: 0.3px;
}

mark {
  padding: 0 2px;
  border-radius: 2px;
}

.loading-box {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-xs {
  --bs-btn-padding-y: .2rem;
  --bs-btn-padding-x: .5rem;
  --bs-btn-font-size: .75rem;
  --bs-btn-border-radius: .35rem;
  line-height: 1.2;
}

/* ========================
   Pool / Games UI
======================== */

.event-header-card {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.pool-select-btn {
  border-radius: 14px;
  transition: .15s ease;
}

.pool-select-btn:hover {
  transform: translateY(-1px);
}

@media (max-width: 991px) {

  select.form-select,
  .form-select {
    min-width: 160px;
    min-height: 42px;
    font-size: 1rem;
    padding-left: .75rem;
    padding-right: 2rem;
  }

  .pool-game-row,
  .pool-game-line,
  .pool-games-table {
    min-width: 1100px !important;
  }

  .pool-team-select-wrap {
    flex: 0 0 260px !important;
    width: 260px !important;
    min-width: 260px !important;
  }

  .pool-team-select-wrap select.form-select {
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    color: #212529 !important;
    text-indent: 0 !important;
  }

  .pool-score-wrap {
    flex: 0 0 65px !important;
  }

  .pool-win-badge-wrap {
    flex: 0 0 35px !important;
  }

}

.pool-games-table th,
.pool-games-table td,
.pool-game-row td {
  vertical-align: middle;
}

.pool-game-row:hover {
  background: #f8fafc;
}

.pool-label-badge {
  min-width: 52px;
  text-align: center;
}

  .pool-select-btn {
    border-radius: 12px;
    transition: .15s ease;
  }

  .pool-select-btn:hover {
    transform: translateY(-1px);
  }

  .badge-compact {
    font-size: .72rem;
    padding: .25rem .45rem;
  }

  .score-input {
    width: 72px;
    min-width: 72px;
    text-align: center;
  }

  .pool-game-row td {
    vertical-align: middle;
  }

  .table tbody tr:hover {
    background-color: rgba(0,0,0,.02);
  }

  .pool-matchup-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
  }

  .pool-team-name {
    flex: 1 1 0;
    min-width: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pool-team-name-home {
    text-align: right;
  }

  .pool-team-name-away {
    text-align: left;
  }

  .pool-win-badge-wrap {
    width: 28px;
    min-width: 28px;
    display: flex;
    justify-content: center;
  }

  .pool-score-wrap {
    width: 72px;
    min-width: 72px;
    display: flex;
    justify-content: center;
  }

  .pool-final-badge-wrap {
    margin-left: .5rem;
    min-width: 56px;
    display: flex;
    justify-content: center;
  }

.pool-team-select-wrap {
  flex: 1 1 0;
  min-width: 0;
}

.pool-team-select-wrap .form-select {
  min-width: 0;
}

  @media (max-width: 767.98px) {
    .pool-team-name {
      font-size: .92rem;
    }

    .pool-score-wrap,
    .score-input {
      width: 64px;
      min-width: 64px;
    }
  }

.score-input {
  width: 78px;
  text-align: center;
}

.field-input {
  min-width: 90px;
}

.save-status {
  min-height: 22px;
}

.js-share-fields-help:focus {
  box-shadow: none !important;
}

/* ========================
   Flyer Upload
======================== */

.flyer-dropzone {
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flyer-dropzone:hover {
  border-color: var(--bs-primary);
  background-color: #f8fbff;
}

.flyer-dropzone.dragover {
  border-color: var(--bs-primary);
  background-color: #eef6ff;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, .15);
}

.flyer-dropzone.has-file {
  border-color: var(--bs-success);
  background-color: #f3fbf5;
}

/* ========================
   Permissions / Admin UI
======================== */

.perm-admin-summary {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.08);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  transition: all .2s ease;
}

.perm-admin-summary.is-disabled {
  border-color: rgba(220, 53, 69, .35);
  background: linear-gradient(135deg, #fff5f5 0%, #fff0f1 100%);
  box-shadow: 0 .85rem 1.65rem rgba(220, 53, 69, .14);
}

.perm-admin-summary.is-disabled .perm-summary-title,
.perm-admin-summary.is-disabled .perm-summary-meta,
.perm-admin-summary.is-disabled .perm-summary-label {
  color: #842029 !important;
}

.perm-disabled-badge {
  display: none;
  align-items: center;
  gap: .45rem;
  padding: .42rem .78rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  background: rgba(220, 53, 69, .12);
  color: #b02a37;
  border: 1px solid rgba(220, 53, 69, .22);
  white-space: nowrap;
}

.perm-disabled-badge.show-badge {
  display: inline-flex;
}

.perm-summary-status {
  min-width: 140px;
}

.permission-toolbar,
.permission-category-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.permission-toolbar-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1rem .5rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
  margin-bottom: 1rem;
}

.permission-toolbar-title {
  min-width: 0;
}

.permission-toolbar-title .small {
  line-height: 1.2;
}

.permission-category-actions .btn,
.permission-toolbar .btn {
  white-space: nowrap;
}

.permission-enhanced-card .card-header,
.permission-enhanced-card .admin-card-header,
.permission-enhanced-card .border-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.perm-category-title {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: #212529;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(13, 110, 253, 0.08);
}

.state-grid-wrap {
  max-height: 560px;
  overflow: auto;
}

#stateAccessAccordion .accordion-button {
  font-weight: 600;
}

#stateAccessAccordion .accordion-button:not(.collapsed) {
  background: #fff;
  color: inherit;
  box-shadow: none;
}

#stateAccessAccordion .accordion-button:focus {
  box-shadow: none;
}

.account-top-card {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.08);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  transition: all .2s ease;
}

.account-top-card.is-disabled {
  border-color: rgba(220, 53, 69, .35);
  background: linear-gradient(135deg, #fff5f5 0%, #fff0f1 100%);
  box-shadow: 0 .75rem 1.5rem rgba(220, 53, 69, .12);
}

.account-top-card.is-disabled .account-top-card-title,
.account-top-card.is-disabled .account-top-card-meta {
  color: #842029;
}

.account-top-card.is-disabled .account-disabled-banner {
  display: inline-flex !important;
  align-items: center;
  gap: .45rem;
}

.account-disabled-banner {
  display: none;
  padding: .45rem .75rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  background: rgba(220, 53, 69, .12);
  color: #b02a37;
  border: 1px solid rgba(220, 53, 69, .2);
}

/* =========================
   Settings Page
========================= */

.settings-page .settings-inner-card {
  border-radius: 0.85rem;
  overflow: hidden;
  background: #fff;
}

.settings-page .settings-subcard {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  box-shadow: none;
  background: #fff;
  height: 100%;
  overflow: hidden;
}

.settings-page .settings-subcard .settings-subcard-header {
  background: #fff;
  border-bottom: 1px solid var(--bs-border-color-translucent);
  padding: 0.9rem 1rem;
}

.settings-page .settings-subcard .settings-subcard-body {
  padding: 1rem;
}

.settings-page .settings-subcard.settings-subcard-general {
  border-top: 2px solid #dbeafe;
}

.settings-page .settings-subcard.settings-subcard-player {
  border-top: 2px solid #e9ddff;
}

.settings-page .settings-subcard.settings-subcard-sanctions {
  border-top: 2px solid #fde7d6;
}

.settings-page .settings-subcard.settings-subcard-entry {
  border-top: 2px solid #dff7ef;
}

.settings-page .settings-subcard.settings-subcard-rules {
  border-top: 2px solid #dff3e7;
}

.settings-page .settings-subcard.settings-subcard-advanced {
  border-top: 2px solid #e9ecef;
}

.settings-page .settings-subcard-header .settings-subcard-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.settings-page .settings-subcard-header .settings-subcard-title i {
  width: 1rem;
  text-align: center;
  opacity: 0.85;
}

.settings-page .accordion-item {
  border-radius: 0.75rem;
  overflow: hidden;
}

.settings-page .accordion-button {
  box-shadow: none !important;
}

.settings-page .accordion-button:not(.collapsed) {
  background-color: #fff;
  color: inherit;
}

/* =========================
   Full Width Admin Dashboard Shell
========================= */

.portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
}

.portal-topbar .container-fluid {
  min-height: 64px;
}

.portal-topbar-title {
  font-size: 0.98rem;
  letter-spacing: 0.2px;
}

.portal-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.portal-main-admin,
.portal-main-manager {
  background: #f5f7fb;
}

.admin-dashboard-shell {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.admin-sidebar-wrap {
  width: 280px;
  min-width: 280px;
  flex: 0 0 280px;
  border-right: 1px solid #e5e7eb;
  background: #ffffff;
  height: 100%;
  overflow: hidden;
}

.admin-sidebar {
  height: auto;
  overflow: visible;
  padding: 1rem 0.75rem;
  background: #ffffff;
}

.admin-sidebar-mobile {
  position: static;
  height: auto;
  overflow: visible;
  padding: 1rem 0.75rem;
}

.admin-content-wrap {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
}

.admin-page-container {
  width: 100%;
  max-width: 100%;
  flex: 1;
  padding-bottom: 20px;
}

.admin-page-container .container,
.admin-page-container .container-sm,
.admin-page-container .container-md,
.admin-page-container .container-lg,
.admin-page-container .container-xl,
.admin-page-container .container-xxl {
  max-width: 100% !important;
  width: 100% !important;
}

.admin-page-container .card,
.admin-page-container .table-responsive,
.admin-page-container .accordion,
.admin-page-container .row {
  min-width: 0;
}

.admin-page-container .table-responsive {
  overflow-x: auto;
}

.admin-page-container .row > [class*="col-"] {
  min-width: 0;
}

.manager-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: #ffffff;
  flex: 0 0 auto;
}

.manager-footer .text-muted,
.manager-footer .small {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Make wide admin screens breathe a bit more */
@media (min-width: 1400px) {
  .admin-page-container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

/* Collapse to full-width content on smaller screens */
@media (max-width: 1199.98px) {
  .portal-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .portal-main {
    overflow: visible;
    min-height: auto;
  }

  .admin-dashboard-shell {
    display: block;
    height: auto;
    min-height: auto;
  }

  .admin-sidebar-wrap {
    display: none;
  }

  .admin-content-wrap {
    width: 100%;
    height: auto;
    min-height: auto;
    overflow: visible;
    padding-left: 0;
  }
}

/* Optional nicer page spacing for admin cards/tables */
.admin-page-container > .row,
.admin-page-container > .card,
.admin-page-container > .accordion,
.admin-page-container > .table-responsive {
  margin-bottom: 1rem;
}

.sticky-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding-top: 1rem;
  margin-top: 1.25rem;
}

.sticky-save-bar-inner {
  padding: .9rem 1rem;
  border-top: 1px solid rgba(0,0,0,.08);
  background: rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 0 0 1rem 1rem;
}

@media (max-width: 767.98px) {
  .sticky-save-bar-inner {
    padding: .85rem;
  }

  .sticky-save-bar-inner .btn {
    width: 100%;
  }
}

.admin-page-header-title,
.admin-page-header-subtitle {
  min-width: 0;
}

.admin-page-header-actions .btn {
  white-space: nowrap;
}

.min-w-0 {
  min-width: 0;
}

/* =========================
   Sticky Action Bar
========================= */

.sticky-actions-bar {
  position: sticky;
  bottom: 0;
  z-index: 25;
  margin-top: 1.5rem;
}

.sticky-actions-inner {
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 0 0 1rem 1rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.sticky-actions-primary .btn {
  min-width: 140px;
}

@media (max-width: 767.98px) {
  .sticky-actions-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .sticky-actions-primary,
  .sticky-actions-secondary {
    width: 100%;
  }

  .sticky-actions-primary .btn,
  .sticky-actions-secondary .btn {
    width: 100%;
  }
}

/* Prevent flex overflow issues */
.min-w-0 {
  min-width: 0;
}

/* Team dropdown truncation */
.matchup-row .team-pick {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Force text truncation inside select */
.matchup-row .team-pick option {
  text-overflow: ellipsis;
}

/* Center score block perfectly */
.score-center {
  min-width: 140px;
}

/* Score inputs fixed width + centered */
.matchup-row .score-input {
  width: 60px;
  text-align: center;
  font-weight: 600;
  padding: 2px 6px;
}

/* Clean W badge */
.matchup-row .badge {
  font-size: 0.65rem;
  padding: 2px 6px;
}

.public-footer {
  background: #111;
  color: #fff;
}

.shadow-sm {
  box-shadow: 0 8px 24px rgba(0,0,0,.08) !important;
}

/* Left border highlight */
.pc-row-male td:first-child {
  border-left: 4px solid rgba(13,110,253,.6);
}

.pc-row-female td:first-child {
  border-left: 4px solid rgba(220,53,69,.6);
}

.pc-row-unknown td:first-child {
  border-left: 4px solid #6c757d; /* gray */
}

/* Optional: add slight padding so text doesn't hug border */
.pc-row-male td:first-child,
.pc-row-female td:first-child,
.pc-row-unknown td:first-child {
  padding-left: 0.75rem;
}

.page-title-icon-lg {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #e9edf3; /* light gray/blue */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #0d6efd; /* bootstrap primary */
    flex-shrink: 0;
}

  .admin-page-header-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, .1);
    color: var(--bs-primary);
    font-size: 1.25rem;
  }

  .admin-autocomplete-menu {
  background: #fff;
  border: 1px solid rgba(0,0,0,.125);
  border-radius: .5rem;
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.12);
  overflow: hidden;
  z-index: 1050;
}

.admin-autocomplete-item {
  background: #fff;
  color: #212529;
}

.admin-autocomplete-item:hover,
.admin-autocomplete-item.active,
.admin-autocomplete-item:focus {
  background: #f1f5f9;
  color: #212529;
}

