body { font-family: Arial, sans-serif; margin: 20px; }

#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #eee;
  padding: 10px 20px;
  font-size: 14px;
}

#top-bar .left-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

#top-bar .middle-info {
    position: absolute;
    left: 50%;
    transform: translateX(-50%); /* Center it exactly at 50% */
    white-space: nowrap; /* Prevent wrap if needed */
}

#top-bar #domainSelect .label {
  font-weight: bold;
  color: #333;
}

#top-bar #primaryClockLeader {
  margin-right: 350px;
}

#top-bar #domainSelect {
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background: #f0f0f0;
}

#top-bar .right-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

#top-bar .icon {
  font-size: 18px;
}



#controllerTabs {
    display: block; 
    width: 100%;
    border-bottom: 1px solid #ccc;
    background-color: #eee;
}

#controllerTabs .tab {
    width: 200px;
    padding: 12px 20px;
    border: 1px solid #ccc;
    border-bottom: none;
    background-color: #ddd;
    color: black;
    font-size: 1em;
    text-align: center;
    cursor: pointer;
    outline: none;
}

#controllerTabs .tab:not(:last-child) {
  border-right: none; /* No double border between buttons */
}

#controllerTabs .tab.active {
  background-color: white;
}

#controllerTabs .tab:hover {
    background-color: white;
}

#Containers .container {margin-top: 20px;}
#Containers .hidden {display: none;}

#matrixContainer table {
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.8em;
}

#matrixContainer th, #matrixContainer td {
  border: 1px solid #ccc;
}

#matrixContainer th {
  background-color: #f0f0f0;
}

#matrixContainer .rx-header {
  white-space: nowrap;     /* Prevents text wrapping */
  width: max-content;      /* Adjusts width to fit content */
  position: sticky;
  left: 0;
  z-index: 3;
}

#matrixContainer tr:nth-child(1) th,
#matrixContainer tr:nth-child(1) td {
  position: sticky;
  top: 0;
  z-index: 4;
}

#matrixContainer tr:nth-child(2) th,
#matrixContainer tr:nth-child(2) td {
  position: sticky;
  top: 48px;  /* adjust this to your first row's height */
  z-index: 3;
}

#matrixContainer .matrix-cell {
  min-width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  text-align: center;
  vertical-align: middle;
  box-sizing: border-box;
  font-size: 1.5em;
}

/* RX Channel Styles */
#matrixContainer .sub-ok {
  background-color: #22BA22;
  cursor: pointer;
  color: white;
}

#matrixContainer .sub-transition {
    background-color: #ddd;
    cursor: pointer;
}

#matrixContainer .sub-error {
    background-color: white;
    cursor: pointer;
    color: white;
}

#matrixContainer .updating {
    background-color: #ddd;    
}

#matrixContainer .updating::after {
  content: '⌛';
  font-size: 0.8em;
}

#matrixContainer .incompatible {
  background-color: #f0f0f0;
  cursor: not-allowed;
}

#matrixContainer .sub-none {
    cursor: pointer;
}

#matrixContainer .tx-header {
  font-weight: bold;
  background-color: #eef;
  text-align: center;
  vertical-align: top;
  position: sticky;
  top: 0;
  z-index: 3;
}

#matrixContainer .vertical-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: left;
  display: inline-block;
  margin-top:10px;
  white-space: nowrap;
}

.tx-header .icon,
.tx-header .vertical-text {
  display: block;          /* stack vertically */
}

.icon-img {
    width:16px;
}

#matrixContainer .rx-header {
  font-weight: bold;
  background-color: #eef;
  text-align: left;
}

#matrixContainer .rx-header span {
  display: inline-block;
  margin-right: 10px;
}

#matrixContainer .rx-name {
  font-size: 0.7em;
  color: #333;
}

#matrixContainer .matrix-cell.highlight {
  background-color: #6AC8C8;
}

#matrixContainer .rename-input {
  font-size: 1em;
}

#matrixContainer .rename-actions {
  display: inline;
  margin-left: 5px;
}

#matrixContainer .rename-actions button {
  font-size: 0.6em;
  margin-left: 2px;
}

.controllerTable table {
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.8em;
  width: 100%;
  text-align: left;
  border: 1px solid #ddd;
}

.controllerTable th,
.controllerTable td {
  padding: 12px 15px;
  border: 1px solid #ddd;
}

.controllerTable thead th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.controllerTable tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.controllerTable tbody tr:hover {
  background-color: #f1f1f1;
}

.controllerTable .device-offline {
  color: #aaa; /* light grey text */
}

.controllerTable .green-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: green;
}

.controllerTable .red-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: red;
}


.controllerTable .bold {
    font-weight: bold;
}
