/* General */

* {
  box-sizing: border-box;
}

html {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

body {
  margin: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

select,
input {
  font-size: 20px;
}

img {
  user-select: none;
}

/*
  Main page
*/

#headerFamDiv {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;

  text-align: center;
  background-color: #f4343c;
  color: #ffffff;
}

#headerFamDiv div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#famLogoImg,
#camLogoImg {
  width: 150px;
  min-width: 150px;
}

#titleContainer {
  padding: 20px;
  padding-bottom: 0;
}

#FAMtitle {
  font-family: Open Sans, sans-serif;
  font-weight: 800;
  font-size: 36px;
  margin: 0;
}

#compDataDivSup,
#compDataDivInf {
  color: white;
  padding: 10px;
  text-align: center;
}

#compDataDivSup {
  background-image: linear-gradient(to bottom, #f4343c, #e4222a);
}

#compDataDivInf {
  background-image: linear-gradient(to bottom, #e4222a, #aa0000);
  border-radius: 0px 0px 20px 20px;

  position: -webkit-sticky; /* For Safari */
  position: sticky;
  top: 0;
}

#compTitle {
  font-size: 25px;
  margin: 0;
}

#compPlace,
#compEvent,
#compMedals,
#compPoints {
  font-size: 20px;
  font-weight: normal;
  margin: 0;
}

#bannerDiv {
  display: flex;
  justify-content: center;
}

#scheduleDiv,
#pointsDiv,
#medalsDiv,
#mainDiv {
  text-align: center;
  margin: 20px;
  padding: 10px;
}

#scheduleA:hover,
#pointsA:hover,
#medalsA:hover,
#mainA:hover {
  background-color: #aaaaaa;
  background-image: none;
}

#scheduleA,
#pointsA,
#medalsA,
#mainA {
  text-decoration: none;
  background-image: linear-gradient(to left, #dddddd, #bbbbbb);
  border-radius: 999px;
  box-shadow: #bbbbbb 0 10px 20px -10px;
  color: #000000;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  line-height: 24px;
  opacity: 1;
  outline: 0 solid transparent;
  padding: 8px 18px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  width: fit-content;
  word-break: break-word;
  border: 0;
}

.photofinishAholder {
  padding: 0;
}

.photofinishA {
  text-decoration: none;
  background-color: rgb(0, 140, 255);
  color: white;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  display: inline-flex;
  align-items: end;
  padding: 5px;
  border-radius: 0 0 10px 0;
}

.photofinishA:hover {
  background-color: rgb(66, 170, 255);
  background-image: none;
}

.photofinishA:after {
  content: ""; /* No content, use background image */
  background-image: url("ext_link_icon.png");
  background-size: cover;
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
}

#eventsTableDiv {
  justify-content: center;
  display: flex;
  width: 100%;
  padding-left: 30px;
  padding-right: 30px;
}

#eventsTable {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 300px;
}

#eventsTable tr {
  border: none;
}

#eventsTable tr:nth-child(even) {
  background-color: #ffffff;
}

#eventsTable tr:nth-child(odd) {
  background-color: #dddddd;
}

#eventsTable tr:first-child,
#eventsTable tr:last-child {
  background-image: linear-gradient(to left, #aa0000, #ff0000);
  color: #ffffff;
}

#eventsTable th {
  padding: 5px;
}

#eventsTable td {
  padding: 0;
}

#eventsTable tr:first-child th:last-child,
#eventsTable tr:first-child td:last-child {
  border-top-right-radius: 10px;
}

#eventsTable tr:last-child th:last-child,
#eventsTable tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

#eventsTable a {
  text-align: left;
  display: block;
  width: 100%;
  height: 100%;
  padding: 5px 10px;
}

#eventsTable td:nth-child(1) a {
  text-align: center;
  font-size: large;
}

#eventsTable td:nth-child(1) a small {
  text-align: center;
  font-weight: lighter;
  font-size: small;
}

#eventsTable td:nth-child(2) a {
  font-weight: bold;
}

#eventsTable td:nth-child(3) a {
  text-align: center;
}

#footerFiv {
  margin-top: 50px;
  display: flex;
  justify-content: center;
}

#copyP {
  width: 100%;
  color: #999999;
  text-align: right;
  padding: 5px;
  font-size: 16px;
}

