/* Defaŭltaj variabloj (hela reĝimo) */
:root {
  --bg-color: #ffffff;
  --bg2-color: #f8f9fa;
  /*   --bg3-color: linear-gradient(135deg, #470b8b 0%, #8e24aa 100%); */
  --bg4-color: linear-gradient(to right, #1b48c4, #8e24aa);
  --border-color: #e0e0e0;
  --text-color: #333333;
  --text2-color: #727273;
  --text3-color: #d32f2f;
  --text4-color: #1a237e;
  --linio-color: #eee;
  --linio2-color: #a9c0ff;
  --shadow-cont: 0 20px 35px -12px rgba(0, 0, 0, 1);
  --reghimo-color: #8e24aa;
  --reghimo-mobile-color: #f6bf26;
}

/* variabloj por malhela reĝimo */
[data-theme="dark"] {
  --bg-color: #181a1b;
  --bg2-color: #1b1e1f;
  --bg3-color: #0a0a0f;
  --bg4-color: linear-gradient(to right, #470b8b, #751e8d);
  --border-color: #393d40;
  --text-color: #c8c3bc;
  --text2-color: #676560;
  --text3-color: #d74343;
  --text4-color: #89aee7;
  --linio-color: #1f2123;
  --linio2-color: #6a11cb;
  --shadow-cont: 0 20px 35px -12px rgba(0, 0, 0, 1);
  --reghimo-color: #c084fc;
  --reghimo-mobile-color: #f6bf26;
}
#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--reghimo-color);
  transition: transform 0.2s ease;
  box-shadow: none;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: none;
}

#theme-toggle svg {
  width: 32px;
  height: 32px;
  display: block;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Fono kun glow (originala CSS) */
body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: var(--bg3-color);
}

/* Fona glita efiko (background glow) */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(99, 102, 241, 0.15),
      transparent 60%
    ),
    radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.1), transparent 60%);
}

.container {
  background-color: var(--bg-color);
  border-radius: 20px;
  box-shadow: var(--shadow-cont);
  width: 100%;
  max-width: 800px;
  overflow: hidden;
}

.header {
  background: var(--bg4-color);
  color: white;
  padding: 25px;
  text-align: center;
}

.header h1 {
  font-size: 2.2em;
  margin-bottom: 8px;
  font-weight: 600;
}

.header p {
  opacity: 0.9;
  font-size: 1.1em;
}

.content {
  padding: 30px;
}

.converter-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

@media (max-width: 768px) {
  .converter-area {
    grid-template-columns: 1fr;
  }
  #theme-toggle {
    color: var(--reghimo-mobile-color);
  }
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-color);
  font-size: 1.1em;
  display: flex;
  align-items: center;
}

.input-group label i {
  margin-right: 8px;
  color: #6a11cb;
}

textarea {
  width: 100%;
  height: 250px;
  padding: 15px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1.1em;
  resize: vertical;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
  line-height: 1.5;
}

textarea:focus {
  outline: none;
  border-color: var(--linio2-color);
  box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}

#eniro {
  background-color: var(--bg2-color);
  color: var(--text-color);
}
#eniro::placeholder {
  color: var(--text2-color);
  opacity: 0.7;
}

#eliro {
  background-color: var(--bg2-color);
  color: var(--text4-color);
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

button {
  background: linear-gradient(to right, #6a11cb, #2575fc);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 50px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 15px rgba(106, 17, 203, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(106, 17, 203, 0.4);
}

button:active {
  transform: translateY(0);
}

button i {
  margin-right: 8px;
}

#kopii {
  background: linear-gradient(to right, #068c68, #00b10c);
}

#kopii:hover {
  box-shadow: 0 6px 20px rgba(0, 176, 155, 0.4);
}

.char-info {
  display: flex;
  align-items: center;
  color: #666;
  font-size: 0.95em;
}

.char-info span {
  margin-right: 15px;
  display: flex;
  align-items: center;
}

.char-info i {
  margin-right: 5px;
}

.legend {
  background-color: var(--bg2-color);
  border-radius: 12px;
  padding: 20px;
  margin-top: 30px;
  border-left: 5px solid #6a11cb;
}

.legend h3 {
  color: #6a11cb;
  margin-bottom: 15px;
  font-size: 1.3em;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--bg-color);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.x-char {
  font-weight: bold;
  color: var(--text3-color);
  width: 40px;
}

.esperanto-char {
  font-weight: bold;
  color: var(--text4-color);
  font-size: 1.2em;
  width: 40px;
}

.arrow {
  margin: 0 10px;
  color: #999;
}

.footer {
  text-align: center;
  padding: 20px;
  color: #666;
  border-top: 1px solid var(--border-color);
  font-size: 0.9em;
}

.footer a {
  color: #6a11cb;
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}
