/* Global font */
:root {
  --datasets-bottom: calc(50% + 175px);
}

body {
  font-family: 'Source Sans Pro', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
  "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Main container */
.datasets-container {
  width: 550px;
  height: auto;
  background: #ffffff;
  position: fixed;
  right: 20px;
  top: 43%;
  transform: translateY(-50%);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
  border-radius: 8px;
  z-index: 999;
  overflow: visible;
  transition: width 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.datasets-container.collapsed:hover {
  transform: translateY(-50%) scale(1.05);
}

.datasets-container.collapsed {
  width: 75px;
  height: 75px;
  background: #00447E;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Top bar */
.top-bar {
  background: #00447E;
  color: white;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

/* Sidebar title */
.sidebar-title {
  font-size: 1.2em;
  margin: 0;
  padding-left: 10px;
  color: white;
  display: block;
}

/* Toggle button */
.toggle-button {
  position: relative;
  width: 40px;
  height: 22px;
  background: white;
  border-radius: 11px;
  border: 2px solid #00447E;
  cursor: pointer;
  margin-right: 12px;
  transition: background 0.3s;
}

.toggle-button.toggled::after {
  transform: translateX(20px);
}

.toggle-button::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #00447E;
  border-radius: 50%;
  top: 2.4px;
  left: 1px;
  transition: 0.3s;
}

/* Collapse button */
.collapse-button {
  border: none;
  outline: none;
  cursor: pointer;
  background-color: #00447E;
  background-size: 0;
  border-radius: 100%;
  padding: 0;
  margin: 0;
  color: white;
  position: absolute;
  left: -15px;
  top: 13%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  z-index: 1100;
  box-shadow: none;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.collapse-button:hover {
  transform: translateY(-50%) scale(1.15);
}

.collapse-button.collapsed {
  top: 50%;
}

/* Filter container */
.filter-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 15px;
  padding: 0 20px;
  flex-wrap: wrap;
}

/* Filter icon */
.filter-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  flex-shrink: 0;
}

/* Filter button */
.filter-button {
  flex-grow: 1;
  min-width: 80px;
  max-width: 150px;
  padding: 8px;
  background: #ddd;
  color: #333;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.filter-button.active {
  background: #00447E;
  color: white;
}

.filter-button:hover {
  background: #ccc;
}

.filter-button.active:hover {
  background: #003355;
}

/* Buttons container */
.buttons-container {
  display: flex;
  max-height: 18.5em;
  overflow: auto;
  flex-direction: column;
  /* align-items: center; */
  width: 100%;
  height: auto;
}

.error-message {
  color: red;
  font-weight: bold;
  text-align: center;
}

.error-message {
  color: red;
  font-weight: bold;
  text-align: center;
}

/* Dataset button */
.dataset-button {
  width: calc(100% - 40px);
  padding: 10px;
  margin: 0 auto 10px;
  background: #ffffff;
  color: #00447E;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  text-align: left;
  box-sizing: border-box;
}

.dataset-button.selected {
  background: #00447E;
  color: #ffffff;
}

.dataset-button:hover {
  background: #f1f1f1;
}

.dataset-button.selected:hover {
  background: #003355;
}

.loaded-tag {
  background-color: #4CAF50;;
  color: white;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 5px;
  margin-left: 10px;
}

/* No datasets message */
  .no-datasets-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 150px;
    color: #555;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 20px;
  }

  .no-datasets-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 150px;
    color: #555;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 20px;
  }

.no-datasets-message {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  font-size: 1.25em;
  font-weight: bold;
  font-family: 'Source Sans Pro', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
  "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #000000;
  text-align: center;
}

.no-datasets-icon {
  color: #aaa;
  margin-bottom: 10px;
}

.error-message {
  color: red;
  font-weight: bold;
  text-align: center;
  margin-top: 10px;
}

.toggle-control-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
}

.toggle-button.toggled {
  background-color: #2196f3;
}

.toggle-status-text {
 white-space: nowrap;
 margin-left: 2px;
 font-size: 0.95em;
}

.toggle-hint {
  font-size: 0.8rem;
  color: #9e9e9e;
  line-height: 1.2;
}

.toggle-warning {
  position: absolute;
  white-space: nowrap;
  right: calc(100% + 8px);
  color: #f44336;
  font-size: 0.8rem;
}

/* Optimizations for smaller screens*/
@media (max-height: 700px) {
  .datasets-container {
    height: auto;
    max-height: 85vh;
  }
}

@media screen and (min-device-width: 768px) and (max-device-width: 1024px) {
  .datasets-container {
    height: auto;
    max-height: 85vh;
    width: 450px;
  }
}
