/* SPORTLAB Tournament Bracket Page Stylesheet */

/* --- Common Base Page Styles --- */
html, body, .bracket-page-body {
  font-family: "Helvetica Neue LT Roman", "Inter", "BPG Arial Caps", sans-serif;
  margin: 0 !important;
  padding: 0 !important;
}

.header-section {
  padding: 0;
}

.header-section h1 {
  font-family: "Helvetica Neue LT Roman", "Inter", "BPG Arial Caps", sans-serif;
  letter-spacing: -0.5px;
}

/* Pulsing bullet indicator for live status */
.pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f1416c;
  box-shadow: 0 0 0 0 rgba(241, 65, 108, 0.7);
  animation: pulse 1.6s infinite;
  display: inline-block;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(241, 65, 108, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(241, 65, 108, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(241, 65, 108, 0);
  }
}

/* Metadata sub-header bar styling */
.bracket-meta-bar {
  border-radius: 12px;
  padding: 20px 25px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.meta-divider {
  width: 1px;
  height: 35px;
  margin: 0 30px;
}

@media (max-width: 991px) {
  .header-section .py-5 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  .content-section.py-8 {
    padding-top: 1rem !important;
    padding-bottom: 1.5rem !important;
  }
  .bracket-meta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 20px;
  }
  .meta-divider {
    display: none;
  }
}

/* Dynamic Round Column Header */
.round-title-custom {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 10px;
  font-family: "Helvetica Neue LT Roman", "Inter", sans-serif;
}

/* Repechage custom styling */
.repechage-section h2 {
  font-family: "Helvetica Neue LT Roman", "Inter", "BPG Arial Caps", sans-serif;
  letter-spacing: 0.5px;
}

.title-accent-bar {
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f1416c 0%, #009ef7 100%);
  display: inline-block;
  flex-shrink: 0;
}

/* Weight Control section custom styling */
.wc-section {
  clear: both !important;
  display: block;
}

/* Weight Control table card redesign */
.wc-container .table thead th {
  font-weight: 700;
  font-family: "Helvetica Neue LT Roman", "Inter", sans-serif;
  letter-spacing: 0.5px;
}

/* Custom rounded small bullet dot */
.bullet-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* Metronic light-tinted badges */
.badge-light-danger {
  background-color: rgba(241, 65, 108, 0.08) !important;
  color: #f1416c !important;
  border-radius: 6px;
}

/* --- Horizontal Page Scroll and Layout Control --- */
html, body, .bracket-page-body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}

.content-section {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* Scrollable container specifically for tournament bracket trees */
.bracket-container-scroll {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  padding-bottom: 25px !important;
  -webkit-overflow-scrolling: touch;
  clear: both !important;
  display: block !important;
}

.bracket-container-scroll::after {
  content: "" !important;
  display: table !important;
  clear: both !important;
}

/* Inner JQBracket containers expand to content width inside scrollable wrapper */
div.jQBracket,
.full_tournament,
.full_tournament2,
.full_tournament3 {
  clear: both !important;
  display: inline-block !important;
  min-width: max-content !important;
  width: max-content !important;
  padding-bottom: 15px !important;
}

div.jQBracket::after,
.full_tournament::after,
.full_tournament2::after,
.full_tournament3::after {
  content: "" !important;
  display: table !important;
  clear: both !important;
}

/* --- CSS Theme Show/Hide Utility --- */
[data-bs-theme="light"] .theme-dark-show {
  display: none !important;
}
[data-bs-theme="dark"] .theme-light-show {
  display: none !important;
}

/* Print-only show/hide utility */
.print-only {
  display: none !important;
}

/* ==================================================== */
/* ===                LIGHT THEME BRANCH            === */
/* ==================================================== */
[data-bs-theme="light"] body,
[data-bs-theme="light"] .bracket-page-body {
  background-color: #f8f9fa !important;
  color: #181c32 !important;
}

[data-bs-theme="light"] .header-section {
  background-color: #ffffff;
  border-bottom: 1px solid #e4e6ef;
}

[data-bs-theme="light"] .text-theme-head {
  color: #181c32 !important;
}

[data-bs-theme="light"] #themeToggleButton {
  color: #3f4254 !important;
  border-color: #cbd5e1 !important;
  background-color: #ffffff !important;
}

[data-bs-theme="light"] #themeToggleButton:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

[data-bs-theme="light"] #themeToggleButton svg {
  color: #0f172a !important;
}

[data-bs-theme="light"] .content-section {
  background-color: #f8f9fa !important;
}

[data-bs-theme="light"] .bracket-meta-bar {
  background-color: #ffffff;
  border: 1px solid #e4e6ef;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="light"] .meta-label {
  color: #7e8299;
}

[data-bs-theme="light"] .meta-value {
  color: #181c32;
}

[data-bs-theme="light"] .meta-divider {
  background-color: #e4e6ef;
}

