/* All ETFs Table */

.amplify-all-etfs-table {
  overflow-x: auto;
}

/* Filter Container */
.amplify-all-etfs-table__filter-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.amplify-all-etfs-table__filter-label {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* Tabs */
.amplify-all-etfs-table__tabs {
  display: flex;
  gap: 10px;
}

.amplify-all-etfs-table__tab {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.amplify-all-etfs-table__tab:hover {
  background-color: #152F41 !important;
  color: #ffffff !important;
  border-color: #152F41 !important;
}

.amplify-all-etfs-table__tab.is-active {
  background-color: #152F41;
  color: #ffffff;
  border-color: #152F41;
  font-weight: 700;
}

.amplify-all-etfs-table__wrapper {
  width: 100%;
  overflow-x: auto;
}

.amplify-all-etfs-table__table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  table-layout: fixed;
}

/* Remove all borders */
.amplify-all-etfs-table__table,
.amplify-all-etfs-table__table th,
.amplify-all-etfs-table__table td {
  border: 0;
}

/* Header */
.amplify-all-etfs-table__table thead tr {
  background-color: #152F41;
  color: #ffffff;
}

.amplify-all-etfs-table__table thead th {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2em;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
}

/* Column widths */
.amplify-all-etfs-table__table thead th:nth-child(1),
.amplify-all-etfs-table__table tbody td:nth-child(1) {
  width: 10%;
}

.amplify-all-etfs-table__table thead th:nth-child(2),
.amplify-all-etfs-table__table tbody td:nth-child(2) {
  width: 34%;
}

.amplify-all-etfs-table__table thead th:nth-child(3),
.amplify-all-etfs-table__table tbody td:nth-child(3) {
  width: 11%;
}

.amplify-all-etfs-table__table thead th:nth-child(4),
.amplify-all-etfs-table__table tbody td:nth-child(4) {
  width: 14%;
}

.amplify-all-etfs-table__table thead th:nth-child(5),
.amplify-all-etfs-table__table tbody td:nth-child(5) {
  width: 13%;
}

.amplify-all-etfs-table__table thead th:nth-child(6),
.amplify-all-etfs-table__table tbody td:nth-child(6) {
  width: 9%;
}

.amplify-all-etfs-table__table thead th:nth-child(7),
.amplify-all-etfs-table__table tbody td:nth-child(7) {
  width: 9%;
}

/* Sort arrows */
.amplify-all-etfs-table__table thead th.is-sortable {
  position: relative;
  padding-right: 26px;
}

.amplify-all-etfs-table__table thead th.is-sortable::before,
.amplify-all-etfs-table__table thead th.is-sortable::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  opacity: 0.55;
}

/* Up triangle */
.amplify-all-etfs-table__table thead th.is-sortable::before {
  margin-top: -8px;
  border-bottom: 7px solid rgba(255, 255, 255, 0.9);
}

/* Down triangle */
.amplify-all-etfs-table__table thead th.is-sortable::after {
  margin-top: 2px;
  border-top: 7px solid rgba(255, 255, 255, 0.9);
}

.amplify-all-etfs-table__table thead th.is-sortable:hover::before,
.amplify-all-etfs-table__table thead th.is-sortable:hover::after {
  opacity: 0.8;
}

.amplify-all-etfs-table__table thead th.is-sorted.is-asc::before {
  opacity: 1;
}

.amplify-all-etfs-table__table thead th.is-sorted.is-asc::after {
  opacity: 0.25;
}

.amplify-all-etfs-table__table thead th.is-sorted.is-desc::before {
  opacity: 0.25;
}

.amplify-all-etfs-table__table thead th.is-sorted.is-desc::after {
  opacity: 1;
}

