:root {
  --bg-color: #fafafa;
  --text-color: #333333;
  --title-color: #333333;
  
  --col-border-color: #d5d5d5;
  --col-bg-color: #ffffff;

  --input-bg-color: #ffffff;
  --input-color: #0f172a;
  --input-border-color: #d5d5d5;
  --btn-input-hover-color: #efefef;
  
  --btn-bg-color: #ffffff;
  --btn-border-color: #d5d5d5;
  --btn-color: #0f172a;

  --table-border-color: #d5d5d5;
  --table-bg-color: #ffffff;
  --table-th-bg-color: #fcfcfc;
  
  --col-border-radius: 3px;
  --input-btn-border-radius: 3px;
}

[theme="dark"] {
  --bg-color: #26292e;
  --text-color: #eaebeb;
  --title-color: ##eaebeb;
  
  --col-border-color: #3f4147;
  --col-bg-color: #2b2f36;

  --input-color: #eaebeb;
  --input-bg-color: #313334;
  --input-border-color: #3f4147;
  --btn-input-hover-color: #3f4147;
  
  --btn-bg-color: #313334;
  --btn-color: #eaebeb;
  --btn-border-color: #3f4147;

  --table-border-color: #3f4147;
  --table-bg-color: #313334;
  --table-th-bg-color: #313334;
}

/* Page and title */

html,
body,
.app {
  color: var(--text-color);
  padding: 0;
  margin: 0;
  width: 100%;
  min-height: 100vh;
  font-family: "Open Sans", sans-serif;
}

.app {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background-color: var(--bg-color);
}

.title {
  margin: 0 auto;
  text-align: center;
}

#title .col {
  flex-direction: row;
  width: 100%;
}

#title h2 {
  display: flex;
  justify-content: center;
  align-items: center;
}

h1, h2, h3 {
  color: var(--title-color);
}

h2 {
  margin: 0;
}

a {
  all: unset;
}

p {
  margin: 0;
}

/* Big screen */

@media (min-width: 1400px) {
  .menu.active {
    display: none;
  }

  .menu-toggle {
    display: none;
  }

  .row {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  .form-freq,
  .form-serv {
    width: 30%;
  }

  .form-note {
    width: 40%;
  }

  .col {
    padding: 10px;
  }

  .col:nth-last-child(n+2) {
    margin-right: 20px;
  }

  .table-container {
    display: flex;
  }

  #rr {
    box-sizing: border-box;
    width: 40%;
  }

  #tnrbf {
    box-sizing: border-box;
    width: 60%;
  }

  .rr-table {
    display: none;
  }

  #legend-table {
    width: 40%;
  }

  .reco-data-table {
    max-width: 90%;
  }

  #fr-footnotes-table th:nth-child(3),
  #fr-footnotes-table td:nth-child(3) {
    width: 10%;
  }
}

/* Normal screen */

@media (min-width: 1080px) and (max-width: 1400px) {
  .menu.active {
    display: none;
  }

  .menu-toggle {
    display: none;
  }

  #tables {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    justify-content: space-between;
    flex-direction: column;
  }

  #forms {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    justify-content: space-between;
  }

  .form-freq,
  .form-serv {
    width: 30%;
  }

  .form-note {
    width: 40%;
  }

  .col {
    padding: 10px;
  }

  .row {
    margin-bottom: 20px;
  }

  #forms .col:nth-last-child(n+2) {
    margin-right: 20px;
  }

  #tables .col:nth-last-child(n+2) {
    margin-bottom: 20px;
  }

  .table-container {
    display: flex;
  }

  .rr-table {
    display: none;
  }

  #legend-table {
    margin-top: 20px;
  }

  .reco-data-table {
    max-width: 90%;
  }

  #fr-footnotes-table th:nth-child(3),
  #fr-footnotes-table td:nth-child(3) {
    width: 15%;
  }
}

/* Little screen or window */

@media (min-width: 600px) and (max-width: 1080px) {
  .app {
    padding: 15px;
  }

  .menu.active {
    display: none;
  }

  .menu-toggle {
    display: none;
  }

  .col {
    padding: 10px;
    margin-bottom: 20px;
  }

  #rr-container {
    display: flex;
  }

  .table {
    margin-bottom: 10px;
  }

  .rr-table {
    display: none;
  }

  .reco-data-table {
    max-width: 95%;
  }

  #fr-footnotes-table th:nth-child(3),
  #fr-footnotes-table td:nth-child(3) {
    width: 25%;
  }
}

/* Phone */