[data-bs-theme="light"] .round-title-custom {
  color: #7e8299;
  border-bottom: 2px solid #e4e6ef;
}

[data-bs-theme="light"] .repechage-section {
  border-top: 1px dashed #e4e6ef !important;
}


[data-bs-theme="light"] .wc-section {
  border-top: 1px dashed #e4e6ef !important;
  margin-top: 50px !important;
  padding-top: 40px !important;
}

/* Light Card */
[data-bs-theme="light"] .wc-container.card {
  background-color: #ffffff !important;
  border: 1px solid #e4e6ef !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="light"] .wc-container .card-title {
  color: #181c32 !important;
}

[data-bs-theme="light"] .wc-container .table thead th {
  border-bottom: 2px solid #e4e6ef !important;
  color: #7e8299;
}

[data-bs-theme="light"] .wc-container .table tbody tr {
  border-bottom: 1px solid #eff2f5 !important;
}

[data-bs-theme="light"] .wc-container .table tbody td.name-cell {
  color: #181c32 !important;
}

/* ==================================================== */
/* ===                DARK THEME BRANCH             === */
/* ==================================================== */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .bracket-page-body {
  background-color: #0f1014 !important;
  color: #ffffff !important;
}

[data-bs-theme="dark"] .header-section {
  background-color: #15171c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .text-theme-head {
  color: #ffffff !important;
}

[data-bs-theme="dark"] #themeToggleButton {
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  background-color: transparent !important;
}

[data-bs-theme="dark"] #themeToggleButton:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

[data-bs-theme="dark"] .content-section {
  background-color: #0f1014 !important;
}

[data-bs-theme="dark"] .bracket-meta-bar {
  background-color: #15171c;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .meta-label {
  color: #7e8299;
}

[data-bs-theme="dark"] .meta-value {
  color: #ffffff;
}

