/* ================= Table Styling ================= */
.f513-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  table-layout: fixed;
}

.f513-table th,
.f513-table td {
  padding: 6px 8px;
  text-align: center;
  border: 1px solid #ddd;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================= Header ================= */
.f513-table th {
  background-color: #f5f5f5;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Ensure Upcoming Games header fully visible */
.f513-table th.upcoming-games-header {
  white-space: normal;
  line-height: 1.2;
  min-width: 120px;
}

/* Hover effect */
.f513-table tbody tr:hover {
  background-color: #f0f8ff;
}

/* ================= First Column (Team) ================= */
.f513-table th:nth-child(1),
.f513-table td:first-child {
  min-width: 180px;
  max-width: 400px;
  width: auto;
}

.f513-table td:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  overflow: hidden;
}

.f513-table td:first-child img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.f513-table td:first-child span {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================= ELO delta ================= */
.elo-container {
  display: inline-flex;
  min-width: 50px;
  justify-content: flex-end;
  font-weight: bold;
}

.elo-delta-positive {
  color: green;
  font-weight: bold;
  transition: transform 0.3s ease;
  display: inline-block;
}

.game-btn.selected-tie:hover {
  background-color: #d35400; /* slightly darker orange */
  color: #fff;
}

.game-btn.selected-tie {
  background-color: #e65800; /* orange for tie */
  border-color: #f0d9a9;
  color: #222;  /* better contrast on orange */
  font-weight: bold;
}



.elo-delta-tie {
  color: #e65800;       /* orange for tie */
  font-weight: bold;
  transition: transform 0.3s ease;
  display: inline-block;
}


.elo-delta-negative {
  color: red;
  font-weight: bold;
  transition: transform 0.3s ease;
  display: inline-block;
}

.delta-pop {
  transform: scale(1.4);
  transition: transform 0.3s ease;
  display: inline-block;
}

.delta-pop.delta-animate {
  transform: scale(1.3);
  transition: transform 0.2s ease;
}

/* ================= Playoff bar ================= */
.playoff-bar {
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s ease;
}

.playoff-bar span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  pointer-events: none;
  white-space: nowrap;
}

.elo-flex { 
    display:inline-flex; 
    align-items:center; gap:4px; 
    min-width:48px; 
    white-space:nowrap; 
    margin-left:6px; 
    
}


/* ================= Column Widths ================= */
.f513-table th:nth-child(2),
.f513-table td:nth-child(2),
.f513-table th:nth-child(3),
.f513-table td:nth-child(3),
.f513-table th:nth-child(4),
.f513-table td:nth-child(4),
.f513-table th:nth-child(5),
.f513-table td:nth-child(5) {
  width: 60px;
}

.f513-table th:nth-child(6),
.f513-table td:nth-child(6) {
  width: 80px;
}

.f513-table th:nth-child(7),
.f513-table td:nth-child(7) {
  width: 100px;
}

.f513-table th:nth-child(8),
.f513-table td:nth-child(8),
.f513-table th:nth-child(9),
.f513-table td:nth-child(9) {
  width: 80px;
}

.f513-table th:nth-child(10),
.f513-table td:nth-child(10) {
  width: 90px;
  min-width: 110px;
  max-width: 110px;
}

/* ================= Upcoming Games Cell (Mobile Pinch + Scroll Fix) ================= */
.f513-table td.upcoming-games-cell {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: flex-start;
  overflow-x: auto;                 /* enable horizontal scroll */
  overflow-y: hidden;               /* hide vertical scroll */
  max-width: 100%;
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
  overscroll-behavior: contain;      /* prevent page scroll from propagating */
  touch-action: pan-x pinch-zoom;    /* allow horizontal pan + pinch zoom */
  -ms-touch-action: pan-x pinch-zoom; /* for IE/Edge */
  scroll-snap-type: x mandatory;     /* optional: snaps buttons nicely on scroll */
  padding-bottom: 2px;               /* prevent scrollbar from overlapping content */
}


.f513-table td.upcoming-games-cell::-webkit-scrollbar {
  height: 4px;
}

/* Selected buttons */
.f513-table td .game-btn.selected-win {
  background-color: #28a745;
  color: #fff;
  font-weight: bold;
}

.f513-table td .game-btn.selected-loss {
  background-color: #c93e4c;
  color: #fff;
  font-weight: bold;
}

/* Disabled buttons */
.f513-table td .game-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Hover effect for normal buttons */
.f513-table td .game-btn:not(.selected-win):not(.selected-loss):hover {
  background-color: #0073aa;
  color: #fff;
  border-color: #005177;
  font-size: 11px;
}

/* Optional: ensure buttons stay readable on small screens */
@media (max-width: 480px) {
  .f513-table td.upcoming-games-cell .game-btn.selected-tie {
    font-size: 12px;
    padding: 2px 4px;
  }
}


/* ================= Buttons outside table ================= */
button {
  margin: 4px;
  padding: 6px 10px;
  background: #0073aa;
  color: #fff;
  border: none;
  cursor: pointer;
}

button:hover {
  background: #005177;
}

/* Inline percentage bars */
.percentage-cell {
  padding: 2px 4px;
  text-align: center;
  position: relative;
}

.percentage-bar {
  height: 18px;
  border-radius: 4px;
  position: relative;
  background-color: #0073aa;
}

.percentage-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
}

.winDiv-bar { background-color: #28a745; }
.playoff-bar { background-color: #0073aa; }
.sb-bar { background-color: #ff9800; }

/* ================= Conference toggle buttons ================= */
.conf-toggle button {
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: #222;
  padding: 6px 10px;
  margin: 2px;
  cursor: pointer;
  transition: background 0.2s;
}

.conf-toggle button.active {
  background-color: #0073aa;
  color: #fff;
}

.conf-toggle button:hover {
  background-color: #e8e8e8;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .conf-toggle button {
    border: 1px solid #444;
    background: #222;
    color: #ddd;
  }

  .conf-toggle button.active {
    background-color: #0073aa;
    color: #fff;
  }

  .conf-toggle button:hover {
    background-color: #333;
  }
}

/* ================= Responsive Adjustments ================= */
@media (max-width: 1024px) {
  .f513-table th:nth-child(1),
  .f513-table td:nth-child(1) {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
  }
  .f513-table th:nth-child(10),
  .f513-table td:nth-child(10) {
    width: 90px;
  }
}



@media (max-width: 768px) {
  .f513-table th:nth-child(1),
  .f513-table td:nth-child(1) {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
  }
  .f513-table th:nth-child(10),
  .f513-table td:nth-child(10) {
    width: 80px;
  }
}

@media (max-width: 480px) {
  .f513-table th:nth-child(1),
  .f513-table td:nth-child(1) {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
  }
  .f513-table th:nth-child(10),
  .f513-table td:nth-child(10) {
    width: 70px;
  }
}