@media (max-width: 600px) {
  .app {
    padding: 5px;
  }

  .menu.active {
    display: flex;
  }

  .menu-toggle {
      display: block;
  }

  .col.form {
    display: none;
  }

  .col {
    margin-bottom: 20px;
  }

  .col {
    padding: 10px 5px;
  }

  .rr-table:nth-last-child(n+2), .tnrbf-table:nth-last-child(n+2) {
    margin-bottom: 10px;
  }

  .rr-table-compact {
    display: none;
  }

  .reco-data-table {
    max-width: 100%;
  }
}

/* Form */

.col.form.form-active {
  display: flex;
}

.input-container {
  margin-bottom: 5px;
}

.radio-input-container {
  display: flex;
  flex-direction: column;
}

.radio-input {
  display: flex;
  align-items: center;
}

.freq-input-container {
  display: flex;
}

.freq-input-container input {
  width: 75px;
}

.note-input-container {
  display: flex;
  flex-direction: column;
}

.service-input-container {
  display: flex;
}

.checkbox-input-container {
  display: flex;
}

.checkbox-input-container > div {
  width: 50%;
}

.freq-input:nth-last-child(n+2), .service-input:nth-last-child(n+2) {
  margin-right: 20px;
}

.checkbox-input {
  margin-bottom: 15px;
}

.label, label{
  margin-bottom: 3px;
  font-size: small;
  font-weight: bold;
}

.label input[type="radio"] {
  margin: 0 10px 0 0;
  height: 100%;
}

.label, .form-serv label {
  margin-right: 10px;
}

textarea {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  resize: vertical;
}

select, input, textarea {
  padding: 3px;
  border: 1px solid var(--input-border-color);
  border-radius: var(--input-btn-border-radius);
  background-color: var(--input-bg-color);
  color: var(--input-color);
}

input, textarea {
  outline: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

.checkbox-container {
  display: flex;
  justify-content: space-between;
}

/* Column and line */

.col {
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: self-start;
  border: 1px solid var(--col-border-color);
  box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.1);
  border-radius: var(--col-border-radius);
  background-color: var(--col-bg-color);
}

.col-title {
  text-align: center;
  margin: 0 0 15px 0;
}

.col-footnotes-table, #freq-list {
  width: 100%;
}

.col-footnotes-table td:first-child {
  font-weight: bold;
}

.minimize {
  position: absolute;
  top: 3px;
  right: 0;
  font-size: 20px;
  padding: 0px 8px;
  cursor: pointer;
  user-select: none;
}

/* Table general */

table {
  width: 100%;
  border-collapse: collapse;
}

.tr-row-hz td {
  border-bottom-color: black;
}

th,
td {
  box-sizing: border-box;
  padding: 4px;
  background-color: var(--table-bg-color);
  font-size: 12px;
  border-spacing: 0;
}

.td-bottom-grey {
  border-bottom: 1px solid var(--table-border-color);
}

.td-bottom-black {
  border-bottom: 1px solid black;
}

.td-bottom-white {
  border-bottom: 1px solid var(--table-bg-color);
}

.td-top-black {
  border-top: 1px solid black;  
}

.td-top-grey {
  border-top: 1px solid var(--table-border-color);  
}

.col-footnotes-table th, .col-footnotes-table td,
.empty-table th, .empty-table td {
  border: 1px solid var(--table-border-color);
}

.col-footnotes-table > div > th:first-child, .col-footnotes-table > div > td:first-child {
  width: 7.5%;
  text-align: center;
}

th:hover,
td:hover {
  /* filter: brightness(95%); */
  background-color: var(--btn-input-hover-color);
}

th {
  height: 20px;
  background-color: var(--table-th-bg-color);
}

.empty-cell {
  color: rgba(0, 0, 0, 0);
  user-select: none;
}

/* RR and TNRBF */

.rr-table td:nth-child(2), .rr-table th:nth-child(2) {
  width: 15%;
}

.rr-table th, .rr-table-compact th, .tnrbf-table th {
  border-top: 1px solid var(--table-border-color);
  border-left: 1px solid var(--table-border-color);
  border-right: 1px solid var(--table-border-color);
}

.rr-table td, .rr-table-compact td, .tnrbf-table td {
  border-left: 1px solid var(--table-border-color);
  border-right: 1px solid var(--table-border-color);
}

.rr-table tbody tr:last-child, .rr-table-compact tbody tr:last-child, 
.tnrbf-table tbody tr:last-child {
  border-bottom: 1px solid var(--table-border-color);
}

.rr-table-compact td:not(:last-child) {
  text-align: center;
}

.rr-table-compact td:first-child {
  border-left: 1px solid var(--table-border-color);
  border-right: none;
}

.rr-table-compact td:nth-last-child(2) {
  border-right: 1px solid var(--table-border-color);
}

.rr-table-compact td:last-child {
  border-right: 1px solid var(--table-border-color);
}

.tnrbf-table-note {
  cursor: pointer;
}

