/* BookFlow Customer Portal — Design Tokens (Light Theme) */

:root {
  --bg-primary:       #ffffff;
  --bg-secondary:     #f8f9fa;
  --bg-elevated:      #ffffff;
  --bg-hover:         #f1f3f4;
  --bg-active:        #e8eaed;

  --text-primary:     #1a1a2e;
  --text-secondary:   #5f6368;
  --text-muted:       #9aa0a6;

  --border-primary:   #dadce0;
  --border-subtle:    #e8eaed;
  --border-accent:    #667eea;

  --color-success:    #34a853;
  --color-success-bg: rgba(52,168,83,0.08);
  --color-warning:    #fbbc04;
  --color-warning-bg: rgba(251,188,4,0.08);
  --color-error:      #ea4335;
  --color-error-bg:   rgba(234,67,53,0.08);
  --color-info:       #4285f4;
  --color-info-bg:    rgba(66,133,244,0.08);

  --accent:           #667eea;
  --accent-hover:     #5a6fd6;
  --accent-bg:        rgba(102,126,234,0.08);

  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;
  --space-3xl:  64px;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  --font-sans:  "Inter", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  --font-mono:  "JetBrains Mono", "Fira Code", "Consolas", monospace;
  --text-xs:    12px;
  --text-sm:    13px;
  --text-base:  14px;
  --text-lg:    16px;
  --text-xl:    20px;
  --text-2xl:   24px;
  --text-3xl:   32px;
  --text-4xl:   40px;

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.12);

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --nav-height: 64px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); background: var(--bg-secondary); color: var(--text-primary); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }

/* === Top Navigation === */
.topnav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  z-index: 100;
}

.topnav-brand {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: var(--text-xl); font-weight: 700; color: var(--text-primary);
}

.topnav-brand-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: var(--text-lg);
}

.topnav-links {
  display: flex; gap: var(--space-xl);
}

.topnav-link {
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: 500;
  padding: var(--space-sm) 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.topnav-link:hover { color: var(--text-primary); }
.topnav-link.active { color: var(--accent); border-bottom-color: var(--accent); }

.topnav-user {
  display: flex; align-items: center; gap: var(--space-sm);
  cursor: pointer; padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
}

.topnav-user:hover { background: var(--bg-hover); }

.topnav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: var(--text-sm); font-weight: 600;
}

/* === Page Content === */
.page-content {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl);
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-xl);
}

/* === Hero / Search === */
.hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
}

.hero h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.hero p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.search-box {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  height: 52px;
  padding: 0 var(--space-xl);
  padding-left: 48px;
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-xl);
  font-size: var(--text-lg);
  font-family: var(--font-sans);
  background: var(--bg-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
}

.search-icon {
  position: absolute;
  left: var(--space-lg);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--text-xl);
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 40px;
  padding: 0 var(--space-lg);
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
}

.search-btn:hover { background: var(--accent-hover); }

.hot-tags {
  margin-top: var(--space-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.hot-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  margin: 2px;
  cursor: pointer;
}

.hot-tag:hover { background: var(--bg-active); }

/* === Feature Cards === */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  max-width: 800px;
  margin: 0 auto var(--space-2xl);
}

.feature-card {
  text-align: center;
  padding: var(--space-xl);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.feature-icon {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-sm);
}

.feature-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* === Result Cards === */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.result-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: all var(--transition-fast);
}

.result-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.result-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.result-cover {
  width: 60px; height: 80px;
  background: var(--accent-bg);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-2xl);
  flex-shrink: 0;
}

.result-info h3 {
  font-size: var(--text-lg);
  margin-bottom: 2px;
}

.result-meta {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.result-badges {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.result-actions {
  display: flex;
  gap: var(--space-sm);
}

/* === Buttons (Customer) === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }

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

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-info    { background: var(--color-info-bg);    color: var(--color-info); }
.badge-muted   { background: var(--bg-hover);         color: var(--text-muted); }
.badge-accent  { background: var(--accent-bg);        color: var(--accent); }

/* === Compare View === */
.compare-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: calc(100vh - var(--nav-height) - 100px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.compare-panel {
  padding: var(--space-xl);
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
}

.compare-panel:last-child { border-right: none; }

.compare-panel-header {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.compare-text {
  font-size: var(--text-base);
  line-height: 1.8;
}

/* === Progress Bar === */
.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  background: var(--color-info);
  transition: width 500ms ease;
}

.progress-text {
  text-align: center;
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* === File List === */
.file-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.file-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-2xl);
  flex-shrink: 0;
}

.file-icon.pdf { background: var(--color-error-bg); }
.file-icon.md  { background: var(--color-info-bg); }

.file-info { flex: 1; }
.file-info h4 { font-size: var(--text-base); margin-bottom: 2px; }
.file-meta { font-size: var(--text-sm); color: var(--text-secondary); }
.file-actions { display: flex; gap: var(--space-sm); }

/* === Utility === */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: var(--text-sm); }
.mt-xl       { margin-top: var(--space-xl); }
.mb-lg       { margin-bottom: var(--space-lg); }