.amplify-all-etfs-table__table thead th.is-sortable:focus {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.amplify-all-etfs-table__table thead th.is-sortable:hover {
  background-color: #1a3a51;
}

.amplify-all-etfs-table__table thead th.is-sorted {
  background-color: #1d475f;
}

/* Rows */
.amplify-all-etfs-table__table tbody tr {
  border-bottom: 1px solid #A5A5A5;
}

/* Cells */
.amplify-all-etfs-table__table tbody td {
  padding: 15px 10px;
  background-color: #ffffff !important;
  font-size: 16px;
  line-height: 1.2em;
  vertical-align: middle;
}

/* Right align: NAV, Net Assets, Expense Ratio */
.amplify-all-etfs-table__table thead th:nth-child(3),
.amplify-all-etfs-table__table thead th:nth-child(4),
.amplify-all-etfs-table__table thead th:nth-child(5),
.amplify-all-etfs-table__table tbody td:nth-child(3),
.amplify-all-etfs-table__table tbody td:nth-child(4),
.amplify-all-etfs-table__table tbody td:nth-child(5) {
  text-align: right;
}

/* Center align: Fact Sheet and Prospectus */
.amplify-all-etfs-table__table thead th:nth-child(6),
.amplify-all-etfs-table__table thead th:nth-child(7),
.amplify-all-etfs-table__table tbody td:nth-child(6),
.amplify-all-etfs-table__table tbody td:nth-child(7) {
  text-align: center;
}

/* Expense ratio footnote superscript */
.amplify-all-etfs-table__expense-footnote {
  margin-left: 2px;
  font-size: 0.7em;
  font-weight: 300;
  line-height: 0;
  vertical-align: super;
  top: 0;
}

/* Expense Ratio header tooltip — matches the Distributions / Fund Details
   table tooltip (instant CSS tooltip, outline icon, #152F41 popup box). Two
   necessary adaptations: the icon is white because it sits on the dark navy
   header (a #152F41 icon would be invisible there), and it opens downward
   (top: 140%) because an upward tooltip from the top header row would be
   clipped by the table wrapper's overflow. */
.amplify-all-etfs-table .tooltip-container {
  position: relative;
  display: inline-block;
  margin-left: 4px;
}

.amplify-all-etfs-table .tooltip-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 12px;
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  font-style: normal;
  color: #ffffff;
  background-color: transparent;
  border: 1px solid #ffffff;
  cursor: help;
  border-radius: 50%;
  vertical-align: middle;
}

.amplify-all-etfs-table .tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: max-content;
  max-width: 260px;
  background-color: #152F41;
  color: #ffffff;
  text-align: left;
  border-radius: 6px;
  padding: 10px 12px;
  position: absolute;
  z-index: 1000;
  top: 140%;
  right: 0;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 300;
  transition: opacity 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.amplify-all-etfs-table .tooltip-text::after {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #152F41 transparent;
}

.amplify-all-etfs-table .tooltip-container:hover .tooltip-text,
.amplify-all-etfs-table .tooltip-container:focus-within .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Links in cells */
.amplify-all-etfs-table__table tbody td a {
  color: #2D65E2;
  text-decoration: none;
  font-weight: 400;
}

.amplify-all-etfs-table__table tbody td a:hover {
  text-decoration: underline;
}

/* Icon spacing */
.amplify-all-etfs-table__table tbody td a i {
  margin-right: 4px;
  font-size: 20px;
}

@media screen and (max-width: 767px) {
  /* Tabs wrap on narrow screens */
  .amplify-all-etfs-table__tabs {
    flex-wrap: wrap;
  }

  .amplify-all-etfs-table__tab {
    padding: 10px 16px;
    font-size: 14px;
  }

  /* Kill the overflow-scroll table; use stacked cards instead */
  .amplify-all-etfs-table__wrapper {
    overflow-x: visible;
  }

  .amplify-all-etfs-table__table {
    table-layout: auto;
  }

  .amplify-all-etfs-table__table thead {
    display: none;
  }

  /* Each row becomes a card */
  .amplify-all-etfs-table__table tbody tr {
    display: block;
    border-bottom: 2px solid #152F41;
    margin-bottom: 8px;
    padding: 4px 0;
  }

  /* Each cell is a label + value row */
  .amplify-all-etfs-table__table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    font-size: 14px;
    border-bottom: 1px solid #efefef;
    text-align: right;
    width: auto;
  }

  .amplify-all-etfs-table__table tbody td:last-child {
    border-bottom: none;
  }

  /* Column label injected via data-label */
  .amplify-all-etfs-table__table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #444;
    font-size: 13px;
    text-align: left;
    flex: 0 0 auto;
    margin-right: 12px;
  }

  /* Override fixed width rules for all nth-child columns */
  .amplify-all-etfs-table__table tbody td:nth-child(1),
  .amplify-all-etfs-table__table tbody td:nth-child(2),
  .amplify-all-etfs-table__table tbody td:nth-child(3),
  .amplify-all-etfs-table__table tbody td:nth-child(4),
  .amplify-all-etfs-table__table tbody td:nth-child(5),
  .amplify-all-etfs-table__table tbody td:nth-child(6),
  .amplify-all-etfs-table__table tbody td:nth-child(7) {
    width: auto;
    text-align: right;
  }

  /* Fact Sheet / Prospectus icon cells */
  .amplify-all-etfs-table__table tbody td:nth-child(6),
  .amplify-all-etfs-table__table tbody td:nth-child(7) {
    text-align: right;
  }

  /* Ticker + Fund Name links left-align their value */
  .amplify-all-etfs-table__table tbody td:nth-child(1) a,
  .amplify-all-etfs-table__table tbody td:nth-child(2) a {
    text-align: right;
  }
}
