/* ===== LinkedIn Translate — Google Translate dark theme ===== */

:root {
  --bg: #131314;
  --surface: #1e1f20;
  --surface-2: #282a2c;
  --outline: #444746;
  --outline-soft: #333537;
  --text: #e3e3e3;
  --text-dim: #c4c7c5;
  --text-faint: #8e918f;
  --primary: #a8c7fa;
  --primary-hover: rgba(168, 199, 250, 0.08);
  --hover: rgba(227, 227, 227, 0.06);
  --radius: 28px;
  --font: "Google Sans", "Roboto", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: var(--font);
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

svg { fill: currentColor; display: block; }

/* ===== Top bar ===== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  height: 56px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.logo { border-radius: 7px; }

.brand-name {
  font-size: 21px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.1px;
}

.brand-name b { font-weight: 500; color: var(--text); }

/* ===== Translator card ===== */

.translator {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  margin: 8px 16px 16px;
  overflow: hidden;
}

@media (min-width: 900px) {
  .translator {
    max-width: 920px;
    width: calc(100% - 32px);
    margin: 8px auto 16px;
    align-self: center;
  }
}

.pane { display: flex; flex-direction: column; }

/* ===== Pane header ===== */

.pane-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 10px 4px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 20px;
  transition: background 0.15s;
  white-space: nowrap;
}

.lang-btn:hover { background: var(--hover); }

.lang-btn .caret {
  width: 20px;
  height: 20px;
  color: var(--text-dim);
}

.switch-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  padding: 9px 12px;
  border-radius: 20px;
  transition: background 0.15s;
  white-space: nowrap;
}

.switch-btn:hover { background: var(--primary-hover); }
.switch-btn svg { width: 18px; height: 18px; }

.spacer { flex: 1; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { background: rgba(168, 199, 250, 0.16); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.recording { color: #f2b8b5; background: rgba(242, 184, 181, 0.12); }

/* ===== Text zones ===== */

.text-zone { padding: 6px 24px 4px; min-height: 120px; }

#srcText {
  width: 100%;
  min-height: 110px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 24px;
  line-height: 1.42;
  caret-color: var(--primary);
}

#srcText::placeholder { color: var(--text-faint); }

.output {
  min-height: 110px;
  font-size: 24px;
  line-height: 1.42;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-placeholder { color: var(--text-faint); font-weight: 400; }

.output.error { font-size: 15px; font-weight: 400; color: #f2b8b5; }
.output.thinking { color: var(--text-faint); font-weight: 400; }

/* ===== Toolbar ===== */

.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 14px 10px;
}

.chevron-btn svg { width: 20px; height: 20px; }

.char-count {
  font-size: 12px;
  color: var(--text-faint);
  padding-right: 6px;
}

.powered {
  font-size: 12px;
  color: var(--text-faint);
  padding-right: 8px;
}

.powered b { font-weight: 500; color: var(--text-dim); }

/* ===== Divider + swap ===== */

.divider {
  position: relative;
  height: 0;
  border-top: 1px solid var(--outline);
}

.swap-btn {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--outline);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  z-index: 2;
}

.swap-btn:hover { background: var(--surface-2); color: var(--text); }
.swap-btn svg { width: 22px; height: 22px; }

/* ===== Model picker button ===== */

.model-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 18px;
  border: 1px solid var(--outline);
  transition: background 0.15s;
  white-space: nowrap;
}

.model-btn:hover { background: var(--hover); }

.model-btn .gem {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* ===== Language picker overlay ===== */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.overlay[hidden] { display: none; }

.lang-sheet { display: flex; flex-direction: column; height: 100%; }

.lang-sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}

.lang-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border-radius: 24px;
  padding: 0 18px;
  height: 46px;
  color: var(--text-dim);
}

.lang-search svg { width: 20px; height: 20px; flex-shrink: 0; }

.lang-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}

.lang-search input::placeholder { color: var(--text-faint); }

.lang-grid {
  padding: 12px 16px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-size: 15px;
  color: var(--text);
  padding: 14px 18px;
  border-radius: 24px;
  transition: background 0.12s;
}

.lang-item:hover { background: var(--surface-2); }
.lang-item.selected { background: rgba(168, 199, 250, 0.14); color: var(--primary); }
.lang-item .check { width: 20px; height: 20px; }

/* ===== Dropdown menu ===== */

.menu {
  position: fixed;
  min-width: 190px;
  background: var(--surface-2);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  padding: 6px;
  z-index: 60;
  display: flex;
  flex-direction: column;
}

.menu[hidden] { display: none; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  text-align: left;
  transition: background 0.12s;
}

.menu-item:hover { background: var(--hover); }
.menu-item.active { background: rgba(168, 199, 250, 0.14); }

.menu-title { font-size: 14px; font-weight: 500; color: var(--text); }
.menu-sub { font-size: 12px; color: var(--text-faint); margin-left: auto; }
.menu-item .gem { width: 15px; height: 15px; color: var(--primary); margin-left: 8px; }

/* ===== Settings modal ===== */

#settingsOverlay {
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.settings-card {
  background: var(--surface-2);
  border-radius: 28px;
  padding: 26px 26px 18px;
  width: 100%;
  max-width: 430px;
}

.settings-card h2 { font-size: 21px; font-weight: 400; margin-bottom: 10px; }

.settings-sub {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 18px;
}

#apiKeyInput {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--outline);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 13px 15px;
  outline: none;
}

#apiKeyInput:focus { border-color: var(--primary); }

.key-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

.key-link:hover { text-decoration: underline; }

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.text-btn {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  padding: 10px 16px;
  border-radius: 20px;
}

.text-btn:hover { background: var(--primary-hover); }

.filled-btn {
  font-size: 14px;
  font-weight: 500;
  background: var(--primary);
  color: #062e6f;
  padding: 10px 22px;
  border-radius: 20px;
}

.filled-btn:hover { filter: brightness(1.08); }

/* ===== Toast ===== */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #e3e3e3;
  color: #1e1f20;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 10px;
  z-index: 80;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* ===== Footer ===== */

.footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  padding: 0 16px 18px;
}

@media (max-width: 560px) {
  .translator { margin: 4px 8px 12px; border-radius: 24px; }
  .switch-btn span { display: none; }
  .text-zone { padding: 6px 18px 4px; }
  #srcText, .output { font-size: 21px; }
  .brand-name { font-size: 18px; }
}
