.body {
  height: 100%;
  position: relative;
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  background: white;
  color: black;
  transition: background 0.3s ease, color 0.3s ease;
}

.body.dark-mode {
  background: #1a1a1a;
  color: #e0e0e0;
}

.message-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem;
  overflow-y: scroll;
  position: absolute;
  top: 3.33rem;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100% - 5.33rem);
}

.dark-mode .message-body {
  background: #1a1a1a;
}

.speakButton {
  all: unset;
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: #1034a6;
  cursor: pointer;
  background: white;
  padding: 0.5rem;
  border: 1px solid black;
  border-radius: 5px;
  z-index: 11;
  box-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.09), 0 3px 8px hsla(0, 0%, 0%, 0.09),
    0 4px 13px hsla(0, 0%, 0%, 0.13);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.dark-mode .speakButton {
  background: #2a2a2a;
  border-color: #555;
}

.dark-mode .speakButton svg {
  fill: #e0e0e0 !important;
}

.output-language {
  all: unset;
  border: 1px;
  border: 1px solid black;
  border-radius: 5px;
  padding: 9px;
  padding-right: 30px;
  background: white;
  background-repeat: no-repeat;
  background-position-x: calc(100% - 5px);
  background-position-y: center;
  background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  box-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.09), 0 3px 8px hsla(0, 0%, 0%, 0.09),
    0 4px 13px hsla(0, 0%, 0%, 0.13);
  cursor: pointer;
  z-index: 1;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.dark-mode .output-language {
  background: #2a2a2a;
  border-color: #555;
  color: #e0e0e0;
  background-repeat: no-repeat;
  background-position-x: calc(100% - 5px);
  background-position-y: center;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23e0e0e0' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
}

.reverseButton {
  all: unset;
  position: absolute;
  right: 4rem;
  top: 1rem;
  color: #1034a6;
  cursor: pointer;
  background: white;
  padding: 0.5rem;
  border: 1px solid black;
  border-radius: 5px;
  z-index: 1;
  box-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.09), 0 3px 8px hsla(0, 0%, 0%, 0.09),
    0 4px 13px hsla(0, 0%, 0%, 0.13);
  height: 20px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.dark-mode .reverseButton {
  background: #2a2a2a;
  border-color: #555;
}

.dark-mode .reverseButton svg {
  fill: #e0e0e0 !important;
}

.settingsButton {
  all: unset;
  position: absolute;
  right: 1rem;
  top: 1rem;
  cursor: pointer;
  background: white;
  padding: 0.5rem;
  border: 1px solid black;
  border-radius: 5px;
  z-index: 12;
  box-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.09), 0 3px 8px hsla(0, 0%, 0%, 0.09),
    0 4px 13px hsla(0, 0%, 0%, 0.13);
  transition: background 0.3s ease, border-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-mode .settingsButton {
  background: #2a2a2a;
  border-color: #555;
}

.dark-mode .settingsButton svg {
  fill: #e0e0e0 !important;
}

.darkModeToggle {
  all: unset;
  position: absolute;
  left: 1rem;
  top: 1rem;
  cursor: pointer;
  background: white;
  padding: 0.5rem;
  border: 1px solid black;
  border-radius: 5px;
  z-index: 1;
  box-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.09), 0 3px 8px hsla(0, 0%, 0%, 0.09),
    0 4px 13px hsla(0, 0%, 0%, 0.13);
  transition: background 0.3s ease, border-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Hidden by default, shown when needed */
  display: none;
}

.dark-mode .darkModeToggle {
  background: #2a2a2a;
  border-color: #555;
}

.dark-mode .darkModeToggle svg {
  fill: #e0e0e0 !important;
}

/* Settings Modal */
#settings-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  backdrop-filter: blur(4px);
}

#settings-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#settings-modal-content {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 400px;
  width: 90%;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark-mode #settings-modal-content {
  background: #2a2a2a;
  color: #e0e0e0;
}

#settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark-mode #settings-modal-header {
  border-bottom-color: #555;
}

#settings-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #1034a6;
}

.dark-mode #settings-modal-header h2 {
  color: #6ea4ff;
}

#close-settings-modal {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-mode #close-settings-modal {
  color: #aaa;
}

#close-settings-modal:hover {
  color: #000;
}

.dark-mode #close-settings-modal:hover {
  color: #fff;
}

.settings-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.dark-mode .settings-option {
  border-bottom-color: #555;
}

.settings-option:last-child {
  border-bottom: none;
}

.settings-option-label {
  font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background: #ccc;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-switch.active {
  background: #1034a6;
}

.dark-mode .toggle-switch.active {
  background: #6ea4ff;
}

.toggle-switch-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle-switch.active .toggle-switch-slider {
  transform: translateX(24px);
}

.dark-mode #scroll-to-start {
  color: #6ea4ff !important;
}

/* Message bubble styles for dark mode */
.dark-mode .message-bubble {
  border-color: #444 !important;
  background: #2a2a2a !important;
}

.dark-mode .output-message {
  background: #3a3a3a !important;
  border-color: #555 !important;
}