/*
  Results page
*/

#optionsDiv {
  justify-content: center;
  display: flex;
  width: 100%;
  padding-left: 30px;
  padding-right: 30px;
  margin-bottom: 50px;
  position: -webkit-sticky;
  position: sticky;
  top: 50px;
}

#optionsDivExpandButton {
  background-image: linear-gradient(to left, #0041aa, #0062ff);
  color: white;
  border: none;
  border-radius: 10px;
  justify-content: center;
  align-items: center;
}

#optionsDivExpandButton:hover {
  cursor: pointer;
  background-image: none;
  background-color: #0041aa;
}

#optionsDivExpandButton > img {
  height: 40px;
  width: 40px;
}

.display-none {
  opacity: 0;
  pointer-events: none; /* Ensure the element is not interactive while invisible */
}

.display-block {
  opacity: 1;
  pointer-events: auto; /* Restore interactivity */
}

#optionsTable {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 25%;
  text-align: center;
  z-index: 999;
}

#optionsTable tr {
  background-color: #ffffff;
}

#optionsTable tr:first-child,
#optionsTable tr:last-child {
  background-image: linear-gradient(to left, #0041aa, #0062ff);
  color: #ffffff;
}

#optionsTable th,
#optionsTable td {
  padding: 5px;
}

#optionsTable tr:first-child th:last-child,
#optionsTable tr:first-child td:last-child {
  border-top-right-radius: 10px;
}

#optionsTable tr:last-child th:last-child,
#optionsTable tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

.recordsTableDiv {
  overflow-x: auto;
  margin-left: 30px;
  margin-right: 30px;
  margin-bottom: 50px;
  justify-content: center;
  display: flex;
}

.recordsTable {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 25%;
  text-align: center;
}

.recordsTable tr:nth-child(odd) {
  background-color: #dddddd;
}

.recordsTable tr:nth-child(even) {
  background-color: #ffffff;
}

