:root {
  --clr-primary: #1abc9c;
  --clr-primary-dark: #16a085;
  --clr-accent: #f1c40f;
  --clr-bg: #121417;
  --clr-bg-container: #1b1e24;
  --clr-text: #e0e3eb;
  --clr-text-light: #9ca3b5;
  --clr-border: #2e3340;
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: 'Source Code Pro', monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--clr-bg);
  color: var(--clr-text);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 2rem;
}

.container {
  max-width: 700px;
  width: 100%;
  background: var(--clr-bg-container);
  padding: 2rem 2.5rem;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.title {
  text-align: center;
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 0;
  color: var(--clr-primary);
  letter-spacing: 0.5px;
}

.lang-select {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.lang-btn {
  padding: 0.6rem 1.6rem;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid var(--clr-primary);
  background: transparent;
  color: var(--clr-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.lang-btn:hover {
  background: var(--clr-primary);
  color: var(--clr-bg-container);
}

.lang-btn.active {
  background: var(--clr-primary);
  color: var(--clr-bg-container);
  cursor: default;
  box-shadow: 0 4px 12px rgba(26, 188, 156, 0.2);
}

.code-section textarea {
  width: 100%;
  height: 260px;
  resize: vertical;
  padding: 1rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--clr-border);
  background: #15181d;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
  color: var(--clr-text);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  caret-color: var(--clr-accent);
}

.code-section textarea:focus {
  outline: none;
  border-color: var(--clr-accent);
  box-shadow: 0 0 8px rgba(241, 196, 15, 0.4);
}

.action-section {
  display: flex;
  justify-content: center;
}

.instructions {
  margin: 0rem 0 1.5rem 0rem;
  color: var(--clr-text);
  font-size: 0.85rem;
  font-style: normal;
  text-align: center;
  user-select: none;
  font-weight: 500;
}

.instructions span {
  display: block;
  margin-bottom: 0.3rem; /* control spacing */
}

.analyze-btn {
  padding: 0.9rem 2.4rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--clr-bg-container);
  background: var(--clr-primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(26, 188, 156, 0.4);
}

.analyze-btn:hover {
  background: var(--clr-primary-dark);
  box-shadow: 0 6px 18px rgba(26, 188, 156, 0.2);
}

.result-section {
  background: #1a1d25;
  padding: 0rem 2rem;
  border-radius: 10px;
  max-height: 300px;        /* max height to limit size */
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.4);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--clr-text);
  line-height: 1.4;
  border: 1px solid var(--clr-border);
  overflow-y: auto;         /* scroll only if needed */
  white-space: pre-wrap;
  word-wrap: break-word;
}

.result-section h2 {
  margin-top: 0;
  margin-bottom: 0rem;
  font-weight: 700;
  color: var(--clr-accent);
}

.result-section pre {
  margin: 0;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-wrap: break-word;
}

@media (max-width: 480px) {
  .container {
      padding: 1.5rem 1.6rem;
  }
  .code-section textarea {
      height: 180px;
  }
  .analyze-btn {
      width: 100%;
  }
  .lang-select {
      flex-wrap: wrap;
  }
  .lang-btn {
      flex: 1 1 30%;
      text-align: center;
  }
}
