@import url('colors.css');

body {
  background-color: #f0f0f0;
  font-family: Oxanium, sans-serif;
  color: var(--text-color);
  padding: 20px;
}


.ui-autocomplete {
  font-family: inherit;
  font-size: inherit;
  font-weight: 550;

}

.ui-menu-item {
  font-family: inherit;
  font-size: inherit;
  font-weight: 550;
}

.topMenu {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 70%;
  margin: auto;
}

.topMenu h1 {
  margin: 0;
  flex-shrink: 0;
}

.topMenuRight {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

/* Shared button & input styles */
.topMenu input#calendar,
.topMenu button.goTodayBtn,
.topMenu button.infoBtn {
  height: 40px;
  font-size: 16px;
  font-family: inherit;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 1px;
  background-color: white;
  color: #222;
  cursor: pointer;
  box-shadow: 0 0 3px var(--shadow-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
  width: 200px;
}

.topMenu input#calendar:focus,
.topMenu button.goTodayBtn:hover,
.topMenu button.goTodayBtn:focus,
.topMenu button.infoBtn:hover,
.topMenu button.infoBtn:focus {
  /* border-color: #008c9e; */
  background-color: #e0f7fa;
  outline: none;
}

@media (max-width: 768px) {
  .topMenu {
    width: 100%;
    align-items: flex-start;
  }

  .topMenuRight {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .topMenu button.infoBtn,
  .topMenu button.goTodayBtn,
  .topMenu input#calendar {
    font-size: 14px;
    height: 36px;
    padding: 6px 10px;
    width: 100%;
    max-width: 220px;
  }
}



.transparent-bg {
  --bs-table-bg: transparent !important;
}

.searchDiv {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-direction: row;
  margin-top: 30px;
  width: 70%;
  margin-left: auto;
  margin-right: auto;
  gap: 10px;
}


.searchField {
  width: 60%;
  height: 70px;
  font-size: x-large;
  font-weight: 400;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 3px var(--shadow-color);
  border-radius: 1px;
  padding: 8px 12px;
  background-color: var(--bg-cont-white);
  /* position: relative; */
}

.searchInputWrapper {
  display: flex;
  flex: 1;           
  height: 70px;
  margin: 0;
}

.playerSearchLabel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background-color: var(--bg-cont-white);
  border: 1px solid var(--border-color);
  border-right: none;
  box-shadow: 0 0 3px var(--shadow-color);
  font-size: x-large;
  font-weight: 500;
  color: #007c91;
  border-radius: 4px 0 0 4px;
}

.searchInputWrapper .searchField {
  width: 100%;
  border-left: none;
  border-radius: 0 4px 4px 0;
}

.searchInputWrapper:focus-within .playerSearchLabel {
  border-color: var(--border-color);
  box-shadow:
    0 -4px 4px var(--shadow-color),
    /* top */
    -4px 0 4px var(--shadow-color),
    /* left */
    0 4px 4px var(--shadow-color);
  /* bottom */
  outline: none;
}

.searchField:focus {
  outline: none;
  border-color: var(--border-color);
  /* glow only on top, right, bottom (no left) */
  box-shadow:
    0 -4px 8px var(--shadow-color),
    /* top */
    4px 0 8px var(--shadow-color),
    /* right */
    0 4px 8px var(--shadow-color);
  /* bottom */
}


.showResultsBtn {
  flex-shrink: 0;  
  height: 70px;
  font-size: large;
  font-weight: 400;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 3px var(--shadow-color);
  border-radius: 4px;
  padding: 8px 20px;
  background-color: var(--shadow-color);
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.showResultsBtn:hover {
  background-color: var(--btn-hover-color);
}

/* Active (pressed) state style */
.showResultsBtn.active {
  background-color: white;
  border-color: var(--border-color);
  box-shadow: 0 0 3px var(--shadow-color);
  color: var(--shadow-color);
}

.showResultsBtn.active:hover {
  background-color: var(--btn-act-hover-color);
}

.infoContainer {
  display: flex;
  flex-direction: column;
  gap: 0px;
  font-size: large;
  padding: 12px 20px;
  background-color: var(--bg-cont-white);
  border: 1px solid var(--border-color);
  box-shadow: 0 0 3px var(--shadow-color);
  border-radius: 1px;
  width: 40%;
  max-width: 600px;
  margin: 20px auto 0 auto;
  box-sizing: border-box;
}

.playerContainer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: var(--bg-cont-white);
  border: 1px solid var(--border-color);
  box-shadow: 0 0 3px var(--shadow-color);
  border-radius: 1px;
  width: 40%;
  max-width: 600px;
  margin: 20px auto 0 auto;
  box-sizing: border-box;
}

.playerPhoto {
  width: 150px;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  /* prevent shrinking */
}

.playerDetails {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* reduced gap from 12px */
  padding-left: 8px;
  /* reduced padding */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  box-sizing: border-box;
  /* include padding in width */
  flex-grow: 1;
  /* fill remaining space */
  min-width: 0;
  /* fix flex overflow issue */
}

.playerDetails p,
.playerDetails h4 {
  padding: 2px 12px;
  /* reduced horizontal padding from 30px to 12px */
  margin: 0;
  line-height: 1.4;
  word-wrap: break-word;
  /* break long words */
  overflow-wrap: break-word;
}

.playerDetails h4 {
  font-family: Oxanium, sans-serif;
  font-weight: 600;
}

.playerDetails table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  /* prevents table overflow */
}