/* Show title attribute as tooltip on hover */
*[mouseOver]:hover::before {
  content: attr(mouseOver);
  position: absolute;
  z-index: 1;
  background: #000;
  color: #fff;
  padding: 0.2em 0.5em;
  border-radius: 0.25em;
  white-space: nowrap;
  opacity: 0.8;
  font-size: 0.8em;
}

/* Footnote and recommendation table */

#itu-footnotes-table td:nth-child(1) {
  font-size: 14px;
  font-weight: bold;
}

/* Recommendation table */

.reco-desc {
  font-weight: bold;
  font-size: 13px;
}

.reco-data-table {
  width: auto;
  margin-top: 10px;
}

.reco-data-table th, .reco-data-table td:first-child {
  padding: 5px;
}

.reco-data-table td:not(:first-child) {
  text-align: center;
}

.reco-data-container:nth-last-child(n+2) {
  margin-bottom: 15px;
}

.reco-data-tab-title {
  margin-top: 10px;
  text-align: center;
  font-weight: bold;
  font-size: 13px;
}

.reco-data-tab-text {
  margin-top: 10px;
}

.reco-data-note {
  margin-top: 15px;
}

.reco-data-note > div {
  margin-top: 5px;
}

.reco-data-text {
  margin-bottom: 5px;
}

#recommandations-table > table > tbody > tr > td:first-child {
  padding: 0;
}

#recommandations-table > table > tbody > tr > td:first-child a {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 100%;
}

#recommandations-table > table > tbody > tr > td:first-child div {
  box-sizing: border-box;
  padding: 4px;
  width: 100%;
  height: 100%;
}

.hbar {
  width: 70%;
  margin: 10px auto;
  border-color: var(--table-border-color);
}

td table {
  display: block;
  margin: 0 auto;
}

.reco-table-container {
  display: flex;
  justify-content: center;
}

/* Frequency bands and button */

#search-by-band {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.freq-band-btn {
  box-sizing: border-box;
  font-size: 12px;
  padding: 5px;
  margin: 0 10px 10px 0;
  border: 1px solid var(--btn-border-color);
  border-radius: var(--input-btn-border-radius);
  background-color: var(--btn-bg-color);
  text-align: center;
  cursor: pointer;
}

#fr-footnotes-table .freq-band-btn {
  padding: 2px;
  width: 100%;
  margin: 0;
}

#fr-footnotes-table .freq-band-btn:not(:last-child) {
  margin: 0 0 2px 0;
}

button, input[type="submit"] {
  padding: 8px;
  margin: 0 auto 0 auto;
  border: 1px solid var(--btn-border-color);
  border-radius: var(--input-btn-border-radius);
  background-color: var(--btn-bg-color);
  color: var(--btn-color);
  cursor: pointer;
}


button:hover, .freq-band-btn:hover, input:focus, textarea:focus , input[type="submit"]:hover {
  background-color: var(--btn-input-hover-color);
}

.form-submit-container {
  display: flex;
}

/* Legend */

.legend-accr {
  font-weight: bold;
}

.legend-desc::first-letter {
  text-transform: capitalize;
}

/* TNRBF button for frise and table */

#tnrbf-button {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

#tnrbf-button button {
  margin: 0;
}

#tnrbf-button button:first-child {
  margin-right: 10px;
}

/* Menu */

nav {
  background-color: #333;
  color: #fff;
  padding: 10px;
  border-radius: var(--col-border-radius);
}

.menu-toggle {
  padding-bottom: 4px;
  font-size: 30px;
  cursor: pointer;
  user-select: none;
}

.menu {
  z-index: 1;
  display: none;
  justify-content: space-around;
  margin-left: 5px;
  flex-direction: column;
  background-color: var(--bg-color);
  position: absolute;
  top: 75px;
  width: 80%;
  left: 0;
  padding: 0;
  user-select: none;
  border: 1px solid var(--col-border-color);
  box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.1);
  border-radius: var(--col-border-radius);
  background-color: var(--col-bg-color);
  color: var(--text-color);
}

.menu-list {
  padding: 10px;
}

.menu-list-item {
  padding: 10px;
  cursor: pointer;
}

.menu-list-item:hover {
  background-color: var(--btn-input-hover-color);
}

.menu-list-item:first-child {
  border-top-left-radius: var(--input-btn-border-radius);
  border-top-right-radius: var(--input-btn-border-radius);
}

.menu-list-item:last-child {
  border-bottom-left-radius: var(--input-btn-border-radius);
  border-bottom-right-radius: var(--input-btn-border-radius);
}

.menu-list-item.menu-list-item-active {
  background-color: var(--btn-input-hover-color);
}

.menu-list-item:not(:last-child) {
  border-bottom: 1px solid black;
}