body {
  font-family: Arial, sans-serif;
  background: #0f172a;
  color: white;
  margin: 0;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 30px;
}

h1 {
  margin-top: 0;
  text-align: center;
}

.tagline {
  text-align: center;
  color: #94a3b8;
  margin-bottom: 30px;
}

/* MAIN TRANSLATOR LAYOUT */

.translator {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex-wrap: wrap;
}

/* INPUT & OUTPUT BOX */

.box {
  flex: 1 1 0;
  min-width: 0;
  background: #1e293b;
  padding: 10px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* TEXTAREA */

textarea {
  width: 100%;
  height: 230px;
  border: none;
  padding: 10px;
  border-radius: 10px;
  resize: none;
  font-size: 16px;
  margin-top: 8px;
  box-sizing: border-box;
  line-height: 1.4;
}

#promptInput {
  resize: none;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
}

/* LANGUAGE BAR */

.lang-select {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.lang-select img {
  width: 28px;
}

/* FLAG QUICK SELECT */

.flag-bar {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.flag-bar img {
  width: 28px;
  height: 18px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 2px;
  transition: 0.2s;
}

.flag-bar img:hover {
  transform: scale(1.1);
}

/* SELECT */

select {
  padding: 6px;
  border-radius: 6px;
  border: none;
}

/* BUTTON STYLE */

button {
  background: #3b82f6;
  border: none;
  color: white;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  min-width: 90px;
  transition: 0.2s;
}

button:hover {
  background: #2563eb;
}

/* ACTION BUTTONS */

.actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* CHARACTER COUNTER */

#charCount {
  margin-top: 0;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
  align-self: center;
}

.charSpacer {
  flex: 1;
}

/* CENTER BUTTONS */

.centerButtons {
  width: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.centerButtons button {
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: 10px;
}

.centerButtons button:hover {
  box-shadow: 0 6px 14px rgb(255, 255, 255);
}

/* SHARE BUTTONS */

.share {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.outputActions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}

/* SUPPORT */

.tips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
}

.tips a {
  background: #3b82f6;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
}

/* FOOTER */

footer {
  text-align: center;
  margin-bottom: 10px;
  color: #94a3b8;
}

footer a {
  color: #3b82f6;
  text-decoration: none;
}

/* AUTO TEXT MENU */

.autoTextBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #2563eb;
  min-width: 140px;
  z-index: 5;
}

.autoTextBtn:hover {
  transform: translateY(-1px);
}

.autoTextMenu {
  position: absolute;
  top: 70px;
  left: 10px;
  right: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px;
  z-index: 20;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.4s,
    transform 0.4s;
}

.autoTextMenu.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

#autoTextMenu textarea {
  height: 80px;
}

/* LIGHT MODE */

.light {
  background: white;
  color: black;
}

.light .box {
  background: #f1f5f9;
  position: relative;
}

.light textarea {
  background: white;
  color: black;
}

/* TTS PROGRESS */

.ttsProgress {
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.ttsBar {
  width: 100%;
  height: 5px;
  background: #334155;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 3px;
}

#ttsFill {
  height: 100%;
  width: 0%;
  background: #3b82f6;
  transition: width 0.2s linear;
}

/* ACTIVE WORD */

.wordActive {
  background: #1519fada;
  color: rgb(255, 255, 255);
  border-radius: 4px;
  padding: 1px 3px;
  transition: 0.15s;
}

/*
PERBAIKAN BUG TEKS HILANG

sebelumnya:
color: transparent;

sekarang:
opacity ringan supaya highlight tetap terlihat
*/

#outputText {
  color: rgb(16, 117, 180);
}

#inputText:empty:before {
  content: attr(data-placeholder);
  color: #777;
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .translator {
    flex-direction: column;
  }

  .centerButtons {
    flex-direction: row;
    width: 100%;
    justify-content: center;
  }

  .centerButtons button {
    width: auto;
  }
}

.supportRow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.supportRow h3 {
  margin: 0;
}

@media (max-width: 600px) {
  .share {
    justify-content: center;
  }

  .share button {
    flex: 1;
    min-width: 50px;
  }
}

.outputBox {
  height: 230px;
  overflow-y: auto;
  background: #e5e7eb;
  color: black;
  padding: 10px;
  border-radius: 10px;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  font-family: system-ui, Arial, sans-serif;
  word-break: break-word;
}