.recordsTable tr:first-child,
.recordsTable tr:last-child {
  background-image: linear-gradient(to left, #168300, #1db100);
  color: #ffffff;
}

.recordsTable th,
.recordsTable td {
  padding: 5px;
}

.recordsTable tr:first-child th:last-child,
.recordsTable tr:first-child td:last-child {
  border-top-right-radius: 10px;
}

.recordsTable tr:last-child th:last-child,
.recordsTable tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

.recordsTable td:nth-child(1) {
  width: 50px;
  font-weight: bold;
}

.recordsTable td:nth-child(2) {
  width: 300px;
}

.recordsTable td:nth-child(3) {
  width: 200px;
}

.recordsTable td:nth-child(4) {
  width: 150px;
}

.recordsTable td:nth-child(5) {
  width: 100px;
}

.recordsTable td:nth-child(6) {
  width: 100px;
  font-weight: bold;
}

.resultsTableDiv {
  overflow-x: auto;
  margin-left: 30px;
  margin-right: 30px;
  margin-bottom: 50px;
  display: block;
}

.resultsTable {
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
}

.resultsTable tr:nth-child(odd) {
  background-color: #ffffff;
}

.resultsTable tr:nth-child(even) {
  background-color: #dddddd;
}

.resultsTable tr:first-child {
  background-color: #000000;
  color: #ffffff;
}

.resultsTable tr:nth-child(2),
.resultsTable tr:last-child {
  background-image: linear-gradient(to left, #aa0000, #ff0000);
  color: #ffffff;
}

.resultsTable th,
.resultsTable td {
  padding: 5px;
}

.resultsTable tr:nth-child(2) th:last-child,
.resultsTable tr:first-child th:last-child,
.resultsTable tr:nth-child(2) td:last-child {
  border-top-right-radius: 10px;
}

.resultsTable tr:last-child th:last-child,
.resultsTable tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

.resultsTable button {
  text-decoration: none;
  background-image: linear-gradient(to left, #dddddd, #bbbbbb);
  border-radius: 999px;
  box-shadow: #bbbbbb 0 10px 20px -10px;
  color: #000000;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  line-height: 24px;
  opacity: 1;
  outline: 0 solid transparent;
  padding: 8px 18px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  width: fit-content;
  word-break: break-word;
  border: 0;
}

.resultsTable button:hover {
  cursor: pointer;
  background-color: #aaaaaa;
  background-image: none;
}

.resultsTable td:nth-child(8) {
  font-weight: bold;
}

.resultsTable td:nth-child(1),
.resultsTable th:nth-child(1) {
  width: 50px;
}

.resultsTable td:nth-child(2),
.resultsTable th:nth-child(2) {
  width: 50px;
}

.resultsTable td:nth-child(3),
.resultsTable th:nth-child(3) {
  width: 50px;
}

.resultsTable td:nth-child(4),
.resultsTable th:nth-child(4) {
  width: 300px;
}

.resultsTable td:nth-child(5),
.resultsTable th:nth-child(5) {
  width: 200px;
}

.resultsTable td:nth-child(6),
.resultsTable th:nth-child(6) {
  width: 100px;
}

.resultsTable td:nth-child(7),
.resultsTable th:nth-child(7) {
  width: 100px;
}

.resultsTable td:nth-child(8),
.resultsTable th:nth-child(8) {
  width: 100px;
}

.resultsTable td:nth-child(9),
.resultsTable th:nth-child(9) {
  width: 50px;
}

.resultsTable td:nth-child(10),
.resultsTable th:nth-child(10) {
  width: 100px;
}

.resultsTable td:nth-child(n + 11),
.resultsTable th:nth-child(n + 11) {
  min-width: 50px;
}

.resultsTable td:last-child,
.resultsTable th:last-child {
  width: 10px;
}

.rankingTableDiv {
  overflow-x: auto;
  margin-left: 30px;
  margin-right: 30px;
  margin-bottom: 50px;
  display: flex;
  justify-content: center;
}

.rankingTable {
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
}

.rankingTable tr:nth-child(odd) {
  background-color: #ffffff;
}

.rankingTable tr:nth-child(even) {
  background-color: #dddddd;
}

.rankingTable tr:first-child {
  background-color: #000000;
  color: #ffffff;
}

.rankingTable tr:nth-child(2),
.rankingTable tr:last-child {
  background-image: linear-gradient(to left, #aa0000, #ff0000);
  color: #ffffff;
}

.rankingTable th,
.rankingTable td {
  padding: 5px;
}

.rankingTable tr:nth-child(2) th:last-child,
.rankingTable tr:first-child th:last-child,
.rankingTable tr:nth-child(2) td:last-child {
  border-top-right-radius: 10px;
}

.rankingTable tr:last-child th:last-child,
.rankingTable tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

.rankingTable td:nth-child(4) {
  font-weight: bold;
}

.rankingTable td:nth-child(1),
.rankingTable th:nth-child(1) {
  width: 50px;
}

.rankingTable td:nth-child(2),
.rankingTable th:nth-child(2) {
  width: 300px;
}

.rankingTable td:nth-child(3),
.rankingTable th:nth-child(3) {
  width: 200px;
}

.rankingTable td:nth-child(4),
.rankingTable th:nth-child(4) {
  width: 100px;
}

.rankingTable td:nth-child(5),
.rankingTable th:nth-child(5) {
  width: 50px;
}

.rankingTable td:nth-child(6),
.rankingTable th:nth-child(6) {
  width: 10px;
}

.rankingTable small {
  font-weight: normal;
}

/*
  Points Page
*/

.pointsTableDiv {
  overflow-x: auto;
  margin-left: 30px;
  margin-right: 30px;
  margin-bottom: 50px;
  display: block;
}

.pointsTable {
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
}

.pointsTable tr {
  border: 1px solid #dddddd;
}

.pointsTable tr:nth-child(odd) {
  background-color: #ffffff;
}

.pointsTable tr:nth-child(even) {
  background-color: #eeeeee;
}

.pointsTable tr:first-child {
  background-color: #000000;
  color: #ffffff;
}

.pointsTable tr:nth-child(2),
.pointsTable tr:last-child {
  background-image: linear-gradient(to left, #aa0000, #ff0000);
  color: #ffffff;
}

.pointsTable th,
.pointsTable td {
  padding: 5px;
}

.pointsTable tr:nth-child(2) th:last-child,
.pointsTable tr:first-child th:last-child,
.pointsTable tr:nth-child(2) td:last-child {
  border-top-right-radius: 10px;
}

.pointsTable tr:last-child th:last-child,
.pointsTable tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

/*Column widths*/

.pointsTable td:nth-child(1),
.pointsTable th:nth-child(1) {
  width: 300px;
}

.pointsTable td:nth-child(2),
.pointsTable th:nth-child(2) {
  width: 75px;
}

.pointsTable td:nth-child(3),
.pointsTable th:nth-child(3) {
  width: 75px;
}

.pointsTable td:nth-child(n + 4),
.pointsTable th:nth-child(n + 4) {
  width: 100px;
}

.pointsTable td:last-child,
.pointsTable th:last-child {
  width: 10px;
}

.pointsTable td:nth-child(3) {
  font-weight: bold;
}

/*
  Medals Page
*/

.medalsTableDiv {
  overflow-x: auto;
  margin-left: 30px;
  margin-right: 30px;
  margin-bottom: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.medalsTable {
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
}

.medalsTable tr {
  border: 1px solid #dddddd;
}

.medalsTable tr:nth-child(odd) {
  background-color: #ffffff;
}

.medalsTable tr:nth-child(even) {
  background-color: #eeeeee;
}

.medalsTable tr:first-child {
  background-color: #000000;
  color: #ffffff;
}

.medalsTable tr:nth-child(2),
.medalsTable tr:last-child {
  background-image: linear-gradient(to left, #aa0000, #ff0000);
  color: #ffffff;
}

.medalsTable th,
.medalsTable td {
  padding: 5px;
}

.medalsTable tr:nth-child(2) th:last-child,
.medalsTable tr:first-child th:last-child,
.medalsTable tr:nth-child(2) td:last-child {
  border-top-right-radius: 10px;
}

.medalsTable tr:last-child th:last-child,
.medalsTable tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

/*Column widths*/

.medalsTable td:nth-child(1),
.medalsTable th:nth-child(1) {
  width: 50px;
}

.medalsTable td:nth-child(2),
.medalsTable th:nth-child(2) {
  width: 50px;
}

.medalsTable td:nth-child(3),
.medalsTable th:nth-child(3) {
  width: 300px;
}

.medalsTable td:nth-child(4),
.medalsTable th:nth-child(4) {
  width: 200px;
}

.medalsTable td:nth-child(5),
.medalsTable th:nth-child(5) {
  width: 100px;
}

.medalHolder {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  user-select: none;
}

.medalGold {
  width: 30px;
  height: 30px;
  background-image: linear-gradient(to left, #ffc107, #ffeb3b);
  color: #9d5e00;
  border-radius: 0px 15px 15px 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  vertical-align: middle;
}

.medalSilver {
  width: 30px;
  height: 30px;
  background-color: silver;
  background-image: linear-gradient(to left, #959595, #d8d8d8);
  color: #525252;
  border-radius: 0px 15px 15px 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  vertical-align: middle;
}

.medalBronze {
  width: 30px;
  height: 30px;
  background-color: brown;
  background-image: linear-gradient(to left, #b4725a, #ef8e6a);
  color: #854229;
  border-radius: 0px 15px 15px 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  vertical-align: middle;
}

/* Design for mobile phone first*/

/* Design for PC after*/

@media only screen and (max-width: 800px) {
  #headerFamDiv {
    flex-wrap: wrap;
    padding: 10px;
  }

  #imgLogoFamDiv {
    order: 1;
    width: 50%;
  }

  #imgLogoCamDiv {
    order: 2;
    width: 50%;
  }

  #titleContainer {
    order: 3;
    width: 100%;
  }

  #famLogoImg,
  #camLogoImg {
    width: 100px;
    min-width: unset;
  }

  #FAMtitle {
    font-size: 25px;
  }

  #compDataDivSup > h3,
  #compDataDivSup > h2 {
    font-size: 20px;
  }

  #compDataDivInf > h3,
  #compDataDivInf > h2 {
    font-size: 20px;
  }

  #eventsTable {
    min-width: unset;
  }

  .recordsTableDiv {
    display: block;
  }

  .resultsTableDiv {
    margin-left: 10px;
    margin-right: 10px;
  }

  .rankingTableDiv {
    display: block;
  }

  .medalsTableDiv {
    display: block;
  }
}
