@mixin tableStyles {
  border: none;
  border-radius: var(--table-border-radius);
  margin-bottom: var(--sportstake-table-margin-bottom, 4rem);
  font-weight: 400;
  table-layout: auto;
  @include link-color(var(--table-content-color, --color-6));
  display: block;
  padding-bottom: 2.4rem;

  * {
    box-sizing: var(--table-box-sizing, content-box);
  }

  thead,
  tbody {
    display: table;
    width: 100%;
    table-layout: auto;
    box-sizing: border-box;

    @include min(tablet) {
      table-layout: auto; 
    }
  }

  @include min(tablet) {
    width: 100%;
    display: table;
    padding-bottom: 0;
    box-shadow: var(--table-box-shadow, 0px 4px 6px -2px rgba(27, 27, 28, 0.02), 0px 12px 16px -4px rgba(27, 27, 28, 0.05));
  }

  thead,
  tbody {
    @include flex-direction(column);

    tr {
      border: var(--header-border);
      background-color: var(--table-background);
      box-shadow: 0px 4px 4px -2px rgba(27, 27, 28, 0.06), 0px 6px 8px -2px rgba(27, 27, 28, 0.08);
      margin-bottom: 1rem;

      th {
        color: var(--table-head-text);
        background: var(--table-head-background);
        border-right: var(--border-right-table-header, 2px solid var(--table-head-background));
        font-weight: 700;
        font-size: 1.4rem;
        text-align: left;

        &:first-child {
          border-top-left-radius: var(--table-border-radius);
        }

        &:last-child {
          border-top-right-radius: var(--table-border-radius);
        }

        a {
          color: white !important;
          text-decoration: underline;
        }
      }

      td {
        border: var(--border-table-content, none);
        font-size: 1.4rem;
        font-weight: 400;
        line-height: 4rem;

        a {
          text-decoration: underline;
          line-height: 2.7rem;
          font-weight: 500;

          img {
            width: 15rem;
          }
        }
      }

      &:last-child {
        td {
          &:last-child {
            border-bottom-right-radius: var(--table-border-radius);
          }
  
          &:first-child {
            border-bottom-left-radius: var(--table-border-radius);
          }
        }
      }

      @include min(tablet) {
        margin: 0;

        &:nth-child(even) {
          background-color: var(--table-highlight);
        }
      }
    }

    @include min(tablet) {
      display: table-header-group;
    }
  }

  td,
  th {
    padding: 4px 16px;
    line-height: 2.7rem;
    display: none;

    &.mobileOnly {
      @include flex-direction(column);

      &:nth-of-type(even) {
        background-color: var(--table-highlight);
      }
    }

    img {
      max-width: none;
    }

    @include min(tablet) {
      max-width: unset;
      display: table-cell;
      height: auto;

      &.mobileOnly {
        display: none;
      }
    }
  }
}

.tableWrapper {
  margin-bottom: 1rem;
  border-radius: var(--sportstake-table-border-radius, 1.6rem);  
  border: var(--sportstake-table-border-color, none);
  box-sizing: var(--box-sizing-templateTwo, content-box);
  @include overflow(overflow-x, auto, touch);

  &::-webkit-scrollbar {
    height: 0.6rem;
  }

  &::-webkit-scrollbar-thumb {
    border-radius: 2px;
    background-color: #515156;
    border-radius: 100px;
  }

  /* Track */
  &::-webkit-scrollbar-track {
    background: #e0e0e2;
    border-radius: 100px;
    opacity: 0.20000000298023224;
  }

  @include scrollbar(
    var(--scroll-height-1, 0.8rem),
    var(--scroll-height-2, 0.8rem),
    var(--color-100, #515156)
  );
}

.table {
  @include tableStyles;
}


.hideDesktopRow {
  @include min(mobile) {
    display: none;
  }
}

.home,
.away,
.draw,
.cancelled {
  display: inline-flex;
  align-items: center;
  color: var(--results-color, #ffffff);
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 3rem;
  max-height: 3rem;

  > span {
    margin-right: 1.2rem;
    white-space: nowrap;
  }
}

.home {
  background-color: var(--home-bg-color, #53a373);
  color: var(--home-text-color, var(--results-color, #ffffff));
}

.away {
  background-color: var(--away-bg-color, #295dd6);
  color: var(--away-text-color, var(--results-color, #ffffff));
}

.draw {
  background-color: var(--draw-bg-color, #ff6860);
  color: var(--away-text-color, var(--results-color, #ffffff));
  max-width: 15rem;
}

.cancelled {
  background-color: var(--cancelled-bg-color, #6e6e84);
  color: var(--away-text-color, var(--results-color, #ffffff));
  
  > span {
    padding: 0.4rem 0.8rem;
    @include flex-align(center, center);
    margin: 0;
  }
}

.circle {
  margin: 0 0.5rem;
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  @include flex-align(center, center);
  background-color: var(--icon-bg-color, #ffffff);
  color: var(--icon-text-color, #000000);
  font-weight: bolder;
}