/* NB Odds Table - Optimized for Fast Loading */

.nbogu-outer {
  box-sizing: border-box;
  background: #e0f2fe !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 200px !important;
  width: 100% !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Trong trận Header */
.nbogu-trong-tran-header {
  background: #ffffff !important;
  padding: 12px 16px !important;
  margin-bottom: 12px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.nbogu-trong-tran-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nbogu-trong-tran-icon {
  font-size: 18px;
}

.nbogu-trong-tran-title {
  font-size: 16px;
  font-weight: 700;
  color: #10b981;
}

.nbogu-trong-tran-arrow {
  font-size: 14px;
  color: #10b981;
  font-weight: bold;
}

.nbogu-trong-tran-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Newbie Toggle */
.nbogu-newbie-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.nbogu-newbie-checkbox {
  display: none;
}

.nbogu-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  transition: background 0.3s;
}

.nbogu-toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nbogu-newbie-checkbox:checked + .nbogu-toggle-slider {
  background: #10b981;
}

.nbogu-newbie-checkbox:checked + .nbogu-toggle-slider::before {
  transform: translateX(20px);
}

.nbogu-newbie-text {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

/* Filter Buttons */
.nbogu-filter-btn {
  padding: 6px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.nbogu-filter-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.nbogu-filter-btn:active {
  background: #e5e7eb;
}

/* Match Icons */
.nbogu-match-icons {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 8px !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.nbogu-icon-btn {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: color 0.2s;
  font-size: 16px;
}

.nbogu-icon-btn:hover {
  color: #10b981;
}

.nbogu-youtube-btn {
  width: 20px;
  height: 20px;
  color: #ef4444;
}

.nbogu-youtube-btn:hover {
  color: #dc2626;
}

/* Half Time Score */
.nbogu-ht-score {
  margin-top: 8px !important;
  font-size: 12px !important;
  color: #6b7280 !important;
  font-weight: 500 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* More Markets Button */
.nbogu-more-markets-cell {
  padding: 8px !important;
  text-align: center !important;
  vertical-align: middle !important;
  display: table-cell !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.nbogu-more-markets-btn {
  background: #10b981 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  white-space: nowrap !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.nbogu-more-markets-btn:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.nbogu-table-container {
  margin-bottom: 24px;
  background: #e0f2fe;
  border-radius: 8px;
  overflow: hidden;
}

/* League Header */
.nbogu-league-header-row {
  background: #dbeafe;
  padding: 12px 16px;
  border-bottom: 2px solid #93c5fd;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nbogu-league-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nbogu-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nbogu-header-logo {
  width: 60px;
  height: auto;
  opacity: 0.9;
  flex-shrink: 0;
}

.nbogu-cuoc-ngay-btn {
  background: #3b82f6;
  color: #ffffff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
  border: 2px solid #2563eb;
}

.nbogu-cuoc-ngay-btn:hover {
  background: #2563eb;
  border-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
  color: #ffffff;
}

.nbogu-league-logo-shield {
  flex-shrink: 0;
}

.nbogu-league-logo-shield svg {
  display: block;
}

.nbogu-league-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* Table Wrapper */
.nbogu-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nbogu-odds-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 1200px;
  background: #e0f2fe;
}

/* Table Headers */
.nbogu-odds-table thead {
  background: #dbeafe;
}

.nbogu-odds-table thead tr:first-child th {
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
  border-bottom: 2px solid #93c5fd;
}

.nbogu-odds-table thead tr:first-child th.col-match-info {
  text-align: left;
  width: 280px;
  min-width: 280px;
}

.nbogu-odds-table thead tr:first-child th.market-header {
  border-left: 1px solid #e9ecef;
}

.nbogu-odds-table thead tr.sub-header-row th {
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: #1e3a8a;
  border-bottom: 1px solid #93c5fd;
}

.nbogu-odds-table thead tr.sub-header-row th:first-child {
  text-align: left;
}

/* Match Info Column */
.nbogu-odds-table .col-match-info {
  width: 280px;
  min-width: 280px;
  padding: 12px;
  vertical-align: top;
}

.nbogu-match-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.nbogu-live-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  flex-shrink: 0;
}

.nbogu-live-label {
  font-size: 13px;
  font-weight: 600;
  color: #10b981;
}

.nbogu-live-time-btn {
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.nbogu-time-label {
  font-size: 13px;
  color: #666;
}

.nbogu-score {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}

.nbogu-teams {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nbogu-team-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nbogu-team-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.nbogu-team-name {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Odds Cells */
.nbogu-odds-table .odds-cell {
  width: 80px;
  min-width: 80px;
  padding: 8px 4px;
  text-align: center;
  vertical-align: middle;
}

.nbogu-odds-table .odds-btn {
  width: 100%;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 50px;
  justify-content: center;
}

.nbogu-odds-table .odds-btn:hover:not(.disabled) {
  background: #dbeafe;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.nbogu-odds-table .odds-btn.disabled {
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.nbogu-odds-table .odds-btn .handicap,
.nbogu-odds-table .odds-btn .ou-line {
  font-size: 10px;
  color: #666;
  font-weight: 400;
}

/* Match Rows */
.nbogu-odds-table tbody tr.nbogu-match-row {
  border-top: 1px solid #bfdbfe;
  transition: background 0.2s;
  background: #ffffff;
}

.nbogu-odds-table tbody tr.nbogu-match-row:hover {
  background: #dbeafe;
}

.nbogu-odds-table tbody tr.nbogu-match-row:first-child {
  border-top: none;
}

/* Responsive */
@media (max-width: 1200px) {
  .nbogu-odds-table {
    min-width: 1000px;
  }
  
  .nbogu-odds-table .col-match-info {
    width: 240px;
    min-width: 240px;
  }
  
  .nbogu-odds-table .odds-cell {
    width: 70px;
    min-width: 70px;
  }
}

/* Mobile Layout - Stack cards instead of table */
@media (max-width: 768px) {
  /* Mobile Compact - Add specific class to avoid conflicts - Higher priority */
  body .nbogu-outer.nbogu-mobile-compact,
  body .nbogu-outer {
    padding: 8px 6px !important;
    margin-top: 160px !important;
    margin-bottom: 32px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 200px !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #e0f2fe !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  /* Override any inline styles on mobile */
  body .nbogu-outer.nbogu-mobile-compact[style],
  body .nbogu-outer[style] {
    margin-top: 160px !important;
  }
  
  /* Ensure all child elements don't overflow on mobile */
  .nbogu-outer * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .nbogu-table-container {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Hide table wrapper scroll on mobile */
  .nbogu-table-wrapper {
    overflow: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* League Header - Mobile Compact adjustments */
  .nbogu-league-header-row {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 8px !important;
    gap: 8px !important;
    border-radius: 8px 8px 0 0;
    margin-bottom: 6px !important;
  }
  
  .nbogu-league-info {
    width: 100%;
    justify-content: flex-start;
  }
  
  .nbogu-league-title {
    font-size: 12px !important;
  }
  
  .nbogu-league-logo-shield {
    width: 22px !important;
    height: 26px !important;
  }
  
  .nbogu-league-logo-shield svg {
    width: 22px !important;
    height: 26px !important;
  }
  
  .nbogu-header-right {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  
  .nbogu-cuoc-ngay-btn {
    font-size: 10px !important;
    padding: 5px 8px !important;
    flex: 0 0 auto;
  }
  
  .nbogu-header-logo {
    width: 36px !important;
    height: auto;
  }
  
  /* Hide table headers on mobile */
  .nbogu-odds-table thead {
    display: none;
  }
  
  /* Trong trận Header Mobile Compact */
  .nbogu-trong-tran-header {
    flex-direction: column !important;
    gap: 6px !important;
    padding: 6px 8px !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 6px !important;
  }
  
  .nbogu-trong-tran-left,
  .nbogu-trong-tran-right {
    width: 100% !important;
    justify-content: space-between !important;
    display: flex !important;
  }
  
  .nbogu-filter-btn {
    flex: 1 !important;
    max-width: 90px !important;
    font-size: 10px !important;
    padding: 4px 6px !important;
  }
  
  .nbogu-newbie-toggle {
    font-size: 10px !important;
  }
  
  /* Match Icons Mobile Compact */
  .nbogu-match-icons {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    gap: 4px !important;
    margin-top: 4px !important;
  }
  
  .nbogu-icon-btn,
  .nbogu-youtube-btn {
    width: 20px !important;
    height: 20px !important;
    padding: 3px !important;
    font-size: 10px !important;
  }
  
  /* HT Score Mobile Compact */
  .nbogu-ht-score {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 10px !important;
    margin-top: 3px !important;
    padding: 2px 5px !important;
  }
  
  /* Transform table to card layout */
  .nbogu-odds-table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    background: transparent !important;
    table-layout: auto !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  .nbogu-odds-table tbody {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  /* Mobile Compact Cards - Smaller size - Specific class to avoid conflicts */
  .nbogu-outer.nbogu-mobile-compact .nbogu-match-row,
  .nbogu-mobile-compact .nbogu-match-row,
  .nbogu-match-row {
    display: block !important;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
    padding: 8px 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.2s;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  .nbogu-match-row:active {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transform: translateY(1px);
  }
  
  /* Match Info Column - Full width on mobile - Compact */
  .nbogu-match-row td.col-match-info {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
    margin-bottom: 8px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #dbeafe !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  /* Odds cells - Different behavior */
  .nbogu-match-row td.odds-cell {
    display: inline-block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    vertical-align: top;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  /* Mobile Compact - Match Status */
  .nbogu-match-status {
    margin-bottom: 4px !important;
    display: flex;
    align-items: center;
    gap: 4px !important;
    flex-wrap: wrap;
  }
  
  .nbogu-live-dot {
    width: 5px !important;
    height: 5px !important;
  }
  
  .nbogu-live-label {
    font-size: 10px !important;
    font-weight: 600;
  }
  
  .nbogu-live-time-btn {
    font-size: 9px !important;
    padding: 2px 5px !important;
  }
  
  .nbogu-time-label {
    font-size: 10px !important;
    color: #1e40af;
    font-weight: 600;
  }
  
  /* Mobile Compact - Score */
  .nbogu-score {
    font-size: 16px !important;
    font-weight: 700;
    margin: 4px 0 !important;
    color: #1e3a8a;
    text-align: center;
  }
  
  /* Mobile Compact - Teams */
  .nbogu-teams {
    margin-top: 6px !important;
  }
  
  .nbogu-team-row {
    margin: 4px 0 !important;
    display: flex;
    align-items: center;
    gap: 6px !important;
  }
  
  .nbogu-team-logo {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
  }
  
  .nbogu-team-name {
    font-size: 11px !important;
    font-weight: 500;
    color: #1e40af;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  
  /* Market Group Labels - Mobile Compact */
  .nbogu-match-row td:nth-child(2)::before {
    content: "FT 1X2";
    display: block;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 4px !important;
    font-size: 11px !important;
    padding-bottom: 3px !important;
    border-bottom: 1px solid #e0f2fe;
    margin-top: 8px !important;
  }
  
  .nbogu-match-row td:nth-child(5)::before {
    content: "FT Cược chấp";
    display: block;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 4px !important;
    font-size: 11px !important;
    padding-bottom: 3px !important;
    border-bottom: 1px solid #e0f2fe;
    margin-top: 8px !important;
  }
  
  .nbogu-match-row td:nth-child(7)::before {
    content: "FT Tài/Xỉu";
    display: block;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 4px !important;
    font-size: 11px !important;
    padding-bottom: 3px !important;
    border-bottom: 1px solid #e0f2fe;
    margin-top: 8px !important;
  }
  
  /* FT 1X2 Market Group - 3 buttons in a row */
  .nbogu-match-row td:nth-child(2),
  .nbogu-match-row td:nth-child(3),
  .nbogu-match-row td:nth-child(4) {
    display: inline-block !important;
    width: calc(33.333% - 4px) !important;
    max-width: calc(33.333% - 4px) !important;
    margin-right: 4px !important;
    margin-left: 0 !important;
    vertical-align: top;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  .nbogu-match-row td:nth-child(2) {
    margin-top: 0;
    margin-left: 0 !important;
  }
  
  .nbogu-match-row td:nth-child(4) {
    margin-right: 0 !important;
  }
  
  /* FT Handicap Market Group - 2 buttons in a row */
  .nbogu-match-row td:nth-child(5),
  .nbogu-match-row td:nth-child(6) {
    display: inline-block !important;
    width: calc(50% - 2px) !important;
    max-width: calc(50% - 2px) !important;
    margin-right: 4px !important;
    margin-left: 0 !important;
    vertical-align: top;
    margin-top: 0;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  .nbogu-match-row td:nth-child(6) {
    margin-right: 0 !important;
  }
  
  /* FT Over/Under Market Group - 2 buttons in a row */
  .nbogu-match-row td:nth-child(7),
  .nbogu-match-row td:nth-child(8) {
    display: inline-block !important;
    width: calc(50% - 2px) !important;
    max-width: calc(50% - 2px) !important;
    margin-right: 4px !important;
    margin-left: 0 !important;
    vertical-align: top;
    margin-top: 0;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  .nbogu-match-row td:nth-child(8) {
    margin-right: 0 !important;
  }
  
  /* Odds buttons - Mobile Compact */
  .nbogu-match-row .odds-btn {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 3px !important;
    font-size: 11px !important;
    min-height: 38px !important;
    border-radius: 5px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  .nbogu-match-row .odds-btn .handicap,
  .nbogu-match-row .odds-btn .ou-line {
    font-size: 9px !important;
    opacity: 0.8;
    margin-bottom: 1px !important;
    display: block;
    line-height: 1.1 !important;
  }
  
  .nbogu-match-row .odds-btn:active {
    transform: scale(0.97);
    background: #bfdbfe;
  }
  
  .nbogu-match-row .odds-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  /* Mobile button spacing */
  .nbogu-more-matches {
    margin-top: 24px;
    margin-bottom: 20px;
    padding: 16px 0;
  }
  
  .nbogu-more-btn {
    width: calc(100% - 32px);
    max-width: 400px;
    margin: 0 auto;
    padding: 14px 24px;
    font-size: 14px;
  }
  
  /* 1H markets - Hide on mobile (but keep More Markets button) */
  .nbogu-match-row td:nth-child(9),
  .nbogu-match-row td:nth-child(10),
  .nbogu-match-row td:nth-child(11),
  .nbogu-match-row td:nth-child(12),
  .nbogu-match-row td:nth-child(13),
  .nbogu-match-row td:nth-child(14),
  .nbogu-match-row td:nth-child(15) {
    display: none !important;
  }
  
  /* More Markets Button on Mobile Compact */
  .nbogu-more-markets-cell {
    display: block !important;
    width: 100% !important;
    margin-top: 8px !important;
    text-align: center;
    padding-top: 8px !important;
    border-top: 1px solid #dbeafe !important;
  }
  
  .nbogu-more-markets-btn {
    width: auto !important;
    min-width: 100px !important;
    font-size: 11px !important;
    padding: 6px 12px !important;
  }
}

/* Performance optimizations */
.nbogu-odds-table * {
  box-sizing: border-box;
}

.nbogu-table-wrapper {
  will-change: scroll-position;
}

.nbogu-team-logo {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Xem thêm các trận khác button */
.nbogu-more-matches {
  text-align: center;
  margin-top: 32px;
  margin-bottom: 24px;
  padding: 20px 0;
}

.nbogu-more-btn {
  display: inline-block;
  background: #3b82f6;
  color: #ffffff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid #2563eb;
  cursor: pointer;
}

.nbogu-more-btn:hover {
  background: #2563eb;
  border-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  color: #ffffff;
}

.nbogu-more-btn:active {
  transform: translateY(0);
}
