/* =========================================================
   RANKING TABLE STYLES for sharpshotpicks.com
   =========================================================
   Features:
   ✅ Dark mode
   ✅ Sticky headers
   ✅ Fixed first column
   ✅ No sort arrows
   ✅ Highlighted sorted column
   ✅ Manual width for specific columns
   ✅ Mobile responsive
   ✅ Full-bleed prevention
*/

/* =========================================================
   TABLE OF CONTENTS
   =========================================================
   1. Base Table Styling
   2. Scroll Wrapper (Mobile/Overflow)
   3. Cell Focus / Active State
   4. Table Header (Sticky + No Sort Arrows)
      4.1 Header Container
      4.2 Remove Sort Arrows
      4.3 Highlight Sorted Column
   5. Cell & Row Styling (Padding, Borders, Hover, Stripes)
   6. Fixed Column / DataTables Alignment Helpers
   7. DataTables Wrapper (Global Container)
   8. Responsive (Tablet, Mobile)
   9. Fixed Left Column (Frozen) – Opaque Layering
   10. Table Containers (Wrappers) – Visual Frame
   11. Generic Ranking Table Defaults
   12. Pagination & Page Length Controls
   13. Non-Scrollable Wrapper Fix (Pitcher Page, Mobile)
   14. Page-Specific Overrides (Matchups pages)
   15. Matchups-Specific Column Tweaks (MLB, NASCAR)
   ========================================================= */


/* =========================================================
   1. BASE TABLE STYLING
   ========================================================= */
table.dataTable.ranking-table {
  width: 100%;
  background-color: #000 !important;
  color: #fff !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  font-size: 11px;
}


/* =========================================================
   2. SCROLL WRAPPER (MOBILE/OVERFLOW)
   ========================================================= */
.table-scroll-wrapper { width: 100%; overflow-x: auto; }
.table-scroll-wrapper table { min-width: 100%; }


/* =========================================================
   3. CELL FOCUS / ACTIVE STATE
   (Fixed broken selectors to use :focus / :active)
   ========================================================= */
.ranking-table td:focus,
.ranking-table td:active {
  outline: none !important;
  background-color: #1de1d1 !important;
  color: inherit !important;
}


/* =========================================================
   4. TABLE HEADER (STICKY + NO SORT ARROWS)
   ========================================================= */

/* ---------- 4.1 Header Container ---------- */
table.dataTable.ranking-table thead {
  background-color: #000;
  top: 0;
  z-index: 2;
  border-bottom: none !important;
}
table.dataTable.ranking-table thead th {
  background-color: #000 !important;
  color: #1de1d1 !important;
  border-bottom: none !important;
  padding: 2px 4px;
  line-height: 1.2;
  white-space: nowrap;
  position: sticky;
  top: 0;
  padding-right: 20px;
  text-transform: uppercase;
}

/* ---------- 4.2 Remove Sort Arrows ---------- */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
thead th.sorting,
thead th.sorting_asc,
thead th.sorting_desc {
  background: none !important;
  background-image: none !important;
  padding-right: 10px !important;
}
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after,
table.dataTable thead th.sorting:before,
table.dataTable thead th.sorting_asc:before,
table.dataTable thead th.sorting_desc:before,
table.dataTable>thead .sorting::before,
table.dataTable>thead .sorting_asc::before,
table.dataTable>thead .sorting_desc::before,
table.dataTable>thead .sorting_asc_disabled::before,
table.dataTable>thead .sorting_desc_disabled::before,
table.dataTable>thead .sorting::after,
table.dataTable>thead .sorting_asc::after,
table.dataTable>thead .sorting_desc::after,
table.dataTable>thead .sorting_asc_disabled::after,
table.dataTable>thead .sorting_desc_disabled::after {
  display: none !important;
  content: none !important;
}

/* ---------- 4.3 Highlight Sorted Column ---------- */
table.dataTable.ranking-table thead th.sorting_asc,
table.dataTable.ranking-table thead th.sorting_desc {
  background-color: #1a1a1a !important;
  color: #1de1d1 !important;
}
table.dataTable.ranking-table tbody td.sorted {
  background-color: #1a1a1a !important;
}