[data-bs-theme="dark"] .meta-divider {
  background-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .round-title-custom {
  color: #5e6278;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .repechage-section {
  border-top: 1px dashed rgba(255, 255, 255, 0.08) !important;
}


[data-bs-theme="dark"] .wc-section {
  border-top: 1px dashed rgba(255, 255, 255, 0.08) !important;
  margin-top: 50px !important;
  padding-top: 40px !important;
}

/* Dark Card */
[data-bs-theme="dark"] .wc-container.card {
  background-color: #15171c !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .wc-container .card-title {
  color: #ffffff !important;
}

[data-bs-theme="dark"] .wc-container .table thead th {
  border-bottom: 2px solid rgba(255, 255, 255, 0.06) !important;
  color: #7e8299;
}

[data-bs-theme="dark"] .wc-container .table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

[data-bs-theme="dark"] .wc-container .table tbody td.name-cell {
  color: #ffffff !important;
}

/* ==================================================== */
/* ===                 PRINT MEDIA OVERRIDES         === */
/* ==================================================== */
@media print {
  /* Remove browser margins to eliminate large white paddings */
  @page {
    size: A4 landscape;
    margin: 0;
  }

  /* Force background colors to print (e.g. badges, paths, card states) */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Force clean ink-saving white background & dark text on the entire page */
  [data-bs-theme="dark"] html,
  [data-bs-theme="light"] html,
  [data-bs-theme="dark"] body,
  [data-bs-theme="light"] body,
  [data-bs-theme="dark"] .bracket-page-body,
  [data-bs-theme="light"] .bracket-page-body,
  [data-bs-theme="dark"] .content-section,
  [data-bs-theme="light"] .content-section,
  html, 
  body, 
  .bracket-page-body, 
  .content-section {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #181c32 !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    position: static !important;
    display: block !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Scale the entire page content & add safe padding controlled via CSS */
  body {
    zoom: 0.72 !important;
    padding: 2mm 8mm !important;
  }

  .container-fluid,
  [data-bs-theme="dark"] .container-fluid,
  [data-bs-theme="light"] .container-fluid {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Hide the header section in print mode */
  [data-bs-theme="dark"] .header-section,
  [data-bs-theme="light"] .header-section,
  .header-section {
    display: none !important;
  }

  /* Show and position print-only header elements inside metadata bar */
  .print-only {
    display: block !important;
  }

  .print-only.meta-divider {
    display: block !important;
  }

  .print-only-meta-header {
    display: flex !important;
    margin-left: auto !important;
  }

  [data-bs-theme="dark"] .text-theme-head,
  [data-bs-theme="light"] .text-theme-head,
  .text-theme-head {
    color: #181c32 !important;
  }

  /* Shrink the metadata bar vertically to save paper space */
  [data-bs-theme="dark"] .bracket-meta-bar,
  [data-bs-theme="light"] .bracket-meta-bar,
  .bracket-meta-bar {
    background-color: #ffffff !important;
    border: 1px solid #e4e6ef !important;
    padding: 6px 12px !important;
    margin-bottom: 12px !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 15px !important;
    align-items: center !important;
  }
  
  .meta-item {
    gap: 2px !important;
  }

  [data-bs-theme="dark"] .meta-value,
  [data-bs-theme="light"] .meta-value,
  .meta-value {
    color: #181c32 !important;
    font-size: 11px !important;
  }

  [data-bs-theme="dark"] .meta-label,
  [data-bs-theme="light"] .meta-label,
  .meta-label {
    color: #7e8299 !important;
    font-size: 8px !important;
  }
  
  [data-bs-theme="dark"] .meta-divider,
  [data-bs-theme="light"] .meta-divider,
  .meta-divider {
    background-color: #e4e6ef !important;
    height: 20px !important;
    margin: 0 10px !important;
  }

  /* Remove excessive padding/margins on bracket containers to enable Page 1 flow */
  #big, 
  #big2, 
  #big3,
  .bracket-container-scroll {
    clear: both !important;
    height: auto !important;
    overflow: visible !important;
    position: static !important;
    display: block !important;
    float: none !important;
    margin-top: 20px !important;
    margin-bottom: 8px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .repechage-section {
    clear: both !important;
    height: auto !important;
    overflow: visible !important;
    position: relative !important;
    display: block !important;
    float: none !important;
    margin-top: 60px !important;
    margin-bottom: 8px !important;
    padding-top: 15px !important;
    padding-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-top: 1px dashed #e4e6ef !important;
  }


  /* Hide weight control section from print completely */
  .wc-section,
  .wc-container {
    display: none !important;
  }
  
  [data-bs-theme="dark"] .wc-container.card,
  [data-bs-theme="light"] .wc-container.card,
  .wc-container.card {
    background-color: #ffffff !important;
    border: 1px solid #e4e6ef !important;
    box-shadow: none !important;
  }
  
  [data-bs-theme="dark"] .wc-container .card-title,
  [data-bs-theme="light"] .wc-container .card-title,
  .wc-container .card-title {
    color: #181c32 !important;
  }

  [data-bs-theme="dark"] .wc-container .table thead th,
  [data-bs-theme="light"] .wc-container .table thead th,
  .wc-container .table thead th {
    border-bottom: 2px solid #e4e6ef !important;
    color: #7e8299 !important;
  }
  
  [data-bs-theme="dark"] .wc-container .table tbody td,
  [data-bs-theme="light"] .wc-container .table tbody td,
  .wc-container .table tbody td {
    border-bottom: 1px solid #e4e6ef !important;
  }

  [data-bs-theme="dark"] .wc-container .table tbody td.name-cell,
  [data-bs-theme="light"] .wc-container .table tbody td.name-cell,
  .wc-container .table tbody td.name-cell {
    color: #181c32 !important;
  }
  
  #printPageButton, #themeToggleButton {
    display: none !important;
  }
}

/* --- Teams Squads Section --- */
.teams-squads-section {
  clear: both !important;
  display: block;
}

.squad-card {
}

[data-bs-theme="light"] .teams-squads-section {
  border-top: 1px dashed #e4e6ef !important;
  margin-top: 50px !important;
  padding-top: 40px !important;
}

[data-bs-theme="light"] .squad-card {
  background-color: #ffffff !important;
  border: 1px solid #e4e6ef !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .teams-squads-section {
  border-top: 1px dashed rgba(255, 255, 255, 0.08) !important;
  margin-top: 50px !important;
  padding-top: 40px !important;
}

[data-bs-theme="dark"] .squad-card {
  background-color: #15171c !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

@media print {
  .teams-squads-section {
    clear: both !important;
    height: auto !important;
    overflow: visible !important;
    position: relative !important;
    display: block !important;
    float: none !important;
    margin-top: 40px !important;
    padding-top: 20px !important;
    border-top: 1px dashed #e4e6ef !important;
  }

  [data-bs-theme="dark"] .squad-card,
  [data-bs-theme="light"] .squad-card,
  .squad-card {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border: 1px solid #e4e6ef !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }

  [data-bs-theme="dark"] .squad-card .card-title,
  [data-bs-theme="light"] .squad-card .card-title,
  .squad-card .card-title,
  [data-bs-theme="dark"] .squad-card a,
  [data-bs-theme="light"] .squad-card a,
  .squad-card a {
    color: #181c32 !important;
  }

  [data-bs-theme="dark"] .badge-light-primary,
  [data-bs-theme="light"] .badge-light-primary,
  .badge-light-primary {
    background-color: rgba(0, 158, 247, 0.08) !important;
    color: #009ef7 !important;
  }

  [data-bs-theme="dark"] .badge-light-warning,
  [data-bs-theme="light"] .badge-light-warning,
  .badge-light-warning {
    background-color: rgba(245, 152, 0, 0.1) !important;
    color: #b58100 !important;
  }
}

