/* --------------------------
   Body
-------------------------- */
body {
  font-family: Arial, sans-serif;
  background: transparent;
  height: 100vh;
  margin: 0;
  overflow: hidden; /* prevents whole page scroll */
}
body.dark {
  color: #ddd;
}

/* --------------------------
   Window
-------------------------- */
.window {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  min-width: 370px;
  max-width: 90vw;
  min-height: 100px;
  max-height: 90vh;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;

  display: flex;
  flex-direction: column; /* titlebar + content container */
  overflow: hidden; /* hides window overflow */
  resize: both;
}

.window.dark {
  background: rgba(51, 51, 51, 0.95);
}

/* --------------------------
   Titlebar
-------------------------- */
.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #4a90e2;
  color: white;
  padding: 0.3em 0.6em; /* smaller padding */
  font-size: 0.9em;
  font-weight: bold;
  cursor: move;
  user-select: none;
}

.close-btn,
.settings-btn {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 4px;
}

/* --------------------------
   Content container (scrollable)
-------------------------- */
.content-container {
  flex: 1 1 auto; /* take remaining window height */
  overflow: hidden; /* enable scrolling */
  padding: 0.5em;
  display: flex;
  justify-content: center; /* centers content horizontally */
  align-items: flex-start; /* align top vertically */
  flex-direction: column;
  /* hide scrollbars */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
  height: 100%;
}

.content-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

/* --------------------------
   Actual content
-------------------------- */
.content {
  display: flex;
  flex-direction: column;
  gap: 1em;
  width: 100%;
}
.window,
.content-container,
.content {
  transform: translateZ(0);
  backface-visibility: hidden;
}
body,
.window,
.content {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* --------------------------
   Settings panel (scrollable)
-------------------------- */
#settings-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto; /* scroll vertically if needed */
  overflow-x: hidden; /* prevent horizontal overflow */
  padding: 10px;
  scrollbar-gutter: stable;
}
#settings-panel > * {
  flex-shrink: 0; /* prevent items from shrinking too much horizontally */
  min-width: 0; /* allow flex items to respect container width */
  width: 100%; /* let inputs/buttons grow with container */
}

#settings-panel.dark {
  background: #333;
  color: #ddd;
}
#settings-panel label {
  display: block;
  margin: 4px 0;
}
.content-container,
#settings-panel {
  scrollbar-width: thin; /* makes it slimmer */
  scrollbar-color: #999 #f0f0f0; /* thumb color | track color */
}

body.dark .content-container,
body.dark #settings-panel {
  scrollbar-color: #666 #222; /* darker thumb | darker track */
}

/* Chrome, Edge, Safari */
.content-container::-webkit-scrollbar,
#settings-panel::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.content-container::-webkit-scrollbar-track,
#settings-panel::-webkit-scrollbar-track {
  background: #f0f0f0;
}

body.dark .content-container::-webkit-scrollbar-track,
body.dark #settings-panel::-webkit-scrollbar-track {
  background: #222;
}

.content-container::-webkit-scrollbar-thumb,
#settings-panel::-webkit-scrollbar-thumb {
  background: #999;
  border-radius: 4px;
}

body.dark .content-container::-webkit-scrollbar-thumb,
body.dark #settings-panel::-webkit-scrollbar-thumb {
  background: #666;
}

.content-container::-webkit-scrollbar-thumb:hover,
#settings-panel::-webkit-scrollbar-thumb:hover {
  background: #777;
}

body.dark .content-container::-webkit-scrollbar-thumb:hover,
body.dark #settings-panel::-webkit-scrollbar-thumb:hover {
  background: #888;
}
/* --------------------------
   Table
-------------------------- */
.table-container {
  overflow-x: auto; /* horizontal scroll if table too wide */
  max-width: 100%;
}

table {
  width: 100%;
  table-layout: fixed; /* evenly distribute columns */
  border-collapse: collapse;
}

th,
td {
  padding: 0.3em 0.4em;
  font-size: 0.9em;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------
   Buttons and selects
-------------------------- */
.button-style,
.select-style {
  width: 100%;
  padding: 0.5em;
  margin-bottom: 0.5em;
  border: none;
  border-radius: 6px;
  background-color: #1e88e5;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.9em;
}

.button-style:hover {
  background-color: #1565c0;
}

.window.dark .button-style {
  background-color: #42a5f5;
}
.window.dark .button-style:hover {
  background-color: #1e88e5;
}

.window.dark .select-style {
  background: #333;
  color: #ddd;
  border: 1px solid #555;
}

/* --------------------------
   Separators
-------------------------- */
hr.separator {
  border: 0;
  border-top: 1px solid #ccc;
  margin: 10px 0;
}
.window.dark hr.separator {
  border-top: 1px solid #555;
}

/* --------------------------
   Warning / critical
-------------------------- */
.warning {
  text-align: center;
  font-weight: bold;
  color: #f7c02b;
}

.critical {
  color: #e53935;
  font-weight: bold;
  transition: color 0.3s ease;
}
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
  font-weight: bold;
  margin-left: 5px;
}

.tooltip-text {
  visibility: hidden;
  width: 220px;
  background-color: #333;
  color: #fff;
  text-align: left;
  border-radius: 5px;
  padding: 5px 8px;
  position: absolute;
  z-index: 100;
  bottom: 125%; /* place above the ? */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* added shadow */
}
.tooltip-left {
  bottom: auto; /* reset top positioning */
  left: auto; /* reset horizontal centering */
  top: 50%; /* center vertically */
  right: 125%; /* move it to the left */
  transform: translateY(-50%);
}
.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}
#reopenBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  font-size: 0.85rem;
  font-weight: normal;
  color: #fff;
  background-color: #007bff; /* blue button */
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  z-index: 1000;
}

#reopenBtn:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

#reopenBtn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Hide when display:none */
#reopenBtn[style*="display: none"] {
  visibility: hidden;
}
.job-columns {
  display: flex;
  justify-content: flex-start; /* keep lists from stretching too far apart */
  gap: 15%; /* controls horizontal spacing between the two lists */
}

.job-columns ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.job-columns li {
  margin-bottom: 4px; /* smaller vertical spacing */
}

.second-list {
  margin-left: 60px; /* pushes it slightly right */
}
.job-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.job-list li {
  margin-bottom: 4px;
}

.job-list input[type="checkbox"] {
  margin-right: 5px;
}

.second-list {
  margin-left: auto;
}

#dragHandle {
  cursor: move;
  margin-left: 8px;
  user-select: none;
}
#appWindow, #reopenBtn {
  display: none;
}
#reopenBtn {
  width: 190px;     /* fixed width */
  height: 28px;     /* fixed height */
  min-width: 190px;
  min-height: 28px;
  max-width: 19px;
  max-height: 28px;
  position: absolute; /* keep it positioned independently */
}