:root {
  --bs-primary: #2B2B2B;
  --bg-body: #F7F7F7;
  --bg-card: #ffffff;
  --text-main: #212529;
  --text-primary: #2B2B2B;
  --text-heading: #1a237e;
  --border-color: #dee2e6;
  --input-bg: #fff;
  --input-text: #212529;
  --btn-primary-bg: #2B2B2B;
  --btn-primary-text: #fff;
}

[data-theme="dark"] {
  --bs-primary: #000000;
  --bg-body: #121212;
  --bg-card: #1e1e1e;
  --text-main: #e0e0e0;
  --text-primary: #bbdefb;
  --text-heading: #90caf9;
  --border-color: #444;
  --input-bg: #2c2c2c;
  --input-text: #e0e0e0;
  --btn-primary-bg: #424242;
  --btn-primary-text: #fff;

  /* Bootstrap Table Overrides via Variables */
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-main);
  --bs-table-border-color: var(--border-color);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
  --bs-table-active-bg: rgba(255, 255, 255, 0.1);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.075);
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--text-heading);
}

body,
body.bg-light {
  background-color: var(--bg-body) !important;
  color: var(--text-main) !important;
  transition: background-color 0.3s, color 0.3s;
}

.card {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}

.list-group-item {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}

.modal-content {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.form-control,
.form-select {
  background-color: var(--input-bg);
  color: var(--input-text);
  border-color: var(--border-color);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--input-bg);
  color: var(--input-text);
}

#auth-container button {
  min-width: 34px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  /* espacio entre icono y texto */
}

.list-group li {
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.list-group li:hover {
  background-color: rgba(187, 222, 251, 0.2);
  /* Semi-transparent blue */
}

#estatsContainer button {
  margin-left: 0.4em;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.blink {
  animation: blink 1s infinite;
}

#contador {
  font-size: 1.8rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  padding: 2px 6px;
  background-color: #343a40;
  /* fondo oscuro */
  color: white;
  border-radius: 6px;
  min-width: 80px;
  user-select: none;
  font-family: 'Courier New', Courier, monospace;
  text-align: center;
  margin: 0 auto;
}

#partidosPorFecha .list-group-item {
  font-weight: 600;
}



#marcador {
  font-weight: bold;
  font-size: 3em;
}

#tiempo-faltas {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin: 20px 0;
  font-size: 1.5em;
}

#faltas {
  display: flex;
  gap: 30px;
}

.faltas-equipo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  max-height: 50px;
}

.body {
  background-color: var(--bg-body) !important;
}

body {
  padding-bottom: 60px;
  /* Space for fixed footer */
  overflow-x: hidden;
}

.btn-primary,
.bg-primary,
.text-primary {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fff !important;
}

/* Specific text primary override for dark mode if needed elsewhere, but .text-primary usually means the brand color */
a.text-primary {
  color: var(--bs-primary) !important;
}


.logo {
  display: inline-block;
  /* Para que tenga tamaño */
  width: 215px;
  /* Ajusta el tamaño deseado */
  height: 50px;
  /* Ajusta el tamaño deseado */
  background-image: url('../img/logo-t.png');
  /* Ruta a tu imagen */
  background-size: contain;
  /* Para que la imagen se escale */
  background-repeat: no-repeat;
  background-position: center;
  text-indent: -9999px;
  /* Oculta texto si hay */
}

.stat-btn {
  width: 34px !important;
  height: 34px !important;
  font-size: 1rem;
  padding: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
}

#breadcrumb-container {
  margin-left: 15px;
}

#breadcrumb-container a {
  color: var(--bs-primary) !important;
  text-decoration: none;
}

/* Fix visibility in dark mode where primary is black */
[data-theme="dark"] #breadcrumb-container a {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .text-muted {
  color: #adb5bd !important;
}

[data-theme="dark"] .text-secondary {
  color: #a8a8a8 !important;
}

[data-theme="dark"] .breadcrumb-item.active {
  color: #e0e0e0;
}

[data-theme="dark"] .breadcrumb-item+.breadcrumb-item::before {
  color: #adb5bd;
}

/* Dark Mode Table Fixes */
[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color);
}

[data-theme="dark"] .table> :not(caption)>*>* {
  background-color: var(--bg-card);
  /* Fallback */
  color: var(--text-main);
  border-color: var(--border-color);
}

