/**
 * localdoc.org — Modern Clean Design System (css/main.css)
 * Light-first clean aesthetic, crisp typography, compact dropzones, full camera scanner HUD
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand Accent Colors */
  --primary: #0284C7;
  --primary-glow: rgba(2, 132, 199, 0.2);
  --primary-hover: #0369A1;
  --primary-subtle: #F0F9FF;
  --primary-dark: #075985;

  --accent-emerald: #059669;
  --accent-emerald-subtle: #ECFDF5;
  
  --amber: #D97706;
  --amber-subtle: #FFFBEB;

  /* Crisp Light Theme (Default) */
  --bg-body: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-glass: rgba(255, 255, 255, 0.92);
  
  --line: #E2E8F0;
  --line-light: #F1F5F9;
  --line-glow: rgba(2, 132, 199, 0.15);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.1);
  --danger: #DC2626;
  --danger-bg: rgba(220, 38, 38, 0.1);

  /* Shadows & Radii */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Optional Dark Theme */
[data-theme="dark"] {
  --bg-body: #0F172A;
  --bg-surface: #1E293B;
  --bg-card: #1E293B;
  --bg-card-hover: #273549;
  --bg-glass: rgba(30, 41, 59, 0.9);

  --line: #334155;
  --line-light: #1E293B;
  --line-glow: rgba(2, 132, 199, 0.25);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.5);
}

/* Reset & Basics */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--primary-hover);
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-body);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--line);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.lang-select-wrap select {
  background: var(--bg-body);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

/* Tool Workspace HUD */
.tool-workspace {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-top: 20px;
}

.tool-workspace-header {
  text-align: center;
  margin-bottom: 24px;
}

.tool-workspace-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--primary-subtle);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.tool-workspace h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.tool-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

/* Compact Drop Zone */
.drop-zone {
  border: 2px dashed var(--line);
  background: var(--bg-body);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 20px;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.drop-zone-icon img {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
}

.drop-zone-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.drop-zone-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-decoration: none;
}

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-lg {
  padding: 10px 24px;
  font-size: 0.95rem;
}

/* 3-Step Progress HUD */
.workflow-progress-container {
  margin-top: 24px;
  background: var(--bg-body);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
}

.workflow-steps-indicator {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 16px;
}

.workflow-step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.workflow-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--line);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.workflow-step-node.active .workflow-step-circle {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.workflow-step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.workflow-step-node.active .workflow-step-label {
  color: var(--text-primary);
}

.workflow-progress-track {
  height: 6px;
  background: var(--line);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.workflow-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.workflow-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Result Card */
.result-card {
  margin-top: 24px;
  background: var(--bg-body);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-details h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.result-details p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* CamScanner Studio Specific Controls */
.scanner-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.scanner-viewport {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--line);
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.scanner-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-body);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.scanner-thumb {
  position: relative;
  aspect-ratio: 3/4;
  background: #fff;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--line);
}

.scanner-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-thumb-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
  padding: 40px 0 24px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-links {
  list-style: none;
}

.footer-link {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 2;
}
.footer-link:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .nav-links {
    display: none;
  }
}