/* =========================================================
   5. CELL & ROW STYLING (PADDING, BORDERS, HOVER, STRIPES)
   ========================================================= */

/* Base DataTables padding (will be overridden by ranking-table rules below if needed) */
table.dataTable th,
table.dataTable td {
  padding: 8px; /* general baseline */
}

/* Ranking table cell defaults */
table.dataTable.ranking-table td,
table.dataTable.ranking-table th {
  padding: 2px 4px;
  border: 1px solid #222 !important;
  color: #fff !important;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.2;
}

/* Preferred padding for ranking table (wins over the 2px/4px above) */
.ranking-table th,
.ranking-table td {
  padding: 6px 12px !important;
  min-width: 40px;
}

/* First column emphasis + separation */
.ranking-table th:nth-child(1),
.ranking-table td:nth-child(1) {
  white-space: nowrap;
  overflow: visible;
  z-index: 100000000 !important;
}
.ranking-table td:nth-child(1) { border-left: 2px solid #1de1d1; }

/* Hover states */
table.dataTable.ranking-table tbody td:hover {
  background-color: #1de1d1 !important;
  color: #000 !important;
  transition: 0.15s ease-in-out;
}
table.dataTable.ranking-table tbody tr:hover {
  background-color: #222 !important;
}

/* Row striping (fixed: no generic "tbody tr" override) */
table.dataTable.ranking-table tbody tr:nth-child(even) {
  background-color: #0d0d0d !important;
}
table.dataTable.ranking-table tbody tr:nth-child(odd) {
  background-color: #1a1a1a !important;
}

/* Error and empty message styling */
.ranking-table td.dataTables_empty,
.optimizer-error {
  background-color: #000 !important;
  color: #fff !important;
  text-align: center;
}

/* Scroll body spacing fix */
.dataTables_wrapper .dataTables_scrollBody { margin-top: 0 !important; }


/* =========================================================
   6. FIXED COLUMN / DATATABLES ALIGNMENT HELPERS
   ========================================================= */
.dataTables_scrollHead table,
.dataTables_scrollBody table,
.DTFC_LeftHeadWrapper table,
.DTFC_LeftBodyWrapper table {
  width: 100% !important;
}

.DTFC_LeftHeadWrapper,
.dataTables_scrollHead,
.ranking-table .DTFC_LeftBodyWrapper,
.ranking-table .dataTables_scrollBody,
.dataTables_scrollBody {
  padding: 0 !important;
}


/* =========================================================
   7. DATATABLES WRAPPER (GLOBAL CONTAINER)
   (Merged both wrapper blocks)
   ========================================================= */
.dataTables_wrapper {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 8px !important;
  box-sizing: border-box;
  background-color: transparent !important;
}


/* =========================================================
   8. RESPONSIVE (TABLET, MOBILE)
   ========================================================= */
@media (max-width: 1024px) {
  .ranking-table th:nth-child(1),
  .ranking-table td:nth-child(1) {
    width: 140px;
  }
}

@media (max-width: 768px) {
  .ranking-table { font-size: 10px; }
  .ranking-table th,
  .ranking-table td {
    padding: 6px 6px !important;
    font-size: 11px !important;
    line-height: 1.4;
    border-right: 1px solid #222;
  }
  .table-scroll-wrapper table {
    /* keep an eye on min-width need; currently not forcing */
  }
}


/* =========================================================
   9. FIXED LEFT COLUMN (FROZEN) – OPAQUE LAYERING
   ========================================================= */
.DTFC_LeftBodyWrapper,
.DTFC_LeftHeadWrapper {
  background-color: #000 !important;
  z-index: 9999 !important;
}
.DTFC_LeftBodyWrapper td,
.DTFC_LeftHeadWrapper th {
  background-color: #000 !important;
  color: #fff !important;
  border-right: 1px solid #1de1d1 !important;
  border-left: 2px solid #1de1d1 !important;
  text-align: left !important;
  padding-left: 6px !important;
  font-weight: normal !important;
  position: relative !important;
  z-index: 10000 !important;
  box-shadow: inset 0 0 0 9999px #000 !important;
}

/* Final layering rules */
.DTFC_LeftHeadWrapper { z-index: 20 !important; position: relative !important; }
.dataTables_scrollHead { z-index: 1 !important; position: relative !important; }
.dataTables_scrollBody {
  z-index: 1 !important; position: relative !important;
  overflow-x: auto !important; overflow-y: auto !important;
}

/* Cleanup bleed from pseudo-elements */
.DTFC_LeftBodyWrapper td::before,
.DTFC_LeftBodyWrapper td::after,
.DTFC_LeftHeadWrapper th::before,
.DTFC_LeftHeadWrapper th::after {
  display: none !important;
  content: none !important;
}

.dtfc-fixed-left { background: #000 !important; }


/* =========================================================
   10. TABLE CONTAINERS (WRAPPERS) – VISUAL FRAME
   ========================================================= */

/* Outer frame for ranking table (red tint intentionally retained) */
.ranking-table-wrapper {
  /*background-color: #310b0b;*/
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  box-shadow:
    0 0 30px rgba(0, 255, 255, 0.3),
    0 10px 30px rgba(0, 0, 0, 0.6);
  padding: 10px;
  overflow: hidden;
}

/* Scrollable area + visual frame (merged three .data-table-wrapper blocks) */
.data-table-wrapper {
  flex: 1 !important;
  min-width: 0 !important; /* critical for flex containers */
  width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;

  background-color: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  box-shadow:
    0 0 12px rgba(0, 255, 255, 0.12),
    0 6px 24px rgba(0, 0, 0, 0.5);
  padding: 10px;
  overflow: hidden;
}


/* =========================================================
   11. GENERIC RANKING TABLE DEFAULTS
   ========================================================= */
.ranking-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}


/* =========================================================
   12. PAGINATION & PAGE LENGTH CONTROLS
   ========================================================= */

/* Page length (MLB) */
#mlb-ranking-table_length {
  margin-top: 10px;
  padding: 10px;
  background-color: #111;
  color: #fff;
  border-radius: 5px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#mlb-ranking-table_length label {
  display: flex;
  align-items: center;
  gap: 8px;
}
#mlb-ranking-table_length select {
  background-color: #000;
  color: #1de1d1;
  border: 1px solid #1de1d1;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Space Mono', monospace;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer;
  min-width: 175px; /* ⬅️ wider than default */
}

