:root {
  /* Neutral greys */
  --color-bg: #f6f5f3; /* background */
  --color-header-bg: #e3e0db; /* header background */
  --color-border: #cbc6be; /* borders */
  --color-text: #4a4a47; /* text */

  /* Accents */
  --color-alert: #c44c47;
  --color-alert-overlay: #c44c4722; /* alert / important */
  --color-link: #0366d6; /* link blue */
  --color-link-overlay: #0366d622; /* link blue */
  --color-span-overlay: #9b8f1380; /* semi-transparent overlay */
}
body {
  font-family: Roboto, sans-serif;
  font-weight: 400;
  font-size: 12px;
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Links */
a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.fake-link {
  color: var(--color-link);
  text-decoration: none;
  cursor: pointer;
}
.fake-link:hover {
  text-decoration: underline;
}

label {
  display: flex;
  align-items: center; /* vertical alignment */
  gap: 8px; /* space between label and slider */
}

.separator {
    color: var(--color-border);
    margin-top: 12px; 
    margin-bottom: 3px ; 
    font-weight: 500; /* optional, to make it stand out */
    display: block; /* ensures it behaves like a block element */
}

input[type="checkbox"] {
  /* Remove browser default background */
  accent-color: var(--color-link); /* ✅ controls the checkmark + fill color */
  border: 1px solid var(--color-border);
}

.user-button {
  background: none;
  color: var(--color-link);
  border: 0.5px solid var(--color-link);
  padding: 0.5rem 0.5rem;
  border-radius: 4px;
  /* font-weight: 400; */
  cursor: pointer;
  transition: all 0.2s;
  /* margin-top: 1rem; */
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-button:hover {
  background-color: var(--color-link-overlay);
  color: var(--color-link);
}

.user-button-container {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

/* Home Page */
.home-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.home-content {
  width: auto;
  display: inline-block;
  text-align: left;
}

.error-message {
  color: var(--color-alert);
  background-color: var(--color-alert-overlay);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Main container */
.edit-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.top-panes-container {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  overflow: hidden;
}

/* Common pane styles */
.pane {
  position: relative;
  padding: 0px;
  /* background: #fff; */
  overflow-y: auto;
  box-sizing: border-box;
  min-height: 0; /* Fix for flexbox scrolling */
  transition: flex 0.3s ease, width 0.3s ease; /* smooth resize */
}
/* --- Collapsible behavior --- */
/* Collapsed state */
.pane.collapsed {
  flex: 0 0 24px !important; /* shrink to 24px width */
  min-width: 24px !important;
  max-width: 24px !important;
  overflow: visible; /* keep collapse button visible */
  background: var(--color-header-bg); /* gray background for collapsed panes */
}

/* Hide inner content except the collapse button */
.pane.collapsed > *:not(.collapse-btn) {
  display: none !important;
}

/* Rotated label for thin bar */
.pane.collapsed::before {
  content: attr(data-title);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  white-space: nowrap;
  font-weight: 600;
}

.pane-placeholder {
  padding: 1rem;
  color: var(--color-text);
  font-style: italic;
  text-align: center;
}
/* Collapse button */
.collapse-btn {
  /* position: sticky; */
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  cursor: pointer;
  z-index: 10;
  background: var(--color-header-bg);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  padding: 0;
  line-height: 1;
}
.collapse-btn:hover {
  background-color: var(--color-border);
}

/* Tables */
.info-table,
.spans-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table td,
.spans-table td,
.spans-table th {
  padding: 2px 5px;
  border-bottom: 0.5px solid var(--color-border);
  vertical-align: top;
}

.info-table td:first-child {
  font-weight: bold;
}

.spans-table th {
  text-align: left;
  font-weight: bold;
}

.spans-table tr:last-child td {
  border-bottom: none;
}

/* Waveform pane at the top - full width */
.pane.waveform {
  width: 100%;
  /* background: #fff; */
  padding: 0rem;
  border-bottom: 1px solid var(--color-border);
  min-height: 175px;
  box-sizing: border-box;
  flex: 0 0 auto;
}

/* Container for the three columns */
.bottom-panes-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Pane headers */
.pane-header {
  background-color: var(--color-header-bg);
  padding: 5px 10px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  height: 24px;
  box-sizing: border-box;
}

.header-content {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.pane-content {
  padding: 10px;
}

.search-form {
  width: 100%;
}

.search-row {
  display: flex;
  align-items: center;
}

.multiselect-row {
  align-items: flex-start;
}

.search-row label {
  margin-right: 8px;
}

.multiselect-row label {
  margin-top: 6px;
}

.search-input {
  font-family: inherit; /* use the same font as body */
  font-size: inherit; /* use the same size as body */
  color: inherit; /* use the same color as body */
  flex: 1;
  border: none; /* remove all borders */
  border-bottom: 0.5px solid var(--color-border); /* only bottom border */
  border-radius: 0; /* remove rounding */
  outline: none; /* remove focus outline */
  padding: 4px 0; /* adjust padding if needed */
  background: transparent; /* optional: match background */
  box-shadow: none; /* remove any input shadow */
}

.search-input:focus {
  border-bottom-color: var(--color-link);
}

.search-multiselect {
  display: none !important;
}

.search-multiselect-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-multiselect-display {
  width: 100%;
  border: none;
  border-bottom: 0.5px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  padding: 4px 24px 4px 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  line-height: 1.2;
  min-height: 2em;
  max-height: calc(4 * 1.4em);
  position: relative;
  transition: border-bottom-color 0.2s ease;
}

.search-multiselect-display:hover,
.search-multiselect-display:focus-visible {
  border-bottom-color: var(--color-link);
  outline: none;
}

.search-multiselect-display::after {
  content: "\25BE";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 10px;
  color: var(--color-text);
  opacity: 0.8;
}

.search-multiselect-display-text {
  display: block;
  white-space: normal;
}

.search-multiselect-popup {
  position: absolute;
  z-index: 2000;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 8px;
  max-width: 320px;
  min-width: 200px;
  display: none;
  box-sizing: border-box;
}

.search-multiselect-popup.open {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-multiselect-select-all {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.search-multiselect-select-all input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}

.search-multiselect-option.select-all {
  font-weight: 600;
}

.search-multiselect-separator {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin: 2px 0 0;
}

.search-multiselect-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 4px 6px;
  font: inherit;
  background: #fff;
}

.search-multiselect-search:focus {
  outline: none;
  border-color: var(--color-link);
  box-shadow: 0 0 0 2px var(--color-link-overlay);
}

.search-multiselect-options {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  font-size: 12px;
  cursor: pointer;
}

.search-multiselect-option input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}

/* Individual pane widths */
.pane.search {
  flex: 1;
  min-width: 100px;
  max-width: 25%;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.pane.search .pane-content {
  flex: 1;
  overflow-y: auto;
}

.pane.list {
  flex: 1;
  min-width: 250px;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#item-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane.details {
  flex: 1;
  min-width: 300px;
}

.waveform-controls-btn {
  color: var(--color-text);
  width: 100px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: var(--color-header-bg);
  cursor: pointer;
  padding: 1px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.waveform-controls-btn:hover {
  background-color: var(--color-border);
}

.spans-controls-btn {
  color: var(--color-text);
  width: 50px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: var(--color-header-bg);
  cursor: pointer;
  padding: 1px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spans-controls-btn:hover {
  background-color: var(--color-border);
}

.waveform-controls-slider {
  width: 200px;
}

/* Controls glued to bottom */
.waveform-controls {
  position: absolute;
  top: 150px;
  left: 0;
  width: 100%;
  /* min-height: 20px;  */
  padding: 0px 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  box-sizing: border-box;
}

#waveform {
  height: 150px;
  width: 100%;
  left: 0;
  top: 0;
}

.home-box {
  width: 60vmin;
  height: 60vmin;
}

.inner-details {
  flex: 1; /* fills remaining space */
  overflow-y: auto; /* scroll only inside this div */
  padding: 0 0;
  box-sizing: border-box;
}
.section {
  margin-bottom: 0px;
  border-radius: 0px;
  overflow: hidden;
}
.section-header {
  padding: 5px 10px;
  background-color: var(--color-header-bg);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  box-sizing: border-box;
}
.section-header:hover {
  background-color: var(--color-border);
}
.section-content {
  padding: 0px;
  display: none;
}
.section.active .section-content {
  display: block;
}
.section-arrow {
  transition: transform 0.3s;
  display: inline-flex;
  align-items: center;
}
.section.active .section-arrow {
  transform: rotate(-90deg);
}
.details-muted {
  color: var(--color-border);
  font-size: 10px;
  margin-left: 4px;
}
.spans-tabulator.tabulator {
  margin-bottom: 0;
}
[data-transcript-empty] {
  padding: 8px 0;
  color: var(--color-border);
  font-style: italic;
}
