/* AI Smell Detector - Lab report aesthetic */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #f85149;
  --accent-2: #ffb454;
  --green: #3fb950;
  --yellow: #d29922;
  --mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.logo-icon { font-size: 24px; }
.logo-text { font-weight: 700; font-size: 18px; }
.lang-switch { display: flex; gap: 4px; }
.lang-btn {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.lang-btn.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-dim);
}

/* Container */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 32px;
}
.hero-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
}
.hero-sub {
  color: var(--text-dim);
  font-size: 15px;
}

/* Input */
.input-section {
  margin-bottom: 28px;
}
.text-input {
  width: 100%;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s;
}
.text-input:focus {
  outline: none;
  border-color: var(--text-dim);
}
.text-input::placeholder {
  color: var(--text-dim);
}
.input-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.btn-primary, .btn-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #ff6259; }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-dim); }

/* Result card */
.result-section {
  display: none;
  margin-bottom: 32px;
}
.result-section.visible {
  display: block;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.result-stamp {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 4px 10px;
  border-radius: 4px;
  transform: rotate(-2deg);
}
.result-meta {
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* Score */
.score-section {
  padding: 28px 20px;
  text-align: center;
}
.score-display {
  margin-bottom: 16px;
}
.score-number {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  font-family: var(--mono);
}
.score-label {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 4px;
}
.score-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px auto;
  max-width: 400px;
}
.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.3s;
}
.verdict-title {
  font-size: 22px;
  font-weight: 700;
  margin-top: 12px;
}
.verdict-desc {
  color: var(--text-dim);
  font-size: 15px;
  margin-top: 8px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Found words */
.found-words-section {
  padding: 0 20px 20px;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.found-words {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.word-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  flex-wrap: wrap;
}
.word-text {
  font-weight: 700;
  font-size: 15px;
  min-width: 80px;
}
.word-count {
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--mono);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}
.word-snark {
  font-size: 14px;
  color: var(--accent-2);
  flex: 1;
}

/* Share */
.share-section {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.btn-share {
  padding: 8px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.btn-share:hover { border-color: var(--text-dim); }

/* Upgrade section */
.upgrade-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 32px;
}
.upgrade-header {
  text-align: center;
  margin-bottom: 24px;
}
.upgrade-header h2 {
  font-size: 20px;
  margin-bottom: 8px;
}
.upgrade-header p {
  color: var(--text-dim);
  font-size: 14px;
}
.upgrade-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.step {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.step-num {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.step-text {
  font-weight: 600;
  font-size: 15px;
}
.wallet-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.wallet-box span {
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  flex: 1;
}
.btn-copy {
  background: var(--surface-2);
  border: none;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}
.step-note {
  font-size: 13px;
  color: var(--text-dim);
}
.tx-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  margin-bottom: 8px;
}
.tx-input:focus {
  outline: none;
  border-color: var(--text-dim);
}
.btn-unlock {
  width: 100%;
}
.upgrade-result {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--green);
  border-radius: 8px;
}
.rewrite-header {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--green);
}
.rewrite-text {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.btn-copy-text {
  margin-top: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 20px 0;
}
.footer p { margin-bottom: 4px; }
.footer a { color: var(--text-dim); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 600px) {
  .hero-title { font-size: 22px; }
  .score-number { font-size: 48px; }
  .verdict-title { font-size: 18px; }
  .word-item { flex-direction: column; align-items: flex-start; gap: 4px; }
  .word-snark { width: 100%; }
}
