/* display-csv.css */
/* MBaggett; baggett.michael@gmail.com */

html {
    background-color: #2d2d2d;
    font-family: 'Open Sans', Helvetica, Arial, sans-serif;
    color: white;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
  }

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
    margin: 0;
    padding: 0 0 2rem 0;
}

.welcome {
    max-width: 1200px;
    margin: 0 auto 1.5rem auto;
    padding: 0 clamp(0.75rem, 2.2vw, 2rem);
}
 

h1 {
    margin: 1rem 0 1rem 0;
}

ul {
    margin-bottom: 2rem;
  }

  a.btn {
    padding: 0 .2rem;
    border-radius: 4px;
    text-decoration: none;
  }

  a.btn:hover {
    color: white;
    background-color: #336699;
  }

  a.btn:active {
    color: orange;
    background-color: red;
  }

  a {
    color: #F4D03F;
  }
  
  a:hover {
    color: #5DADE2;
  }
  
  a:active {
    color: red;
  }
  
  pre {
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    background: black;
    padding: 1rem;
    box-shadow: white 0 0 2px 2px;
    border-radius: 4px;
  }
  
  .body-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    gap: 0;
  }

  #csvTable, #csvTableAlt1 {
    width: 100%;
    max-width: 100%; /* Ensure the table does not exceed the container width */
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto; /* Explicitly allow automatic table layout */
    border-radius: 4px;
    overflow: hidden;
}

#csvTable tr:first-child th:first-child,
#csvTableAlt1 tr:first-child th:first-child {
  border-top-left-radius: 4px;
}

#csvTable tr:first-child th:last-child,
#csvTableAlt1 tr:first-child th:last-child {
  border-top-right-radius: 4px;
}

#csvTable tr:last-child td:first-child,
#csvTableAlt1 tr:last-child td:first-child {
  border-bottom-left-radius: 4px;
}

#csvTable tr:last-child td:last-child,
#csvTableAlt1 tr:last-child td:last-child {
  border-bottom-right-radius: 4px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 4px;
    margin: 0 0 1rem 0;;
}

.table-container a {
 text-decoration: none!important;
}

.table-container a:link {
 color: #336699;
 padding: .2rem;
 border-radius: 4px;
}

.table-container a:hover {
 color: #000;
 background-color: #F4D03F;
 padding: .2rem;
}

.table-container a:active {
 color: #F4D03F;
 background-color: red;
 padding: .2rem;
}

th {
    background-color: #336699;
    color: white;
   }

tr:nth-child(even) {
    background-color: lightgray;
    color: black;
}

tr:nth-child(odd) {
    background-color: white;
    color: 
    
    black;
}

td, th {
  padding: .5rem; /* Keep your padding */
  text-align: left; /* Align text to the left */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
}

p {
  margin: .25rem 0;
}

#csvTable.table-mobile,
#csvTableAlt1.table-mobile {
  border-collapse: separate;
  border-spacing: 0;
}

#csvTable.table-mobile tr,
#csvTableAlt1.table-mobile tr {
  display: block;
}

#csvTable.table-mobile tr:first-child,
#csvTableAlt1.table-mobile tr:first-child {
  display: none;
}

#csvTable.table-mobile tr:not(:first-child),
#csvTableAlt1.table-mobile tr:not(:first-child) {
  margin: 0 0 1px 0;
  padding: 0.35rem 0.3rem 0.6rem;
  border-bottom: 2px solid #000;
}

#csvTable.table-mobile td,
#csvTableAlt1.table-mobile td {
  display: flex;
  flex-direction: row;
  gap: 0.55rem;
  align-items: start;
  padding: 0 0.35rem;
  line-height: 1.35;
  border: 0;
  background: transparent;
}

#csvTable.table-mobile td::before,
#csvTableAlt1.table-mobile td::before {
  content: attr(data-label);
  font-weight: 700;
  color: #000;
  flex: 0 0 min(8rem, 40%);
  max-width: min(8rem, 40%);
  line-height: 1.35;
}

#csvTable.table-mobile td .cell-value,
#csvTableAlt1.table-mobile td .cell-value {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#csvTable.table-mobile td .cell-value .btn,
#csvTableAlt1.table-mobile td .cell-value .btn {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #336699;
  font-size: inherit;
  line-height: inherit;
  text-decoration: underline;
}

#csvTable.table-mobile td .cell-value .btn:hover,
#csvTableAlt1.table-mobile td .cell-value .btn:hover {
  color: #000;
  background-color: #F4D03F;
}

#csvTable.table-mobile td .cell-value .btn:active,
#csvTableAlt1.table-mobile td .cell-value .btn:active {
  background-color: red;
  color: #F4D03F;
}

@media screen and (max-width: 900px) {
  .welcome {
    margin-top: 0.75rem;
    margin-bottom: 1.75rem;
    padding: 0 0.75rem;
  }

  .welcome h1 {
    margin: 1rem 0 0.75rem 0;
    font-size: clamp(1.35rem, 5vw, 1.9rem);
    line-height: 1.2;
  }

  p,
  li {
    line-height: 1.45;
  }

  td,
  th {
    padding: 0.45rem;
    font-size: 0.9rem;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  a.btn {
    display: inline-block;
    font-size: 0.88rem;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  pre {
    padding: 0.75rem;
    font-size: 0.85rem;
  }

  #csvTable.table-mobile,
  #csvTableAlt1.table-mobile {
    border-collapse: separate;
    border-spacing: 0;
  }

  #csvTable.table-mobile tr,
  #csvTableAlt1.table-mobile tr {
    display: block;
  }

  #csvTable.table-mobile tr:first-child,
  #csvTableAlt1.table-mobile tr:first-child {
    display: none;
  }

  #csvTable.table-mobile tr:not(:first-child),
  #csvTableAlt1.table-mobile tr:not(:first-child) {
    margin: 0 0 1px 0;
    padding: 0.35rem 0.3rem 0.6rem;
    border-bottom: 2px solid #000;
  }

  #csvTable.table-mobile td,
  #csvTableAlt1.table-mobile td {
    display: flex;
    flex-direction: row;
    gap: 0.55rem;
    align-items: start;
    padding: 0 0.35rem;
    line-height: 1.35;
    border: 0;
    background: transparent;
  }

  #csvTable.table-mobile td::before,
  #csvTableAlt1.table-mobile td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #000;
    flex: 0 0 min(8rem, 40%);
    max-width: min(8rem, 40%);
    line-height: 1.35;
  }

  #csvTable.table-mobile td .cell-value,
  #csvTableAlt1.table-mobile td .cell-value {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Make linked values (email/website/phone) match non-link cell text in mobile rows */
  #csvTable.table-mobile td .cell-value .btn,
  #csvTableAlt1.table-mobile td .cell-value .btn {
    display: inline;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #336699;
    font-size: inherit;
    line-height: inherit;
    text-decoration: underline;
  }

  #csvTable.table-mobile td .cell-value .btn:hover,
  #csvTableAlt1.table-mobile td .cell-value .btn:hover {
    color: #000;
    background-color: #F4D03F;
  }

  #csvTable.table-mobile td .cell-value .btn:active,
  #csvTableAlt1.table-mobile td .cell-value .btn:active {
    background-color: red;
    color: #F4D03F;
  }
}

@media screen and (max-width: 560px) {
  .welcome {
    padding: 0 0.5rem;
  }

  td,
  th {
    padding: 0.4rem;
    font-size: 0.84rem;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .table-container {
    overflow-x: visible;
  }
}
