/* Styling
   Color scheme from hitsave.org: purple gradient, pink accent, teal secondary */

:root {
  /* Hit Save palette */
  --hitsave-accent: #d82e53;
  --hitsave-teal: #00BEC1;
  --hitsave-purple: #6d327c;
  --hitsave-blue: #485DA6;
  --hitsave-green: #32b37b;

  --bg-dark: #1e1528;
  --bg-panel: rgba(109, 50, 124, 0.25);
  --bg-elevated: rgba(72, 93, 166, 0.2);
  --accent: var(--hitsave-accent);
  --accent-dim: #b82547;
  --accent-glow: rgba(216, 46, 83, 0.25);
  --accent-teal: var(--hitsave-teal);
  --text: #f0eef2;
  --text-muted: #b8a8c4;
  --success: var(--hitsave-green);
  --border: rgba(109, 50, 124, 0.5);
  --radius: 8px;
  --font-sans: 'Poppins', 'Montserrat', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(216, 46, 83, 0.15) 0%, transparent 50%),
    linear-gradient(135deg, #2a1a3d 0%, #1e2840 40%, #152a2e 100%);
}

#app {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-shadow: 0 0 24px var(--accent-glow);
  margin-bottom: 0.25rem;
}

.title a {
  color: inherit;
  text-decoration: none;
}

.title a:hover {
  opacity: 0.9;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.chapter-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
}

#chapter-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 100px;
}

.progress-bar {
  flex: 1;
  max-width: 200px;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hitsave-purple), var(--accent));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.chapter-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.chapter-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s ease;
}

.chapter-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.chapter-link.current {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(216, 46, 83, 0.15);
}

.chapter-link.locked {
  opacity: 0.5;
}

.chapter-link.locked:hover {
  opacity: 0.8;
}

/* Main content */
.main {
  flex: 1;
}

/* Chapter intro */
.chapter-intro {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.chapter-intro h2 {
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 600;
}

.chapter-intro p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

#chapter-objectives {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
}

#chapter-objectives li {
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dim);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

/* Workspace */
.workspace {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.workspace-header {
  margin-bottom: 1.5rem;
}

.workspace-header h3 {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tool-btn.done {
  color: var(--success);
  border-color: var(--success);
  background: rgba(126, 179, 106, 0.1);
}

.tool-icon {
  font-size: 1.1rem;
}

.workspace-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .workspace-content {
    grid-template-columns: 1fr;
  }
}

.item-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: rgba(0, 190, 193, 0.05);
  border-radius: var(--radius);
  border: 1px dashed rgba(0, 190, 193, 0.3);
}

.preservation-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.item-visual {
  font-size: 4rem;
  filter: grayscale(0.3);
  opacity: 0.9;
}

.preservation-item[class*="cleaned-"] .item-visual {
  filter: grayscale(0);
  opacity: 1;
}

.item-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.instructions-panel {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.instructions-panel h4 {
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.instructions p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.step-num {
  font-family: var(--font-mono);
  color: var(--accent);
  min-width: 1.5rem;
}

.do-not-use {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(180, 80, 60, 0.15);
  border: 1px solid rgba(180, 80, 60, 0.4);
  border-radius: var(--radius);
}

.do-not-use summary {
  cursor: pointer;
  font-weight: 600;
  color: #e8a0a8;
}

.do-not-use-item {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.do-not-use-item strong {
  color: var(--text);
}

.do-not-use a {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--accent);
}

.reference {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.reference a {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

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

.workspace-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Chapter complete */
.chapter-complete {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.complete-content {
  max-width: 400px;
  margin: 0 auto;
}

.complete-icon {
  font-size: 3rem;
  color: var(--success);
  margin-bottom: 1rem;
}

.chapter-complete h2 {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.chapter-complete p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.final-links {
  font-size: 0.9rem;
  margin-bottom: 1.5rem !important;
}

.final-links a {
  color: var(--accent);
  text-decoration: none;
}

.final-links a:hover {
  text-decoration: underline;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Footer */
.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

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