:root {
  --bg: #000000;
  --bg-panel: #000000;
  --accent: #5fffd6;
  --accent-glow: #23e5ad55;
  --text: #e9eef1;
  --text-dim: #b3b8c1;
  --shadow: 0 4px 18px 6px #23e5ad09, 0 1.5px 3px 0 #000d;
  --border: #333e;
  --material-el: #0a0a0a;
  --material-ripple: #2feacc33;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

header {
  background: var(--bg-panel);
  text-align: center;
  box-shadow: var(--shadow);
  padding: 1.3rem 0 0.55rem;
}

h1 {
  font-size: 2.05rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin-bottom: 0.18em;
  text-transform: lowercase;
  text-shadow: 0 0 8px var(--accent-glow);
}
.subtitle {
  font-size: 1.04rem;
  color: var(--text-dim);
  margin-bottom: 0;
  font-weight: 400;
}

main {
  margin: 0 auto;
  padding: 1.8rem 0 2rem;
  max-width: 465px;
  width: 97vw;
}

/* Material form look */
form {
  background: var(--material-el);
  box-shadow: 0 2px 14px #222a  /* softer, minimal glow */;
  border-radius: 1.25rem;
  padding: 1.35rem 1.05rem 1.1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

textarea {
  font-size: 1.11rem;
  color: var(--text);
  background: #000000;
  border: 1.5px solid var(--border);
  border-radius: 0.8rem;
  padding: 0.9em 0.8em;
  resize: vertical;
  min-height: 51px;
  max-height: 156px;
  outline: none;
}
textarea:focus {
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
}
.mat-nav-btn {
  appearance: none;
  background: #000000;
  color: var(--text);
  border: 0;
  border-radius: 0.7rem;
  box-shadow: 0 2px 8px #3334;
  padding: 0.58em 1.18em 0.58em 0.8em;
  font-size: 1.07rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
  transition: box-shadow 0.17s, border 0.13s;
  min-width: 135px;
}
.mat-nav-btn .arrow {
  font-size: 1.2em; 
  margin-left: 0.2em;
  color: var(--text-dim);
}
.mat-nav-btn:focus, .mat-nav-btn[aria-expanded="true"] {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 2.5px var(--accent-glow);
}
.mat-nav-btn:active {
  background: #060606;
}

.submit-btn {
  background: linear-gradient(80deg, var(--accent) 22%, #ddfdac 85%);
  color: #181c1f;
  border: none;
  border-radius: 1em;
  font-size: 1.16rem;
  font-weight: 700;
  padding: 0.67em 1em;
  cursor: pointer;
  box-shadow: 0 0 11px var(--accent-glow);
  transition: background 0.22s, color 0.15s;
  margin-top: 0.28em;
  letter-spacing: 0.02em;
}
.submit-btn:active {
  background: linear-gradient(85deg, #ddfdac 60%, var(--accent) 90%);
  color: #000;
}

#output-section {
  margin-top: 2.1rem;
}

.translation-container {
  display: flex;
  align-items: flex-start;
  position: relative;
}

#translation-result {
  min-height: 62px;
  font-size: 1.26rem;
  color: var(--accent);
  letter-spacing: 0.01em;
  white-space: pre-line;
  outline: none;
  transition: color 0.18s;
  background: none;
  border-radius: 0.7em;
  padding: 0.18em 0.08em;
  flex-grow: 1;
  margin-right: 0.5rem;
}

.copy-btn {
  appearance: none;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
}

.copy-btn svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: var(--accent);
}

.copy-btn:hover, .copy-btn:focus {
  background: var(--material-ripple);
}

.copy-btn:active {
  transform: scale(0.95);
}

.sr-only {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  top: auto;
  overflow: hidden;
}

/* Simple/Material modal styles */
.simple-modal-backdrop,
.simple-modal {
  display: none;
}
.simple-modal-backdrop.active {
  display: block;
  position: fixed;
  inset: 0;
  background: #11161be2;
  z-index: 99;
  animation: modalFade 0.22s;
}
.simple-modal.active {
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 140;
  left: 0;
  top: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  align-items: center;
  justify-content: flex-start;
  animation: simpleSlideIn 0.22s cubic-bezier(.5, 1.4, .75, 1);
  padding-top: 12vw;
}
.simple-modal-content {
  min-width: 90vw;
  max-width: 98vw;
  background: #000000;
  border: 1px solid var(--border);
  border-radius: 1.13rem;
  box-shadow: 0 8px 42px #21e7af11;
  padding: 1.03rem 0.7rem 0.7rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  max-height: 82vh;
}
#lang-dialog-title, #style-dialog-title {
  color: var(--accent);
  font-size: 1.14rem;
  font-weight: 700;
  margin-bottom: -0.17em;
  margin-top: 0.18em;
  letter-spacing: 0.01em;
}
#lang-search {
  padding: 0.61em 0.68em;
  border-radius: 0.67em;
  border: 1.5px solid var(--border);
  font-size: 1.1rem;
  color: var(--text);
  background: #000000;
  margin-bottom: 0.07em;
  width: 100%;
  outline: none;
  box-sizing: border-box;
}
#lang-list, #style-list {
  overflow-y: auto;
  max-height: 52vh;
  background: none;
  padding: 0;
  list-style: none;
  border-radius: 0.6em;
  margin: 0 0 -0.32em 0;
  font-size: 1.07rem;
}
#lang-list li, #style-list li {
  padding: 0.6em 1em;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text);
  border-radius: 0.38em;
  margin: 0.09em 0;
  transition: background 0.17s, color 0.13s;
  outline: none;
}
#lang-list li[aria-selected="true"],
#lang-list li:focus,
#lang-list li.active,
#style-list li[aria-selected="true"],
#style-list li:focus,
#style-list li.active {
  background: var(--accent-glow);
  color: var(--accent);
}
#lang-list li:hover, 
#style-list li:hover {
  background: #0a0a0a;
  color: var(--accent);
}
#lang-list li[aria-disabled="true"], #style-list li[aria-disabled="true"] {
  color: #6e767a;
  background: none;
}

/* minimal modal on phone */
@media (max-width: 600px) {
  main {
    padding: 1rem 0 1.2rem;
    max-width: 99vw;
  }
  .simple-modal-content {
    min-width: 96vw;
    padding-left: 2vw;
    padding-right: 2vw;
  }
}

@media (pointer:coarse) {
  #lang-list li:active, #style-list li:active {
    background: var(--accent-glow);
    color: #141d12;
  }
}

/* Animations */
@keyframes modalFade {
  from { opacity: 0 }
  to { opacity: 1 }
}
@keyframes simpleSlideIn {
  from { transform: translateY(64px); opacity:0; }
  to { transform: translateY(0); opacity:1; }
}