:root {
  --primary-color: #2C3E50; /* Dark Blue */
  --secondary-color: #2C3E50; /* Teal */
  --accent-color: #2C3E50; /* Red */
  --background-color: #ECF0F1; /* Light Gray */
  --text-color: #2C3E50; /* Dark Blue */
  --header-footer-background: #343A40; /* Collapse color */
  --button-background: #007bff; /* AdminLTE button color */
  --button-hover-background: #0056b3; /* AdminLTE button hover color */
  --button-active-background: #004085; /* AdminLTE button active color */
  --checked-border-color: #28A745; /* Green color */
  --checked-background-color: rgba(40, 167, 69, 0.2); /* Green background color */
  --input-background: #ffffff; /* AdminLTE input background color */
  --input-border-color: #ced4da; /* AdminLTE input border color */
  --shadow-color: rgba(0, 0, 0, 0.2); /* AdminLTE shadow color */
  --border-radius: 5px; /* AdminLTE border radius */
  --highlight-color: #FFC107; /* Orange color */
  --dark-gray: #343a40; /* AdminLTE dark gray color */
  --placeholder-color: #6c757d; /* AdminLTE placeholder color */
  --red-color: #DC3545; /* Red color */
}


/* Global settings */
body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
}

/* Header */
header {
  background-color: var(--header-footer-background);
  color: #fff;
  padding: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px var(--shadow-color);
}

/* Header content */
.header-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  text-align: center;
}

h1 {
  text-align: center;
  color: #fff;
  margin: 0;
  font-size: 24px;
}

#counters {
  text-align: right;
}

#counters p {
  margin: 0;
  font-size: 14px;
}

#messageInput, #sendButton, #saveButton {
  display: block;
  margin: 10px auto;
  padding: 10px;
  font-size: 16px;
  background-color: #3c8dbc;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

#messageInput, #sendButton, #saveButton:hover {
  background-color: #367fa9;
}

#saveButton {
  display: block;
  margin: 20px auto;
  padding: 12px 20px;
  font-size: 16px;
  background-color: var(--secondary-color);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

#saveButton:hover {
  background-color: var(--primary-color);
}

#messages {
  list-style-type: none;
  padding: 0;
}

#messages li {
  background-color: #fff;
  margin: 5px 0;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.block {
  background-color: var(--card-bg);
  margin: 5px auto;
  padding: 5px;
  width: 90%;
  box-shadow: 0 4px 10px var(--card-shadow);
  border-radius: 8px;
}

.sub-block {
  border: 1px solid #ddd;
  margin: 2px 0;
  padding: 4px;
  background-color: var(--card-bg);
  border-radius: 4px;
}

.sub-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: bold;
}

.hidden {
  display: none !important;
}

.label-input-container {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
  gap: 2px;
}

.label-input-container.hidden {
  display: none !important;
}

.label-input-container label {
  margin-right: 10px;
  font-weight: bold;
}