.playerDetails th,
.playerDetails td {
  padding: 4px 12px;
  /* reduced from 2px 30px */
  text-align: center;
  color: #555;
  white-space: nowrap;
  /* prevent wrapping in cells */
  overflow: hidden;
  text-overflow: ellipsis;
  /* show ... for overflow */
}

.playerDetails th {
  font-weight: 600;
  color: #222;
  font-family: Oxanium, sans-serif;
  font-size: larger;
}


.unfilledRow {
  border: 10px solid var(--border-color);
  color: rgba(128, 128, 128, 0.373);
  font-weight: 600;
  box-shadow: 0 0 3px var(--shadow-color);
}

.filledRow {
  border: 10px solid var(--border-color);
  color: #ffffff4d;
  box-shadow: 0 0 10px var(--shadow-color);
  background-color: var(--bg-cont-white);
}

.playerIDRow {
  border: 10px solid var(--border-color);
  color: #ffffff4d;
  box-shadow: 0 0 5px var(--shadow-color);
  background-color: var(--bg-cont-white);
}

.tableDiv {
  display: flex;
  justify-content: center;
}

.tableDiv table {
  width: 70%;
}

.playersTable {
  border-collapse: separate;
  border-spacing: 0 12px;
}

.footer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.footer .row {
  width: 70%;
}

.hideOnDesktop th {
  width: calc(100% / 6);
  text-align: center;
}

@media (min-width: 769px) {
  .hideOnDesktop {
    display: none;
  }

  
  /* .showResultsBtn {
    position: absolute;
    right: 18%;
  } */
}

@media (max-width: 1156px) {
  .playerContainer {
    flex-direction: column;
    width: 100%;
    align-items: center;
  }

  .infoContainer {
    flex-direction: column;
    width: 100%;
    /* align-items: center; */
  }

  .playerPhoto {
    width: 80%;
    max-width: 160px;
  }

  .playerDetails {
    padding-left: 0;
    padding-top: 10px;
    align-items: center;
    text-align: center;
  }

  .playerDetails table {
    font-size: 14px;
  }

  .playerDetails th,
  .playerDetails td {
    padding: 4px 12px;
  }
}


/* Responsive design for mobile */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .hideOnMobile {
    display: none;
  }

  .tableDiv table {
    width: 100%;
  }

  .searchDiv {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
    margin: 0 auto;
  }


  .searchField,
  .showResultsBtn {
    width: 100%;
    height: 56px;
    font-size: 18px;
  }

  .searchInputWrapper {
    flex-direction: row;
    width: 100%;
    height: 56px;
  }

  .playerSearchLabel {
    font-size: 18px;
    padding: 0 12px;
  }

  .searchInputWrapper .searchField {
    font-size: 18px;
  }

  .playerContainer {
    flex-direction: column;
    width: 100%;
    align-items: center;
  }

  .playerPhoto {
    width: 80%;
    max-width: 160px;
  }

  .playerDetails {
    padding-left: 0;
    padding-top: 10px;
    align-items: center;
    text-align: center;
  }

  .playerDetails table {
    font-size: 14px;
  }

  .playerDetails th,
  .playerDetails td {
    padding: 4px 12px;
  }

  .playersTable thead {
    font-size: 12px;
  }

  .playersTable td,
  .playersTable th {
    padding: 6px;
    font-size: 13px;
  }

  .footer .row {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .RowCell {
    padding: 8px;
    text-align: center;
  }

  .nameCellMobile {
    display: block;
    /* font-weight: bold; */
    font-size: 1rem;
    margin-bottom: 6px;
  }

  .RowData {
    display: flex;
    flex-wrap: nowrap;
    /* NO wrap */
    justify-content: center;
    gap: 8px;
  }

  .RowData span {
    width: calc(100% / 6);
    text-align: center;
  }

  .RowData span {
    flex: 1 1 auto;
    /* allow shrinking & growing */
    min-width: 0;
    /* remove forced min width */
    text-align: center;
    font-size: 0.9rem;
    white-space: nowrap;
    /* prevent text wrap inside each item */
  }
}


/* SPECIAL CLASSES FOR PLAYER ID */

.triesDiv {
  display: flex;
  gap: 15px;
  /* space between inputs */
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  /* top margin + center horizontally */
  width: 70%;
  /* keep or adjust as needed */
}


.triesField {
  flex: 1;
  /* proportional sizing */
  max-width: 300px;
  /* prevent being too wide */
  height: 40px;
  font-size: large;
  font-weight: 400;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 3px var(--shadow-color);
  border-radius: 4px;
  padding: 8px 12px;
  background-color: var(--bg-cont-white);
  text-align: center;
}

.triesField:disabled {
  background-color: var(--bg-cont-white);
  /* slightly gray for disabled */
  color: #555;
  cursor: not-allowed;
}

.correctTriesField:disabled {
  background-color: #a7ffbc !important;
  /* light green */
  color: #155724;
  /* dark green text */
}

.wrongTriesField:disabled {
  background-color: #f6b3b9 !important;
  /* light red/pink */
  color: #60171e;
  /* dark red text */
}


/* Mobile responsiveness */
@media (max-width: 600px) {
  .triesDiv {
    flex-direction: column;
    align-items: center;
  }

  .triesField {
    max-width: 100%;
    width: 90%;
  }
}