/* General Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

h1,
h3 {
  font-size: 40px;
  margin: 0;
  padding: 5px;
  text-align: center;
}

/* Control Panel Base Styles */
#controls-container {
  display: flex;
  flex-direction: column;
  padding: 5px;
  background-color: #f5f5f5;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  position: fixed;
  z-index: 1001;
  justify-content: space-evenly;
  align-items: center;
  font-size: 12px; /* Moved from specific elements for consistency */
}

/* Left Position */
#controls-container.left {
  width: 15%;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Top Position */
#controls-container.top {
  top: 0;
  left: 0;
  right: 0;
  flex-direction: row;
  flex-wrap: wrap; /* Simplified from nowrap + wrap cases */
  justify-content: space-between;
  align-items: flex-start;
  height: auto;
  padding: 2px; /* Reduced padding for compactness */
}

/* Control Panel Children */
#controls-container > * {
  flex-grow: 1;
  text-align: center;
  margin: 0 5px;
}

#controls-container.top > * {
  display: inline-flex;
  align-items: center;
  width: calc(50% - 10px);
  margin: 2px 5px;
  box-sizing: border-box;
}

/* Control Elements */
#controls-container label,
#controls-container select,
#controls-container input[type="range"],
#controls-container input[type="checkbox"],
#controls-container input[type="radio"] {
  font-size: 12px;
  margin: 0 2px; /* Tighter margins */
}

#controls-container input[type="checkbox"],
#controls-container input[type="radio"] {
  margin-right: 3px;
}

#controls-container label[for="myRange"],
#controls-container label[for="fontSizeRange"],
#controls-container.left label[for="panelTop"],
#controls-container.left label[for="panelLeft"] {
  display: flex;
  align-items: center;
  width: 100%;
}

#controls-container.top label[for="panelTop"],
#controls-container.top label[for="panelLeft"] {
  display: inline-flex;
  width: auto;
}

#controls-container input[type="range"],
#myRange,
#fontSizeRange,
#controls-container #voiceSelect {
  width: 100%;
}

#controls-container #voiceSelect,
#groupNavigation button,
#controls-container #homeButton {
  padding: 2px 5px;
}

#controls-container p {
  margin: 0 5px;
}

/* Group Navigation */
#groupNavigation {
  display: flex;
  align-items: center;
  margin: 2px 5px;
}

#controls-container.left #groupNavigation {
  flex-direction: column;
  justify-content: center;
}

#controls-container.top #groupNavigation {
  flex-direction: row;
  justify-content: space-between;
}

#groupIndicator {
  font-weight: bold;
  font-size: 12px;
  margin: 0 5px;
}

/* Main Content */
.mainframe {
  margin-top: 60px;
  transition: margin-left 0.3s;
}

.mainframe.with-left-panel {
  margin-left: 20%;
}

/* Table Styling */
table {
  margin: 0 auto 20px;
  width: 80%;
  border-collapse: collapse;
  table-layout: fixed;
  max-width: 100%;
}

th,
td {
  padding: 8px;
  text-align: left;
  border: 1px solid #ddd;
  overflow-wrap: break-word;
  overflow: hidden;
}

th:nth-child(1),
td:nth-child(1) {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  padding: 8px 4px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

th:nth-child(2),
td:nth-child(2) {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  padding: 8px 4px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4) {
  width: auto;
  white-space: normal;
}

thead th {
  background-color: #f4f4f4;
}

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

#groupContainer tbody tr:nth-child(odd) {
  background-color: white;
}

#groupContainer tbody tr:hover {
  background-color: lightblue;
  cursor: pointer;
}

#groupContainer tbody tr.selected {
  background-color: #add8e6;
}

/* Important Sentences */
.important-sentences {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(249, 249, 249, 0.9);
  z-index: 1000;
  overflow-y: auto;
}

.important-sentences table {
  width: 60%;
  max-width: 800px;
  background-color: white;
  border: 1px solid #ddd;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.contentxy,
.important-sentences table {
  font-size: 30px;
}

#importantTable tr td {
  font-size: 24px;
}
