/* ClustalOmega Web App — matches portfolio Graphite theme */
:root {
  --bg: #d4d4d4;
  --surface: rgba(255,255,255,0.50);
  --surface-hover: rgba(255,255,255,0.65);
  --border: rgba(141,0,0,0.18);
  --accent: #8d0000;
  --accent-dim: rgba(141,0,0,0.10);
  --text: #181717;
  --text-muted: #656464;
  --radius: 12px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Header ── */
header {
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
header .logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-decoration: none;
}
header .back-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}
header .back-link:hover { color: var(--text); }

/* ── Main container ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.page-title span { color: var(--accent); }
.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

/* ── Tab buttons ── */
.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.tab-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  font-family: var(--font);
  transition: all 0.2s;
}
.tab-btn:hover { background: var(--surface-hover); color: var(--text); }
.tab-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--text);
}

/* ── Input panels ── */
.input-panel { display: none; }
.input-panel.active { display: block; }

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

textarea, input[type="text"], select, input[type="file"] {
  width: 100%;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
textarea:focus, input[type="text"]:focus, select:focus { border-color: var(--accent); }

textarea { min-height: 180px; }
select { font-family: var(--font); cursor: pointer; }
select option { background: #d4d4d4; color: #181717; }

input[type="file"] { cursor: pointer; padding: 0.6rem 1rem; }

/* ── Format row ── */
.format-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.format-row label { margin: 0; white-space: nowrap; }
.format-row select { max-width: 220px; }

/* ── Submit button ── */
.btn-run {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.2s, transform 0.2s;
  margin-top: 1.5rem;
}
.btn-run:hover { opacity: 0.85; transform: translateY(-1px); }

/* ── Result page ── */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.result-meta { font-size: 0.85rem; color: var(--text-muted); }
.result-meta span { color: var(--text); font-weight: 600; }

.alignment-block {
  background: rgba(255,255,255,0.60);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  white-space: pre;
  max-height: 520px;
  overflow-y: auto;
}

.btn-download {
  display: inline-block;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-download:hover { background: var(--accent); color: #fff; }

.btn-back {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-left: 1rem;
}
.btn-back:hover { color: var(--text); }

/* ── Error box ── */
.error-box {
  background: rgba(141,0,0,0.08);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  color: #7a0000;
  margin-bottom: 1.5rem;
}
.error-box strong { color: #8d0000; }

/* ── Flash ── */
.flashes { list-style: none; margin-bottom: 1rem; }
.flashes li {
  background: rgba(141,0,0,0.08);
  border-left: 3px solid var(--accent);
  padding: 0.7rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #7a0000;
}

/* ── Helper note ── */
.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

@media (max-width: 600px) {
  .container { padding: 2rem 1rem; }
  .page-title { font-size: 1.5rem; }
  .format-row { flex-direction: column; align-items: flex-start; }
  .format-row select { max-width: 100%; }
}