/* Pagination container */
.dataTables_paginate {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 15px 20px;
  gap: 10px;
  background: transparent;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}

/* Buttons */
.dataTables_paginate .paginate_button {
  background: #1de1d1 !important;
  color: #000;
  padding: 6px 16px;
  border-radius: 25px;
  border: none;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.dataTables_paginate .paginate_button:hover:not(.disabled) {
  background: #11c3c3 !important;
  color: #fff;
  transform: translateY(-1px);
}
.dataTables_paginate .paginate_button.current {
  background: #0b9e9e !important;
  color: #fff;
  font-weight: 700;
  border: 2px solid #fff;
}
.dataTables_paginate .paginate_button.disabled {
  background: #333 !important;
  color: #777 !important;
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Optional arrows via FontAwesome */
.dataTables_paginate .paginate_button.previous::before {
  content: "\f104";
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  margin-right: 6px;
}
.dataTables_paginate .paginate_button.next::after {
  content: "\f105";
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  margin-left: 6px;
}

div.dt-button-collection {
  background: #000 !important;
}


/* =========================================================
   13. NON-SCROLLABLE WRAPPER FIX (PITCHER PAGE, MOBILE)
   ========================================================= */
@media (max-width: 768px) {
  .non-scroll-wrapper .table-scroll-wrapper { overflow-x: hidden !important; }
}


/* =========================================================
   14. PAGE-SPECIFIC OVERRIDES (MATCHUPS PAGES)
   =========================================================
   Page 14  = MLB Matchups
   Page 148 = EPL Matchups
   Add new matchups pages here as they’re made.
*/
body.page-id-14 .ranking-table-wrapper,
body.page-id-14 .data-table-wrapper,
body.page-id-148 .ranking-table-wrapper,
body.page-id-148 .data-table-wrapper, 
body.page-id-87 .ranking-table-wrapper,
body.page-id-87 .data-table-wrapper {
  width: auto;
  max-width: 1470px !important;
  margin: 0 auto;
  padding: 0;
  overflow-x: auto;
}


/* =========================================================
   15. MATCHUPS-SPECIFIC COLUMN TWEAKS (MLB, NASCAR)
   ========================================================= */

/* MLB lineups: Batting Order (col 1) tiny & centered */
table[id^="MLBSchedule"] td:nth-child(1),
table[id^="MLBSchedule"] th:nth-child(1),
div.DTFC_LeftWrapper table[id^="MLBSchedule"] td:nth-child(1),
div.DTFC_LeftWrapper table[id^="MLBSchedule"] th:nth-child(1) {
  width: 30px !important;
  max-width: 30px !important;
  min-width: 30px !important;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

/* MLB lineups: Player Name (col 2) left aligned + sticky visuals intact */
table[id^="MLBSchedule"] td:nth-child(2),
table[id^="MLBSchedule"] th:nth-child(2),
div.DTFC_LeftWrapper table[id^="MLBSchedule"] td:nth-child(2),
div.DTFC_LeftWrapper table[id^="MLBSchedule"] th:nth-child(2) {
  text-align: left !important;
}

table[id^="MLBSchedule"] th:nth-child(2),
table[id^="MLBSchedule"] td:nth-child(2),
div.DTFC_LeftWrapper table[id^="MLBSchedule"] td:nth-child(2),
div.DTFC_LeftWrapper table[id^="MLBSchedule"] th:nth-child(2) {
  white-space: nowrap;
  overflow: visible;
  z-index: 100000000 !important;
}

table[id^="MLBSchedule"] th:nth-child(2),
div.DTFC_LeftWrapper table[id^="MLBSchedule"] th:nth-child(2) {
  white-space: nowrap;
  overflow: visible;
  background: #000 !important;
  z-index: 100000000 !important;
}

/* NASCAR rankings: longer names */
table[id^="nascar_ranking_table"] td:nth-child(1),
table[id^="nascar_ranking_table"] th:nth-child(1),
div.DTFC_LeftWrapper table[id^="nascar_ranking_table"] td:nth-child(1),
div.DTFC_LeftWrapper table[id^="nascar_ranking_table"] th:nth-child(1) {
  width: 175px !important;
  max-width: 175px !important;
  min-width: 175px !important;
  text-align: left;
  padding-left: 4px;
  padding-right: 4px;
}




















/* Pitcher table group headers */
table.dataTable tr.dtrg-group.dtrg-level-0 th {
  text-align: center !important;
  background-color:rgba(255,255,255,0.1) !important;
  color: #1de1d1 !important;
  font-size: 1.5em;
  font-weight: bold;
}

/* ===== Global Scrollbar Styling (dark + teal) ===== */

/* Apply to ALL scrollable areas */
* {
  scrollbar-width: thin;                 /* Firefox */
  scrollbar-color: #1de1d1 #2b2a2a;      /* thumb / track */
}

/* WebKit (Chrome/Edge/Safari) */
*::-webkit-scrollbar {
  width: 10px;                           /* vertical */
  height: 10px;                          /* horizontal */
}
*::-webkit-scrollbar-track {
  background: #2b2a2a;                   /* body background */
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb {
  background: #1de1d1;                   /* primary teal */
  border-radius: 10px;
  border: 2px solid #2b2a2a;             /* separation on dark bg */
}
*::-webkit-scrollbar-thumb:hover {
  background: #009688;                   /* hovered teal */
}

/* ===== Tables & DataTables specific ===== */

.table-responsive,
.table-scroll,
.scroll-x,
.scroll-y {
  overflow: auto;
}

.dataTables_wrapper .dataTables_scrollBody {
  scrollbar-width: thin;
  scrollbar-color: #1de1d1 #2b2a2a;
  padding-bottom: 4px;                   /* tiny breathing room */
}
.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb {
  background: #1de1d1;
  border-radius: 10px;
  border: 2px solid #2b2a2a;
}
.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-track {
  background: #2b2a2a;
  border-radius: 10px;
}
