/* styles.css */

/* Base navigation styling */
.navbar-custom {
  background-color: #005e23 !important;
}

.navbar-custom .nav-link {
  color: #ffffff !important;
}

.navbar-custom .nav-link:hover {
  color: #ffffff;
  opacity: 0.85;
}

.navbar-custom .dropdown-menu {
  background-color: #005e23;
}

.navbar-custom .dropdown-item {
  color: #ffffff !important;
}

.navbar-custom .dropdown-item:hover {
  background-color: #005e23;
  color: #ffffff;
}

/* Logged-in experience styling */
.auth-app {
  background-color: #f4f6f8;
  color: #1b2a2f;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.auth-app .navbar-custom {
  background: linear-gradient(135deg, #0b6b2d 0%, #044d20 100%) !important;
  box-shadow: 0 12px 26px rgba(7, 48, 19, 0.2);
}

.auth-app .navbar-custom .nav-link {
  font-weight: 500;
  letter-spacing: 0.2px;
}

.auth-app .navbar-custom .nav-link:hover,
.auth-app .navbar-custom .nav-link:focus {
  color: #d3f0db !important;
}

.auth-app .navbar-custom .dropdown-menu {
  background-color: #ffffff;
  border: 1px solid rgba(8, 25, 16, 0.12);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(10, 36, 20, 0.18);
  padding: 0.5rem;
}

.auth-app .navbar-custom .dropdown-item {
  color: #1b2a2f !important;
  border-radius: 8px;
}

.auth-app .navbar-custom .dropdown-item:hover,
.auth-app .navbar-custom .dropdown-item:focus {
  background-color: #e8f4ed;
  color: #0b3f1b !important;
}

.auth-app .app-shell {
  padding: 1.5rem 0 3rem;
}

.auth-app .app-content {
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 22px 48px rgba(13, 38, 20, 0.12);
  padding: 2rem;
}

.auth-app .app-content .container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.auth-app h1,
.auth-app h2,
.auth-app h3,
.auth-app h4 {
  color: #0c2f18;
  font-weight: 600;
}

.auth-app .form-control,
.auth-app .form-select,
.auth-app .select2-container--default .select2-selection--single {
  border-radius: 10px;
  border-color: rgba(18, 62, 32, 0.2);
  box-shadow: none;
}

.auth-app .form-control:focus,
.auth-app .form-select:focus,
.auth-app .select2-container--default .select2-selection--single:focus {
  border-color: #0b6b2d;
  box-shadow: 0 0 0 0.2rem rgba(11, 107, 45, 0.15);
}

.auth-app .btn-primary,
.auth-app .btn-success {
  background-color: #0b6b2d !important;
  border-color: #0b6b2d !important;
  box-shadow: 0 10px 20px rgba(11, 107, 45, 0.18);
}

.auth-app .btn-primary:hover,
.auth-app .btn-success:hover,
.auth-app .btn-primary:focus,
.auth-app .btn-success:focus {
  background-color: #0a5f29 !important;
  border-color: #0a5f29 !important;
}

.auth-app .btn-secondary {
  background-color: #eef1f3;
  border-color: #d3d9de;
  color: #1b2a2f;
}

.auth-app .btn-secondary:hover,
.auth-app .btn-secondary:focus {
  background-color: #dde3e8;
  border-color: #ccd3d9;
  color: #1b2a2f;
}

.auth-app .table-responsive {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(18, 62, 32, 0.08);
  box-shadow: 0 12px 30px rgba(15, 40, 21, 0.08);
  padding: 0.5rem 1rem;
}

.auth-app .table {
  margin-bottom: 0;
}

.auth-app .table thead th {
  background-color: #0b6b2d !important;
  color: #ffffff !important;
  border-bottom: none;
}

.auth-app .table tbody tr {
  border-color: rgba(17, 62, 33, 0.08);
}

.auth-app .table tbody tr:hover {
  background-color: #f2f7f4;
}

.auth-app .list-group-item,
.auth-app .card {
  border-radius: 14px;
  border-color: rgba(17, 62, 33, 0.1);
  box-shadow: 0 10px 24px rgba(15, 40, 21, 0.08);
}

.auth-app .alert {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 20px rgba(15, 40, 21, 0.08);
}

.auth-app #player-search-input {
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.4);
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.auth-app #player-search-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.auth-app #player-search-suggestions {
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(7, 26, 15, 0.2);
  border: 1px solid rgba(15, 40, 21, 0.12);
}