[data-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>* {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

[data-theme="dark"] .table-hover>tbody>tr:hover>* {
  background-color: rgba(255, 255, 255, 0.075);
  color: var(--text-main);
}

[data-theme="dark"] .table-light,
[data-theme="dark"] .table-light th,
[data-theme="dark"] .table-light td,
[data-theme="dark"] .table .thead-light th {
  background-color: #2c2c2c !important;
  color: var(--text-main) !important;
  border-color: var(--border-color);
}

[data-theme="dark"] .table-secondary,
[data-theme="dark"] .table-secondary th,
[data-theme="dark"] .table-secondary td {
  background-color: #333 !important;
  color: var(--text-main) !important;
}


/* Override utility classes in dark mode */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-body,
[data-theme="dark"] .list-group-item {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color);
}

[data-theme="dark"] .bg-light {
  background-color: var(--bg-body) !important;
}

/* Ensure table cells inside these containers also adapt if not handled by .table overrides */
[data-theme="dark"] .bg-white td,
[data-theme="dark"] .bg-white th {
  background-color: transparent !important;
  color: inherit !important;
}



.btn {


  min-width: 40px;
  min-height: 40px;
  font-size: large;
}

/* Foul Lights Indicator */
.foul-lights {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 5px;
}

.foul-dot {
  width: 10px;
  height: 10px;
  background-color: #444;
  /* Dark gray for inactive */
  border-radius: 50%;
  display: inline-block;
  border: 1px solid #666;
}

.foul-dot.active {
  background-color: #ff0000;
  /* Red for active */
  box-shadow: 0 0 5px #ff0000;
  border-color: #ff0000;
}

/* ===== Calendar View Styles ===== */

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

/* Matches Container */
.matches-container {
  overflow-y: auto;
  max-height: 600px;
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
  .calendar-grid {
    grid-template-columns: 1fr !important;
    /* Force single column on mobile */
    gap: 15px;
  }

  .matches-container {
    max-height: none;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .calendar-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }
}

/* Month View Grid (Desktop) */
.month-grid {
  display: none;
}

@media (min-width: 768px) {
  .month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
  }
}


.month-day-cell {
  min-height: 100px;
  border: 1px solid #dee2e6;
  padding: 5px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
}

.month-day-header {
  font-weight: bold;
  text-align: right;
  margin-bottom: 5px;
}

.month-day-match {
  font-size: 0.75em;
  margin-bottom: 2px;
  padding: 2px 4px;
  background-color: #f8f9fa;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #e9ecef;
}

.month-day-match:hover {
  background-color: #e9ecef;
}

.month-day-match.match-local {
  border-left: 3px solid #2B2B2B;
}

.month-day-match.match-visitor {
  border-left: 3px solid #6c757d;
}

/* Mobile Header Optimization */
@media (max-width: 576px) {
  .logo {
    width: 150px !important;
    height: 35px !important;
  }

  #userAvatar {
    width: 32px !important;
    height: 32px !important;
  }

  #userInfo {
    font-size: 0.9rem;
  }
}

/* ===== Basketball Court Visualization ===== */
.basketball-court {
  position: relative;
  width: 100%;
  max-width: 500px;
  /* Aspect ratio based on standard half court or the image.
     Assuming the image is roughly square or slightly vertical.
     Let's use a standard ratio or auto height if possible, but for absolute positioning we need height.
     Let's assume a ratio of roughly 1:0.94 (500px width / 470px height from before).
     Or better, use aspect-ratio property. */
  aspect-ratio: 500 / 470;
  margin: 0 auto;
  background-color: #d2b48c;
  /* Try multiple paths to be safe */
  background-image: url('../img/cancha.png');
  background-size: cover;
  background-position: center;
  border: 2px solid #fff;
  overflow: hidden;
}

/* Player Jersey on Court */
.player-jersey {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 60px;
  /* Smaller width */
  z-index: 10;
  transition: all 0.3s ease;
}

.jersey-svg {
  width: 60px;
  /* Smaller jersey */
  height: 60px;
  filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.3));
}

.player-info {
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.7rem;
  /* Smaller font */
  margin-top: -10px;
  white-space: nowrap;
}

.player-stat {
  font-weight: bold;
  color: #ffc107;
  font-size: 0.8rem;
  /* Smaller font */
  text-shadow: 1px 1px 1px #000;
}

/* Positions (2-2-1 Defensive Distribution around hoop) */
/* Basket is at TOP (approx 5-10%) */

/* Row 1: Closest to basket (Low Post) */
.pos-1 {
  top: 20%;
  left: 30%;
}

.pos-2 {
  top: 20%;
  left: 70%;
}

/* Row 2: Middle (Elbows/Wings) */
.pos-3 {
  top: 45%;
  left: 20%;
}

.pos-4 {
  top: 45%;
  left: 80%;
}

/* Row 3: Furthest (Top of Key) */
.pos-5 {
  top: 70%;
  left: 50%;
}