/* ═══════════════════════════════════════════
   FOCUSFLOW — BIONIC READING & ACCESSIBILITY
   Zero-bloat Vanilla CSS Design System
   ═══════════════════════════════════════════ */

:root {
  /* Color Palette (Slate/Indigo) */
  --bg-main: #030712;        /* slate-950 */
  --bg-surface: #090d16;     /* dark slate */
  --bg-card: #0f172a;        /* slate-900 */
  
  --border-color: #1e293b;   /* slate-800 */
  --border-focus: #4f46e5;   /* indigo-600 */
  
  --text-primary: #f8fafc;   /* slate-50 */
  --text-secondary: #94a3b8; /* slate-400 */
  --text-muted: #475569;     /* slate-600 */
  
  --accent-color: #6366f1;   /* indigo-500 */
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.15);
  
  /* Reader CSS Variables (Driven by JS Sliders) */
  --reader-font-size: 18px;
  --reader-line-height: 1.8;
  --reader-letter-spacing: 0.05em;
  --reader-bold-opacity: 1;

  /* Typography families */
  --family-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --family-serif: 'Lora', Georgia, serif;
  --family-dyslexic: 'OpenDyslexic', 'Comic Sans MS', sans-serif;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--family-sans);
  line-height: 1.5;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Background aesthetic glow */
.bg-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, rgba(3, 7, 18, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
/* ─── Persistent Micro Navbar ─── */
.navbar {
  border-bottom: 1px solid var(--border-color);
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  z-index: 50;
  position: sticky;
  top: 0;
  height: 48px;
  display: flex;
  align-items: center;
}

.navbar-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.brand-icon-wrapper {
  color: var(--accent-color);
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.brand-link:hover .brand-icon-wrapper {
  color: var(--accent-hover);
}

.brand-text {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.brand-text-accent {
  color: var(--accent-color);
}

.brand-link:hover .brand-text {
  color: #fff;
}

.tool-pill-wrapper {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.tool-pill-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .tool-pill-label {
    display: none;
  }
}

.tool-pill-nav {
  display: flex;
  align-items: center;
}

.tool-pill-active {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-color);
  border: 1px solid rgba(99, 102, 241, 0.2);
  text-decoration: none;
}

.right-cluster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.portal-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.github-link {
  display: flex;
  align-items: center;
  padding: 0.375rem;
  border-radius: 0.375rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
  text-decoration: none;
}

.github-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ═══════════════════════════════════════════
   WORKSPACE (Split pane layout)
   ═══════════════════════════════════════════ */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* ─── LEFT SIDEBAR (Controls) ─── */
.sidebar {
  width: 40%;
  max-width: 440px;
  min-width: 320px;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
}

.sidebar-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  flex: 1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.sidebar-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.btn-text {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-text:hover {
  color: var(--text-primary);
}

/* Textarea input */
textarea {
  width: 100%;
  height: 220px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  color: var(--text-primary);
  font-family: var(--family-sans);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Settings block */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: 0.75rem;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.setting-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Selection control */
.form-select {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem;
  border-radius: 0.5rem;
  outline: none;
  font-family: var(--family-sans);
  font-size: 0.9rem;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--border-focus);
}

/* Sliders */
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-color);
  font-family: monospace;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 9999px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--accent-hover);
  transform: scale(1.15);
}

/* Sidebar disclaimer */
.sidebar-footer {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.sidebar-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── RIGHT PANE (Reader Viewport) ─── */
.reader-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 3rem 2rem;
  background: var(--bg-main);
  display: flex;
  justify-content: center;
}

#reader-container {
  width: 100%;
  max-width: 1000px;
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
  letter-spacing: var(--reader-letter-spacing);
  transition: all 0.1s ease;
}

/* Reader Typography Styles */
#reader-container.font-inter { font-family: var(--family-sans); }
#reader-container.font-lora { font-family: var(--family-serif); }
#reader-container.font-dyslexic { font-family: var(--family-dyslexic); }

/* Bionic bold styles */
#reader-container strong {
  font-weight: 700;
  color: var(--text-primary);
  opacity: var(--reader-bold-opacity);
}

/* Standard word styles */
#reader-container span {
  color: var(--text-secondary);
}

#reader-container p {
  margin-bottom: 2rem;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem;
  gap: 1.25rem;
  border: 1px dashed var(--border-color);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.01);
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════ */
@media (max-width: 860px) {
  body {
    overflow-y: auto;
    height: auto;
  }
  .workspace {
    flex-direction: column;
    overflow: visible;
  }
  .sidebar {
    width: 100%;
    max-width: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    overflow-y: visible;
  }
  .reader-viewport {
    padding: 2.5rem 1.5rem;
    overflow-y: visible;
  }
  .sponsor-banner-placeholder {
    width: 100%;
    max-width: 728px;
    height: 60px;
  }
}

/* ─── SPONSOR / PROMO SLOTS (ADBLOCK SAFE) ─── */
.sidebar-promo {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.promo-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.promo-text {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.promo-box-container {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  height: 250px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.promo-box-container:hover {
  border-color: rgba(99, 102, 241, 0.2);
}

.promo-placeholder {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.2);
  text-align: center;
}

.bottom-sponsor-container {
  width: 100%;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 0.5rem 0;
  display: flex;
  justify-content: center;
}

.sponsor-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.sponsor-notice-text {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sponsor-banner-placeholder {
  width: 100%;
  max-width: 728px;
  height: 90px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
}

.sponsor-banner-placeholder:hover {
  border-color: rgba(99, 102, 241, 0.2);
}

.sponsor-banner-placeholder span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.2);
}