@media (max-width: 768px) {
  .auth-app .app-content {
    padding: 1.25rem;
    border-radius: 16px;
  }

  .auth-app .app-shell {
    padding: 1rem 0 2rem;
  }
}

/* at mobile sizes (below lg), when the collapsed menu is open, force it to flex */
@media (max-width: 991.98px) {
  .navbar-collapse.collapse.show {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start !important;
  }
}

#player-search-suggestions {
  z-index: 2000;   /* above dropdowns/offcanvas/etc. */
}

/* Default button styling for non-auth pages */
.btn-primary,
.btn-success {
  background-color: #005e23 !important;
  border-color: #005e23 !important;
}

.table thead th {
  background-color: #005e23 !important;
  color: #ffffff !important;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
}

.sortable-header::after {
  content: "↕";
  display: inline-block;
  margin-left: 6px;
  font-size: 0.75em;
  opacity: 0.7;
}

.sortable-header.sort-asc::after {
  content: "▲";
  opacity: 1;
}

.sortable-header.sort-desc::after {
  content: "▼";
  opacity: 1;
}

/* Make the table container scrollable horizontally */
.table-responsive {
  overflow-x: auto;
  font-weight: normal !important;
}

/* Un-bold headers in responsive tables */
.table-responsive .table thead th,
.table-responsive .table tbody th {
  font-weight: normal !important;
}

/* Leaderboard preview divider */
.leaderboard-preview {
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.leaderboard-preview .players-scroll a {
  color: #000 !important;
  text-decoration: none;   /* already in markup but safe here */
}

/* Container & scroll strip */
.lbp-wrap {
  --lbp-gap: .5rem;
  --lbp-gutter: 48px;
  position: relative;    /* make arrows position against this */
}

.players-scroll {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  gap: var(--lbp-gap);
  padding: .25rem 2.25rem;          /* room for arrows */
  margin-left:  var(--lbp-gutter);
  margin-right: var(--lbp-gutter);        /* breathing room right of last item */
  scroll-behavior: smooth;
  cursor: grab;
  scroll-snap-type: x mandatory;    /* snap to items */
}
/* left/right spacers that behave like items */
.players-scroll:active { cursor: grabbing; }

/* Hide scrollbars (cross-browser) */
.players-scroll { scrollbar-width: none; }
.players-scroll::-webkit-scrollbar { display: none; }

.tournament-card {
  margin-bottom: 12px;
}

/* Items */
.lbp-item {
  display: inline-block;
  margin-right: var(--lbp-gap);
  scroll-snap-align: start;
}

/* Arrows */
.lbp-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: none;                 /* transparent */
  line-height: 32px;
  text-align: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
  color: #333;
}
.lbp-arrow i { font-size: 1.25rem; pointer-events: none; } /* for Bootstrap Icons */
.lbp-left  { left: 0px; }
.lbp-right { right: 0px; }

/* Edge fades (hint more content) */
.lbp-fade {
  position: absolute;
  width: 36px;
  pointer-events: none;
  z-index: 3;
}
.lbp-fade-left  { left: 0;  background: linear-gradient(90deg, #fff, rgba(255,255,255,0)); }
.lbp-fade-right { right: 0; background: linear-gradient(270deg, #fff, rgba(255,255,255,0)); }

/* Hide arrows/fades when not needed */
.lbp-wrap.no-overflow .lbp-arrow,
.lbp-wrap.no-overflow .lbp-fade { display: none; }
