/* Tema Siang (Light) */
body.light {
  background: #f5f5f5;
  color: #222;
}
body.light button#playButton {
  background: linear-gradient(145deg, #4a90e2, #357ABD);
  box-shadow: 0 6px 10px rgba(53,122,189,0.5), 0 3px 6px rgba(74,144,226,0.6);
}
body.light #morseOutputContainer {
  background: white;
  color: #000;
}

/* Tema Malam (Dark) */
body.dark {
  background: #121212;
  color: #ddd;
}
body.dark button#playButton {
  background: linear-gradient(145deg, #222, #444);
  box-shadow: 0 6px 10px rgba(0,255,255,0.3), 0 3px 6px rgba(0,255,255,0.4);
}
body.dark #morseOutputContainer {
  background: #222;
  color: #0ff;
}

/* Tema Glow Hijau */
body.glow-green {
  background: #000;
  color: #0f0;
}
body.glow-green button#playButton {
  background: #003300;
  color: #0f0;
  box-shadow: 0 0 10px #0f0, 0 0 20px #0f0;
}
body.glow-green #morseOutputContainer {
  background: #001100;
  color: #0f0;
}

/* Tema Glow Biru */
body.glow-blue {
  background: #000;
  color: #0af;
}
body.glow-blue button#playButton {
  background: #002244;
  color: #0af;
  box-shadow: 0 0 10px #0af, 0 0 20px #0af;
}
body.glow-blue #morseOutputContainer {
  background: #001122;
  color: #0af;
}

/* Tema Glow Merah */
body.glow-red {
  background: #000;
  color: #f00;
}
body.glow-red button#playButton {
  background: #440000;
  color: #f00;
  box-shadow: 0 0 10px #f00, 0 0 20px #f00;
}
body.glow-red #morseOutputContainer {
  background: #220000;
  color: #f00;
}

/* Common Styles */
body {
  font-family: Arial, sans-serif;
  padding: 15px;
  max-width: 480px;
  margin: auto;
}

h2 {
  text-align: center;
  margin-bottom: 20px;
}

textarea#textInput {
  width: 100%;
  font-size: 18px;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
  resize: vertical;
  min-height: 80px;
}

label {
  font-size: 16px;
  margin-right: 15px;
  user-select: none;
}

input[type="radio"], select {
  margin-right: 6px;
  vertical-align: middle;
}

.volume-group, .speed-group, .theme-group, .sound-style-group {
  margin-bottom: 20px;
  text-align: center;
}

/* Butang 3D moden */
button#playButton {
  width: 100%;
  font-size: 20px;
  padding: 15px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 25px;
  box-shadow: 0 6px 10px rgba(53, 122, 189, 0.5),
              0 3px 6px rgba(74, 144, 226, 0.6);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

button#playButton:hover {
  box-shadow: 0 10px 15px rgba(53, 122, 189, 0.7),
              0 5px 10px rgba(74, 144, 226, 0.8);
  transform: translateY(-3px);
}

button#playButton:active {
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.3);
  transform: translateY(1px);
}

#morseOutputContainer {
  position: relative;
  padding: 15px;
  border-radius: 8px;
  min-height: 60px;
  user-select: text;
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 8px;
  word-wrap: break-word;
  line-height: 1.4;
  padding-bottom: 40px; /* space for copy button */
}

#copyMorseBtn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 24px;
  user-select: none;
}

#copyMessage {
  color: green;
  text-align: center;
  margin-top: 5px;
  display: none;
  font-weight: bold;
}

#charCount {
  text-align: right;
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
  user-select: none;
}

/* Toggle button style */
.toggle-btn {
  display: inline-block;
  padding: 8px 20px;
  margin: 0 10px 15px 10px;
  border-radius: 8px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  user-select: none;
  font-weight: bold;
  transition: background-color 0.3s;
}
.toggle-btn:hover {
  background-color: #0056b3;
}

/* Content hidden initially */
.toggle-content {
  display: none;
  margin-bottom: 20px;
  text-align: center;
}

/* Glowing border colors for themes */
body.light #morseOutputContainer {
  box-shadow: 0 0 15px 3px #aaa;
}
body.dark #morseOutputContainer {
  box-shadow: 0 0 15px 3px #444;
}
body.glow-green #morseOutputContainer {
  box-shadow: 0 0 20px 4px #0f0;
}
body.glow-blue #morseOutputContainer {
  box-shadow: 0 0 20px 4px #08f;
}
body.glow-red #morseOutputContainer {
  box-shadow: 0 0 20px 4px #f00;
}

/* Styling dropdown sound select */
.sound-style-group {
  text-align: center;
  margin-bottom: 20px;
}
.sound-style-group label {
  font-weight: bold;
  margin-right: 10px;
}
#soundSelect {
  padding: 5px 10px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
  cursor: pointer;
  min-width: 180px;
}

/* --- Tambahan untuk jarak label radio supaya tidak rapat --- */
.volume-group label {
  display: inline-block;
  margin: 8px 15px;
  cursor: pointer;
  font-size: 16px;
  vertical-align: middle;
  white-space: nowrap;
}

.volume-group input[type="radio"] {
  margin-right: 6px;
  vertical-align: middle;
}

/* Responsive untuk mobile kecil */
@media (max-width: 480px) {
  .volume-group label {
    display: block;
    margin: 6px 0;
    white-space: normal;
  }
}