.resolution-select {
  margin-left: 10px;
  padding: 5px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.changed {
  background-color: #ffeb3b !important;
}

.changed select {
  border: 2px solid #ffeb3b !important;
}

/* Add this rule to style select elements with the "changed" class */
select.changed {
  border: 2px solid #ffeb3b !important;
  background-color: #ffeb3b !important;
}

/* NEW: Style for LUT select when changed */
.lut-select.changed {
  border: 2px solid #ffeb3b !important;
  background-color: #ffeb3b !important;
}

.lut-select.changed:hover {
  opacity: 0.8;
  cursor: pointer;
}

/* New styles to improve inputs and selects design */
.form-control {
  background-color: var(--input-background);
  border: 1px solid var(--input-border-color);
  border-radius: var(--border-radius);
  padding: 5px 10px;
  font-size: 16px;
  margin-bottom: 1px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
  border-color: var(--button-hover-background);
  box-shadow: 0 0 7px var(--shadow-color);
  outline: none;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: var(--accent-color);
  color: #000;
  padding: 10px 20px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1000;
  font-weight: bold;
}

.changed:hover {
  opacity: 0.8;
  cursor: pointer; /* Visual hint that element is interactive */
}

/* Buttons */
.btn, button {


  margin-bottom: 5px; /* Reduce margin */
  background-color: var(--secondary-color);
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 8px; /* Reduce padding */
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  font-size: 0.9em; /* Adjust font size */
}

.btn:hover, button:hover {
  background-color: var(--button-hover-background);
}

.btn:active, button:active {
  background-color: var(--button-active-background);
  color: var(--highlight-color); /* Selected button text color */
}

/* Updated Tables Style for Professional Look */
table {
  width: 100%;
  margin: 20px auto;
  border-collapse: collapse;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table thead {
  background-color: var(--secondary-color);
  color: #fff;
}

table th, table td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

table tr:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Floating save button – updated to use CSS variables */
.floating-save {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background-color: var(--button-background); /* use variable */
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Global Modal Styles */
.modal {
  display: none; /* hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}
.modal-content {
  background-color: #fefefe;
  margin: 5vh auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80vw;
  height: 80vh;
  overflow: auto;
}
.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  cursor: pointer;
}
.close-modal:hover,
.close-modal:focus {
  color: black;
}

/* NEW: Global options container styles */
.global-options-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 15px;
  margin: 10px 0;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.global-options-container label {
  margin-right: 5px;
  font-weight: bold;
}
.global-options-container select,
.global-options-container button {
  margin-right: 15px;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: #fff;
}

/* NEW: Extra field container styles */
#extraFieldContainer {
  position: fixed;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: #f9f9f9;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#extraInputField {
  width: 200px;
  padding: 5px;
}

/* New color classes for different result types */
.sync-uhd {
  background-color: #ffcccc; /* soft red */
}

.sync-hd {
  background-color: #ccffcc; /* soft green */
}

.conv-uhd-lut-off {
  background-color: #ccccff; /* soft blue */
}

.conv-uhd-lut-hdr-sdr {
  background-color: #ffcc99; /* light orange */
}

.conv-uhd-lut-sdr-hdr {
  background-color: #ffffcc; /* soft yellow */
}

.conv-hd-lut-off {
  background-color: #ffeb3b; /* yellow */
}

.conv-hd-lut-hdr-sdr {
  background-color: #ff9800; /* orange */
}

.conv-hd-lut-sdr-hdr {
  background-color: #ff5722; /* deep orange */
}

/* New color classes for different result types */
.sync-uhd, .conv-uhd {
  background-color: #ffcccc; /* soft red */
}

.conv-hd-p, .lut-sdr-hdr {
  background-color: #b3e5fc; /* light blue */
}

.conv-hd-i, .lut-hdr-sdr {
  background-color: #b2dfdb; /* light teal */
}

/* New color classes for HD progressive and interlaced */
.conv-hd-p {
  background-color: #b3e5fc; /* light blue */
}

.conv-hd-i {
  background-color: #b2dfdb; /* light teal */
}

/* New styles for the right side menu */
.right-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background-color: var(--header-footer-background) !important;
  border-left: 2px solid #ccc;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  overflow-y: auto;
  transition: transform 0.3s ease;
  transform: translateX(100%);
  color: #fff; /* Added for readability */
}

/* Force links inside right menu to be white */
.right-menu a {
  color: #fff;
}

/* When open, slide the menu into view */
.right-menu.open {
  transform: translateX(0);
}

/* New rule for stacked global options */
#globalAdditionalControl .option {
  display: block;
  margin-bottom: 10px;
}

/* NEW: Styles for the left side menu matching the right menu style */
.left-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  background-color: var(--header-footer-background) !important;
  border-right: 2px solid #ccc;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  overflow-y: auto;
  transition: transform 0.3s ease;
  transform: translateX(-100%);
  color: #fff; /* Added for readability */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) #2C3E50;
}

/* Force links inside left menu to be white */
.left-menu a {
  color: #fff;
}

.left-menu.open {
  transform: translateX(0);
}

/* Custom scrollbar styling for the left side menu */
.left-menu::-webkit-scrollbar {
  width: 8px;
}
.left-menu::-webkit-scrollbar-track {
  background: #2C3E50; /* Matches the left menu background */
}
.left-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}
.left-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* NEW: Home button inside left menu */
.menu-home {
  margin-bottom: 15px;
}
.home-button {
  margin-bottom: 5px; /* Reduce margin */
  background-color: var(--secondary-color);
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 8px; /* Reduce padding */
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  font-size: 0.9em; /* Adjust font size */
}
.home-button:hover {
  background-color: var(--button-hover-background);
}



/* NEW: Global style for clear inputs button to match device button design */
.clear-input-btn {
  padding: 10px 20px;
  background-color: var(--button-background);
  border: none;
  border-radius: var(--border-radius);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.clear-input-btn:hover {
  background-color: var(--button-hover-background);
}

/* NEW: Uniform menu control buttons */
.menu-btn {
  width: 40px;
  height: 40px;
  font-size: 20px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-button {
    width: 100%;
    margin-bottom: 5px; /* Reduce margin */
    background-color: var(--secondary-color);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    padding: 8px; /* Reduce padding */
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-size: 0.9em; /* Adjust font size */
  }

/* Replace descendant selector with element selector */
.device-button.active {
  color: var(--highlight-color); /* Orange text for active button */
}

.device-button.active:hover {
  background-color: var(--button-hover-background);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.device-button:hover {
  background-color: var(--button-hover-background);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

#searchModal a {
  color: #fff; /* Set text color to white */
  text-decoration: none; /* Remove underline */
}

#searchModal a:hover {
  color: #ccc; /* Optional: Slightly lighter color on hover */
}