/* Base styles */
body,
html {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Control panel */
.controls {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  margin: 0 0 20px 0;
  width: 100%;
  z-index: 100;
  box-sizing: border-box;
}

/* Form elements */
.control-group {
  margin-bottom: 15px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

label {
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}

input[type="checkbox"] {
  margin: 0;
  width: auto;
}

select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  min-width: 200px;
}

/* Base button styles */
button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
  font-size: 14px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Button icons and text */
.btn-icon {
  display: inline-block;
  width: 20px;
  text-align: center;
}

.btn-text {
  display: inline-block;
}

button:disabled {
  background-color: #cccccc !important;
  cursor: not-allowed;
  opacity: 0.7;
}

button:hover:not(:disabled) {
  opacity: 0.9;
}

/* Play/Pause button */
#playPauseBtn {
  background-color: #4CAF50; /* Green for play */
}

#playPauseBtn.paused {
  background-color: #ff9800; /* Orange for pause */
}

#playPauseBtn:hover:not(:disabled) {
  background-color: #45a049; /* Darker green on hover */
}

#playPauseBtn.paused:hover:not(:disabled) {
  background-color: #e68900; /* Darker orange on hover */
}

/* Stop button */
#stopBtn {
  background-color: #f44336; /* Red for stop */
}

#stopBtn:hover:not(:disabled) {
  background-color: #d32f2f; /* Darker red on hover */
}

/* Navigation buttons */
#prevBtn,
#nextBtn {
  background-color: #2196F3; /* Blue for navigation */
}

#prevBtn:hover:not(:disabled),
#nextBtn:hover:not(:disabled) {
  background-color: #1976D2; /* Darker blue on hover */
}

/* Utterance counter */
#currentUtterance {
  font-weight: bold;
  color: #2196F3;
}

/* Content area */
#content {
  line-height: 1.8;
}

#content p {
  margin-bottom: 1.2em;
}

/* Highlight for current word */
::highlight(current-word) {
  background-color: #ffeb3b;
  color: black;
}

/* Footer */
footer {
  margin: 2em 0 1em;
  padding: 1em 0 0;
  border-top: 1px solid #e0e0e0;
  font-size: 0.8em;
  color: #666;
  line-height: 1.5;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1em;
  padding-right: 1em;
}

footer p {
  margin: 0.3em 0;
}

footer a {
  color: #1a73e8;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .control-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  select {
    width: 100%;
  }
  
  button {
    padding: 8px 12px;
    font-size: 13px;
  }
}