/* ============================================
   BETA READER - Premium Design System
   Modern, beautiful, polished UI
   ============================================ */

/* ============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================ */
:root {
  /* Colors - Rich dark theme with vibrant accents */
  --primary: #8B5CF6;
  --primary-light: #A78BFA;
  --primary-dark: #7C3AED;
  --primary-glow: rgba(139, 92, 246, 0.4);

  --secondary: #06B6D4;
  --secondary-light: #22D3EE;
  --secondary-dark: #0891B2;

  --accent: #F472B6;
  --accent-light: #F9A8D4;

  --success: #10B981;
  --success-light: #34D399;
  --warning: #F59E0B;
  --error: #EF4444;
  --error-light: #FCA5A5;

  /* Backgrounds - Deep, rich darks */
  --bg-primary: #0A0A0F;
  --bg-secondary: #111118;
  --bg-tertiary: #1A1A24;
  --bg-elevated: #222230;
  --bg-hover: #2A2A3A;

  /* Surfaces with glassmorphism */
  --surface: rgba(26, 26, 36, 0.8);
  --surface-light: rgba(42, 42, 58, 0.6);
  --surface-border: rgba(139, 92, 246, 0.2);
  --surface-border-hover: rgba(139, 92, 246, 0.4);

  /* Text */
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-tertiary: #71717A;
  --text-inverse: #0A0A0F;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
  --gradient-secondary: linear-gradient(135deg, #F472B6 0%, #8B5CF6 100%);
  --gradient-dark: linear-gradient(180deg, #0A0A0F 0%, #111118 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  --gradient-mesh:
    radial-gradient(at 40% 20%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(244, 114, 182, 0.1) 0px, transparent 50%),
    radial-gradient(at 80% 50%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);
  --shadow-glow-sm: 0 0 20px rgba(139, 92, 246, 0.2);

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-light: rgba(255, 255, 255, 0.12);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cal Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index layers */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-tooltip: 500;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background mesh gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  z-index: -1;
}

/* Selection styling */
::selection {
  background: var(--primary);
  color: white;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary);
}

/* Gradient text utility */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm {
  max-width: 640px;
}

.container-md {
  max-width: 768px;
}

.container-lg {
  max-width: 1024px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: var(--space-md) 0;
  transition: all var(--transition-base);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

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

.navbar-brand svg {
  width: 32px;
  height: 32px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.navbar-nav a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.navbar-nav a:hover {
  color: var(--text-primary);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-sm);
}

@media (max-width: 768px) {
  .navbar-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .navbar-actions {
    gap: var(--space-sm);
  }

  .navbar-actions .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .navbar-brand {
    font-size: 1.25rem;
  }

  .navbar-brand svg {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .navbar-actions .btn-secondary {
    display: none;
  }

  .navbar-brand span {
    display: none;
  }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary button with glow */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md), 0 0 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary button */
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color-light);
  backdrop-filter: blur(10px);
}

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

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface-light);
  color: var(--text-primary);
}

/* Outline button */
.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(139, 92, 246, 0.1);
}

/* Danger button */
.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #DC2626;
}

/* Button sizes */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.0625rem;
}

.btn-xl {
  padding: 1.25rem 2.5rem;
  font-size: 1.125rem;
}

/* Icon button */
.btn-icon {
  padding: 0.75rem;
  aspect-ratio: 1;
}

/* Button loading state */
.btn.loading {
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Google button */
.btn-google {
  background: white;
  color: #333;
  border: 1px solid var(--border-color);
}

.btn-google:hover {
  background: #F5F5F5;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--surface-border-hover);
  box-shadow: var(--shadow-lg);
}

.card-glow {
  position: relative;
}

.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
}

.card-glow:hover::before {
  opacity: 0.1;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-left: 0.25rem;
}

/* Base input styling for all form elements */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
textarea,
select,
.form-input,
.input {
  width: 100%;
  padding: 0.875rem 1.125rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: rgba(42, 42, 58, 0.6);
  border: 1.5px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="url"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="search"]:hover,
input[type="tel"]:hover,
textarea:hover,
select:hover,
.form-input:hover,
.input:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(50, 50, 70, 0.7);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus,
.form-input:focus,
.input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(55, 55, 78, 0.8);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(139, 92, 246, 0.2),
    0 0 20px rgba(139, 92, 246, 0.15);
}

input::placeholder,
textarea::placeholder,
.form-input::placeholder,
.input::placeholder {
  color: var(--text-tertiary);
  transition: opacity var(--transition-fast);
}

input:focus::placeholder,
textarea:focus::placeholder,
.form-input:focus::placeholder,
.input:focus::placeholder {
  opacity: 0.5;
}

input:disabled,
textarea:disabled,
select:disabled,
.form-input:disabled,
.input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(30, 30, 42, 0.5);
}

/* Textarea */
textarea,
textarea.form-input,
textarea.input {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

/* Select dropdown arrow */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.75rem;
  cursor: pointer;
}

/* Number input - hide spinner on webkit */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Date input styling */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

/* Form select - extends base select styles */
.form-select {
  /* Inherits all base select styles */
}

/* Global Busy State */
.busy-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast);
}

.busy-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.busy-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.busy-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.busy-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

body.is-busy button,
body.is-busy select,
body.is-busy input,
body.is-busy a {
  pointer-events: none;
}

/* Chip Select - Compact inline selects for status/filters */
.chip-select {
  appearance: none;
  width: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 0.4rem 2.25rem 0.4rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background-color: rgba(26, 26, 36, 0.6);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  box-shadow: none;
}

.chip-select:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background-color: rgba(42, 42, 58, 0.7);
  transform: translateY(-1px);
}

.chip-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow:
    0 0 0 2px rgba(139, 92, 246, 0.2),
    0 0 12px rgba(139, 92, 246, 0.1);
}

/* Status variants */
.chip-select--draft {
  background-color: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.3);
  color: #94A3B8;
}

.chip-select--seeking {
  background-color: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--primary-light);
}

.chip-select--active {
  background-color: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--secondary-light);
}

.chip-select--complete {
  background-color: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success-light);
}

/* Info chip - non-interactive display */
.chip-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  background-color: rgba(26, 26, 36, 0.6);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: auto;
  white-space: nowrap;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-check input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--primary);
}

/* Error state */
.form-input.error,
.input.error {
  border-color: var(--error);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(239, 68, 68, 0.15),
    0 0 20px rgba(239, 68, 68, 0.1);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--error-light);
  margin-left: 0.25rem;
  margin-top: 0.25rem;
}

/* ============================================
   HERO SECTION (Landing Page)
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.6s ease-out;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-title span {
  display: block;
}

.hero-description {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-3xl);
  margin-top: var(--space-4xl);
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

/* Hero background elements */
.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  pointer-events: none;
}

.hero-glow-1 {
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
}

.hero-glow-2 {
  bottom: -100px;
  right: -200px;
  background: var(--secondary);
  opacity: 0.2;
}

/* Floating elements animation */
.hero-float {
  position: absolute;
  animation: float 6s ease-in-out infinite;
}

.hero-float-1 {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.hero-float-2 {
  top: 30%;
  right: 10%;
  animation-delay: 1s;
}

.hero-float-3 {
  bottom: 30%;
  left: 15%;
  animation-delay: 2s;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features {
  padding: var(--space-4xl) 0;
  position: relative;
}

.features-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-4xl);
}

.features-header h2 {
  margin-bottom: var(--space-md);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.feature-card {
  padding: var(--space-2xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  transition: all var(--transition-slow);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--surface-border-hover);
  box-shadow: var(--shadow-xl), var(--shadow-glow-sm);
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  font-size: 1.5rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.feature-card p {
  font-size: 0.9375rem;
}

/* ============================================
   HOW IT WORKS SECTION
   ============================================ */
.how-it-works {
  padding: var(--space-4xl) 0;
  background: var(--bg-secondary);
}

.steps-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
}

.step-card {
  text-align: center;
  padding: var(--space-xl);
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 auto var(--space-lg);
}

.step-card h3 {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

/* Connector line between steps */
.step-card:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 24px;
  left: calc(50% + 40px);
  width: calc(100% - 80px);
  height: 2px;
  background: var(--border-color);
}

@media (max-width: 768px) {
  .step-card::after {
    display: none;
  }
}

/* ============================================
   TESTIMONIALS SECTION
   ============================================ */
.testimonials {
  padding: var(--space-4xl) 0;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
}

.testimonial-card {
  padding: var(--space-2xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
}

.testimonial-content {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.testimonial-info h4 {
  font-size: 1rem;
  margin-bottom: 0.125rem;
}

.testimonial-info p {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

/* ============================================
   PRICING SECTION
   ============================================ */
.pricing {
  padding: var(--space-4xl) 0;
  background: var(--bg-secondary);
}

.pricing-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-3xl);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  padding: var(--space-2xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-primary);
  color: white;
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.pricing-price {
  margin-bottom: var(--space-xl);
}

.pricing-price .amount {
  font-size: 3rem;
  font-weight: 700;
}

.pricing-price .period {
  color: var(--text-tertiary);
}

.pricing-features {
  list-style: none;
  margin-bottom: var(--space-xl);
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  color: var(--text-secondary);
}

.pricing-features li::before {
  content: '';
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center;
  flex-shrink: 0;
}

.pricing-card .btn {
  width: 100%;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta {
  padding: var(--space-4xl) 0;
  text-align: center;
}

.cta-content {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-4xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  position: relative;
  overflow: hidden;
}

.cta-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.cta h2 {
  margin-bottom: var(--space-md);
}

.cta p {
  margin-bottom: var(--space-xl);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: var(--space-4xl) 0 var(--space-xl);
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.footer-brand {
  max-width: 300px;
}

.footer-brand p {
  margin-top: var(--space-md);
  font-size: 0.9375rem;
}

.footer-column h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-lg);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.footer-social {
  display: flex;
  gap: var(--space-md);
}

.footer-social a {
  color: var(--text-tertiary);
}

.footer-social a:hover {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

/* ============================================
   AUTH SECTION (Landing Page)
   ============================================ */
.auth-section {
  padding: var(--space-4xl) 0;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--space-2xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(20px);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin: var(--space-md) 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard {
  padding: var(--space-2xl) 0;
}

.dashboard-header {
  margin-bottom: var(--space-2xl);
}

.dashboard-title {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
}

.dashboard-subtitle {
  color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  text-align: center;
  transition: all var(--transition-base);
}

.stat-card:hover {
  border-color: var(--surface-border-hover);
}

.stat-card h3 {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

/* Welcome Card */
.welcome-card {
  padding: var(--space-2xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-2xl);
}

.welcome-card h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

/* Quick Actions */
.quick-actions {
  margin-bottom: var(--space-2xl);
}

.quick-actions h3 {
  margin-bottom: var(--space-lg);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-base);
}

.action-card:hover:not(.disabled) {
  transform: translateY(-2px);
  border-color: var(--surface-border-hover);
  box-shadow: var(--shadow-lg);
}

.action-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  font-size: 1.25rem;
}

/* ============================================
   ONBOARDING
   ============================================ */
.onboarding {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-2xl) 0;
}

.onboarding-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.onboarding-header h1 {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

/* Progress Bar */
.progress-container {
  margin-bottom: var(--space-3xl);
}

.progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.progress {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

.progress-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

/* Role Selection */
.role-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.role-card {
  padding: var(--space-2xl);
  background: var(--surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-2xl);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.role-card:hover {
  border-color: var(--surface-border-hover);
}

.role-card.selected {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow-sm);
}

.role-card-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  margin: 0 auto var(--space-lg);
  font-size: 2rem;
}

.role-card.selected .role-card-icon {
  background: var(--gradient-primary);
}

.role-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.role-card p {
  font-size: 0.9375rem;
}

/* Onboarding Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.step {
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
}

.step.active {
  border-color: var(--primary);
}

.step.completed {
  border-color: var(--success);
}

.step-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.step-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
  font-weight: 600;
  transition: all var(--transition-base);
}

.step.completed .step-icon {
  background: var(--success);
  color: white;
}

.step h3 {
  font-size: 1.125rem;
}

.step p {
  margin-bottom: var(--space-md);
  font-size: 0.9375rem;
}

/* Genre Selection Grid */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.genre-chip {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.genre-chip:hover {
  border-color: var(--primary);
}

.genre-chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Onboarding Complete */
.onboarding-complete {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
}

.onboarding-complete-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--success);
  border-radius: 50%;
  margin: 0 auto var(--space-xl);
  font-size: 2.5rem;
  animation: scaleIn 0.5s var(--transition-bounce);
}

.onboarding-complete h2 {
  color: var(--success);
  margin-bottom: var(--space-md);
}

/* ============================================
   SETTINGS PAGE
   ============================================ */
.settings {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-2xl) 0;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.settings-card {
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
}

.settings-card h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.account-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
}

.info-row span:first-child {
  color: var(--text-tertiary);
}

.danger-zone {
  border-color: rgba(239, 68, 68, 0.3);
}

.danger-title {
  color: var(--error);
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

/* ============================================
   BILLING PAGE
   ============================================ */
.billing {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-2xl) 0;
}

.billing-card {
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-2xl);
}

.plan-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.plan-name {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.plan-status {
  padding: 0.25rem 0.75rem;
  background: var(--success);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* ============================================
   MANUSCRIPTS & BOOKS
   ============================================ */
.manuscripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.manuscript-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.manuscript-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.manuscript-cover {
  aspect-ratio: 3/4;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-tertiary);
}

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

.manuscript-info {
  padding: var(--space-lg);
}

.manuscript-info h3 {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.manuscript-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.manuscript-genre {
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

/* ============================================
   READER VIEW / CHAPTER READING
   ============================================ */
.reader-view {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.chapter-header {
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.chapter-number {
  font-size: 0.875rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.chapter-title {
  font-size: 2rem;
}

.chapter-content {
  font-size: 1.125rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

.chapter-content p {
  margin-bottom: var(--space-lg);
  color: inherit;
}

/* ============================================
   FEEDBACK COMPONENTS
   ============================================ */
.feedback-bubble {
  position: absolute;
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.feedback-bubble:hover {
  transform: scale(1.1);
}

.feedback-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 400px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  padding: var(--space-xl);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}

.feedback-panel.open {
  transform: translateX(0);
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
  margin: 0 auto var(--space-xl);
  font-size: 2rem;
  color: var(--text-tertiary);
}

.empty-state h3 {
  margin-bottom: var(--space-sm);
}

.empty-state p {
  margin-bottom: var(--space-xl);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.loading-overlay.hidden {
  display: none;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-elevated) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1rem;
  margin-bottom: var(--space-sm);
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: var(--space-md);
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* ============================================
   MESSAGES & ALERTS
   ============================================ */
.message {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
}

.message-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error-light);
}

.message-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success-light);
}

.message-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.error-message {
  color: var(--error);
  font-size: 0.875rem;
  text-align: center;
  min-height: 1.25rem;
}

.success-message {
  color: var(--success);
  font-size: 0.875rem;
  text-align: center;
  min-height: 1.25rem;
}

/* ============================================
   404 ERROR PAGE
   ============================================ */
.error-page {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  max-width: 500px;
  margin: 0 auto;
}

.error-code {
  font-size: 8rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-md);
}

.error-page h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.error-page p {
  margin-bottom: var(--space-xl);
}

.error-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-tertiary); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }
.visible { display: block !important; }

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--space-lg) 0;
}

.forgot-link {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  text-decoration: none;
  text-align: center;
  display: block;
}

.forgot-link:hover {
  color: var(--primary-light);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glow {
  0%, 100% { box-shadow: var(--shadow-glow-sm); }
  50% { box-shadow: var(--shadow-glow); }
}

/* Animation utilities */
.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease-out; }
.animate-fade-in-down { animation: fadeInDown 0.4s ease-out; }
.animate-scale-in { animation: scaleIn 0.3s ease-out; }
.animate-slide-in-right { animation: slideInRight 0.4s ease-out; }

/* Stagger animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 1024px) {
  .hero-stats {
    gap: var(--space-xl);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }

  .hero {
    padding: 6rem 0 3rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .features-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .btn-xl {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
  }

  .navbar,
  .footer,
  .btn {
    display: none;
  }
}

/* ============================================
   ENHANCED ANIMATIONS & MICRO-INTERACTIONS
   ============================================ */

/* Shimmer effect for loading states */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-elevated) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Skeleton loading */
.skeleton {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  animation: shimmer 1.5s infinite;
  background-size: 200% 100%;
}

/* Ripple effect for buttons */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

/* Card hover lift effect */
.card-hover {
  transition: all var(--transition-normal);
}

.card-hover:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow-xl), var(--shadow-glow-sm);
}

/* Icon rotate on hover */
.icon-rotate:hover svg {
  transform: rotate(15deg);
  transition: transform var(--transition-bounce);
}

/* Scale bounce on click */
.scale-bounce:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Floating animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Gradient text animation */
@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-text-animated {
  background: linear-gradient(
    90deg,
    var(--primary),
    var(--secondary),
    var(--accent),
    var(--primary)
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 5s ease infinite;
}

/* Typewriter effect */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--primary); }
}

.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--primary);
  white-space: nowrap;
  animation:
    typewriter 2s steps(40) 1s forwards,
    blink-caret 0.75s step-end infinite;
}

/* Staggered list animation */
.stagger-list > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fade-in-up 0.5s ease forwards;
}

.stagger-list > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-list > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-list > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-list > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-list > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-list > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-list > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-list > *:nth-child(8) { animation-delay: 0.4s; }

/* Success checkmark animation */
@keyframes checkmark-draw {
  0% {
    stroke-dashoffset: 50;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.checkmark-animated {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: checkmark-draw 0.5s ease forwards;
}

/* Notification badge bounce */
@keyframes badge-bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.badge-animated {
  animation: badge-bounce 0.3s ease;
}

/* Progress bar fill animation */
@keyframes progress-fill {
  from {
    width: 0;
  }
}

.progress-animated {
  animation: progress-fill 1s ease forwards;
}

/* Shake animation for errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.5s ease;
}

/* Tooltip animations */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

/* Focus ring animation */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--primary);
  animation: focus-pulse 1s ease;
}

@keyframes focus-pulse {
  0% {
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--primary);
  }
  50% {
    box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 8px rgba(139, 92, 246, 0.3);
  }
  100% {
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--primary);
  }
}

/* Magnetic hover effect */
.magnetic {
  transition: transform var(--transition-fast);
}

/* Counter animation */
@keyframes count-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.count-animated {
  animation: count-up 0.5s ease forwards;
}

/* Confetti burst (for success states) */
@keyframes confetti-fall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Page transition */
.page-enter {
  animation: page-enter 0.4s ease;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth scroll indicator */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 9999;
  transition: width var(--transition-fast);
}

/* Interactive card with 3D tilt effect */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform var(--transition-normal);
}

.tilt-card:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

/* Glow on hover */
.glow-hover {
  transition: all var(--transition-normal);
}

.glow-hover:hover {
  box-shadow: var(--shadow-glow);
}

/* Tab underline slide animation */
.tab-slider {
  position: relative;
}

.tab-slider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: var(--tab-width, 0);
  background: var(--primary);
  transform: translateX(var(--tab-offset, 0));
  transition: all var(--transition-normal);
}

/* Smooth expand/collapse */
.expandable {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-slow);
}

.expandable.expanded {
  grid-template-rows: 1fr;
}

.expandable > div {
  overflow: hidden;
}

/* ====================================================================================
   MODAL SYSTEM - IMPROVED UI WITH PROPER OVERLAYS
   ==================================================================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.3s ease;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  animation: overlay-fade-in 0.3s ease;
}

.modal-content {
  position: relative;
  z-index: 1001;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modal-slide-up 0.4s var(--ease-spring);
}

.modal-content.large {
  max-width: 800px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl);
  border-bottom: 2px solid var(--border-color);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--surface-light);
  color: var(--text-secondary);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.modal-close:hover {
  background: var(--color-danger);
  color: white;
  transform: rotate(90deg);
}

.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  flex-shrink: 0;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes overlay-fade-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
}

@keyframes modal-slide-up {
  from {
    transform: translateY(60px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal responsive */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: auto;
  }

  .modal-header {
    padding: var(--space-lg);
  }

  .modal-header h2 {
    font-size: 1.25rem;
  }

  .modal-close {
    width: 40px;
    height: 40px;
    font-size: 1.75rem;
  }

  .modal-body {
    padding: var(--space-lg);
  }
}

/* Modal backdrop blur animation */
.modal-backdrop {
  animation: backdrop-fade 0.3s ease;
}

@keyframes backdrop-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Success state animation */
.success-state {
  animation: success-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes success-bounce {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Notification slide in */
.notification-enter {
  animation: notification-slide 0.3s ease forwards;
}

@keyframes notification-slide {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Loading dots animation */
.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: loading-dot 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes loading-dot {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Text highlight animation */
.highlight-text {
  background: linear-gradient(120deg, var(--primary-glow) 0%, var(--primary-glow) 100%);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  background-position: 0 88%;
  transition: background-size 0.3s ease;
}

.highlight-text:hover {
  background-size: 100% 100%;
}

/* Smooth image reveal */
.image-reveal {
  clip-path: inset(0 100% 0 0);
  animation: reveal-image 0.8s ease forwards;
}

@keyframes reveal-image {
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* Interactive underline */
.interactive-underline {
  position: relative;
  text-decoration: none;
}

.interactive-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-normal);
}

.interactive-underline:hover::after {
  width: 100%;
}

/* ============================================
   CHAPTER VERSIONING STYLES
   ============================================ */

/* Version badge - small indicator for version number */
.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.version-badge.updated {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  margin-left: var(--space-sm);
}

/* Chapter update notice banner */
.chapter-update-notice {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  color: var(--warning);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}

.chapter-update-notice svg {
  flex-shrink: 0;
}

/* Chapter requirements notice - idiot proof checklist */
.chapter-requirements-notice {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.requirements-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.requirements-header svg {
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 2px;
}

.requirements-header strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.requirements-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.requirements-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.requirement-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.3s var(--ease-spring);
}

.requirement-item:not(.completed) {
  border-left: 4px solid var(--color-warning);
}

.requirement-item.completed {
  border-left: 4px solid var(--color-success);
  background: rgba(34, 197, 94, 0.05);
}

.requirement-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  background: var(--color-warning);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.requirement-item.completed .requirement-badge {
  background: var(--color-success);
  animation: checkmark-pop 0.4s var(--ease-spring);
}

@keyframes checkmark-pop {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.requirement-content {
  flex: 1;
}

.requirement-content strong {
  display: block;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.requirement-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.requirement-completed-text {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-success) !important;
  font-weight: 500;
}

.requirement-completed-text svg {
  flex-shrink: 0;
  color: var(--color-success);
}

.requirement-pending-text {
  color: var(--text-secondary) !important;
  font-weight: 400;
}

.requirement-done {
  display: inline-block;
  margin-top: var(--space-xs);
  color: var(--color-success);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Required badge on action buttons */
.required-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--color-warning);
  color: var(--text-primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.6);
  }
}

/* Large action button section */
.chapter-action-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 2px solid var(--border-color);
}

.action-section-header h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 0 0 var(--space-lg) 0;
  font-weight: 700;
}

.chapter-action-buttons-large {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.btn-action-large {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  background: var(--surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  width: 100%;
}

.btn-action-large:hover {
  background: var(--bg-hover);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-action-large.pending {
  border-left: 4px solid var(--color-warning);
  background: rgba(245, 158, 11, 0.05);
}

.btn-action-large.pending:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--color-warning);
}

.btn-action-large.completed {
  border-left: 4px solid var(--color-success);
  background: rgba(34, 197, 94, 0.05);
  opacity: 0.85;
}

.btn-action-large.completed:hover {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--color-success);
  opacity: 1;
}

.btn-action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.btn-action-large.pending .btn-action-icon {
  background: var(--color-warning);
  color: white;
}

.btn-action-large.completed .btn-action-icon {
  background: var(--color-success);
  color: white;
}

.btn-action-content {
  flex: 1;
}

.btn-action-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.btn-action-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.step-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--color-warning);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse-badge 2s ease-in-out infinite;
}

/* ====================================================================================
   NEW VERTICAL FLOW LAYOUT - SIMPLIFIED AND IDIOT-PROOF
   ==================================================================================== */

/* End of chapter section - everything stacks vertically */
.end-of-chapter-section {
  margin-top: var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Big action buttons - stacked */
.action-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.action-btn-big {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl);
  background: var(--surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  width: 100%;
}

.action-btn-big:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.action-btn-big.todo {
  border: 2px solid #F59E0B;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.1));
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
}

.action-btn-big.todo:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(251, 191, 36, 0.15));
  border-color: #F59E0B;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.action-btn-big.done {
  border: 2px solid #10B981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.1));
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
}

.action-btn-big.done:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(52, 211, 153, 0.15));
  border-color: #10B981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.action-btn-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex: 1;
}

.action-btn-num {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.action-btn-big.todo .action-btn-num {
  background: #F59E0B;
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.action-btn-big.done .action-btn-num {
  background: #10B981;
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.action-btn-text {
  flex: 1;
}

.action-btn-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.action-btn-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.action-btn-arrow {
  font-size: 2rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.action-required-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: #EF4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: pulse-badge 2s ease-in-out infinite;
}

/* Navigation buttons - stacked */
.nav-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.nav-btn-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  font-weight: 600;
}

.nav-btn-stack:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-btn-stack.primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.nav-btn-stack.primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.nav-btn-stack.secondary {
  background: var(--surface);
  color: var(--text-primary);
}

.nav-btn-stack.secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-tertiary);
  transform: translateX(-4px);
}

.nav-btn-stack.locked {
  background: var(--surface);
  color: var(--text-tertiary);
  cursor: not-allowed;
  opacity: 0.7;
}

.nav-btn-stack.locked:hover {
  transform: none;
  box-shadow: none;
}

/* Simple action buttons (when not locked) */
.simple-action-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.simple-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.simple-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Feedback list view modal */
.feedback-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-height: 60vh;
  overflow-y: auto;
  padding: var(--space-xs);
}

.feedback-list-item {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all 0.3s ease;
}

.feedback-list-item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feedback-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.feedback-type-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feedback-item-date {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.feedback-quoted-section {
  background: var(--surface-light);
  border-left: 3px solid var(--color-primary);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.feedback-item-content {
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  white-space: pre-wrap;
}

.feedback-author-response {
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--color-primary);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
}

.feedback-author-response strong {
  color: var(--color-primary);
  font-size: 0.9rem;
  display: block;
  margin-bottom: var(--space-xs);
}

.feedback-author-response p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

.btn-small {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text-primary);
}

.btn-small:hover {
  background: var(--bg-hover);
  border-color: var(--text-tertiary);
}

.btn-small.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.edit-feedback-textarea {
  width: 100%;
  min-height: 100px;
  padding: var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  background: var(--surface);
  color: var(--text-primary);
}

.edit-feedback-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .action-btn-big {
    padding: var(--space-lg);
  }

  .action-btn-num {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .action-btn-title {
    font-size: 1.1rem;
  }

  .action-btn-desc {
    font-size: 0.9rem;
  }

  .action-btn-arrow {
    font-size: 1.5rem;
  }

  .nav-btn-stack {
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
  }

  .feedback-list {
    max-height: 50vh;
  }

  .feedback-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .feedback-item-actions {
    flex-direction: column;
  }

  .btn-small {
    width: 100%;
    justify-content: center;
  }
}

/* Feedback helper notice */
.feedback-helper-notice {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: rgba(147, 197, 253, 0.15);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.feedback-helper-notice svg {
  flex-shrink: 0;
  color: var(--color-primary);
}

.feedback-helper-notice strong {
  color: var(--text-primary);
}

/* Old feedback notice - keeping for compatibility */
.chapter-feedback-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}

.chapter-feedback-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.chapter-feedback-notice strong {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.chapter-feedback-notice p {
  margin: 0;
  color: var(--text-secondary);
}

/* Locked chapter styles */
.chapter-list-item.locked {
  cursor: not-allowed !important;
  pointer-events: auto;
}

.chapter-list-item.locked:hover {
  background: var(--surface-light);
  transform: none;
}

.chapter-list-item.locked .chapter-number {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

/* Reader versions list (author view) */
.reader-versions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.reader-version-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface-light);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.reader-version-row:hover {
  background: var(--bg-hover);
  border-color: var(--border-color-light);
}

.reader-version-row .reader-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.reader-version-info {
  flex: 1;
  min-width: 0;
}

.reader-version-info h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.reader-version-meta {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.reader-version-status {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.reader-version-status.current {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.reader-version-status.outdated {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

/* Reader version row styling based on status */
.reader-version-row.current {
  border-color: rgba(16, 185, 129, 0.2);
}

.reader-version-row.outdated {
  border-color: rgba(245, 158, 11, 0.2);
}

/* Chapter list item version badge in reader view */
.chapter-list-item h4 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* ============================================
   CHAPTER RATING SYSTEM STYLES
   ============================================ */

/* Chapter rating modal */
.rating-intro {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-size: 0.95rem;
}

.rating-parameter {
  margin-bottom: var(--space-xl);
}

.rating-parameter:last-child {
  margin-bottom: 0;
}

.rating-label {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  font-size: 1rem;
}

.rating-scale-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  padding: 0 var(--space-sm);
  gap: var(--space-sm);
}

.scale-label-left,
.scale-label-center,
.scale-label-right {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.scale-label-left {
  flex: 1;
  text-align: left;
}

.scale-label-center {
  flex: 0 0 auto;
  color: var(--success);
  font-weight: 600;
}

.scale-label-right {
  flex: 1;
  text-align: right;
}

.rating-faces {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  padding: var(--space-md) 0;
}

.rating-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-sm);
  border: 2px solid transparent;
  background: var(--surface-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 75px;
  max-width: 85px;
}

.rating-face:hover {
  transform: translateY(-4px);
  background: var(--bg-hover);
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rating-face:active {
  transform: translateY(-2px) scale(0.98);
}

.rating-face.hovered {
  background: rgba(139, 92, 246, 0.08);
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.3);
}

.rating-face.selected {
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  animation: rating-pulse 2s ease-in-out infinite;
}

@keyframes rating-pulse {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  }
  50% {
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
  }
}

.rating-face.selected .face-emoji {
  transform: scale(1.1);
  animation: face-bounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes face-bounce {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1.1);
  }
}

.rating-face.selected .face-label {
  color: white;
  font-weight: 600;
}

.face-emoji {
  font-size: 2rem;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.rating-face:hover .face-emoji {
  transform: scale(1.15);
}

.face-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  user-select: none;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  word-wrap: break-word;
  hyphens: auto;
}

.rating-face:hover .face-label {
  color: var(--primary-light);
}

/* Rating parameter animation on modal open */
.rating-parameter {
  animation: rating-param-appear 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.rating-parameter:nth-child(1) { animation-delay: 0.05s; }
.rating-parameter:nth-child(2) { animation-delay: 0.1s; }
.rating-parameter:nth-child(3) { animation-delay: 0.15s; }
.rating-parameter:nth-child(4) { animation-delay: 0.2s; }

@keyframes rating-param-appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   MODERN RATING COMPONENTS
   ============================================ */

/* === Color system for ratings === */
:root {
  --rating-1-2: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  --rating-2-3: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --rating-3-4: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  --rating-4-5: linear-gradient(135deg, #10B981 0%, #059669 100%);
  --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* === SLIDER COMPONENT === */
.rating-slider {
  position: relative;
  padding: var(--space-lg) 0;
}

.slider-track {
  position: relative;
  height: 12px;
  background: linear-gradient(90deg, #EF4444 0%, #F59E0B 25%, #FBBF24 50%, #A3E635 75%, #10B981 100%);
  border-radius: var(--radius-full);
  margin: var(--space-md) 0;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: white;
  border: 3px solid var(--primary);
  border-radius: var(--radius-full);
  cursor: grab;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.slider-thumb:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.slider-thumb:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.05);
}

.slider-value-display {
  text-align: center;
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  background: var(--surface-light);
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-color);
}

.slider-value-display .value-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-sm);
  animation: emoji-pop 0.3s var(--ease-spring);
}

.slider-value-display .value-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

@keyframes emoji-pop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.slider-marks {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  margin-top: var(--space-md);
}

.slider-mark {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  user-select: none;
  font-weight: 500;
}

.slider-mark:nth-child(2) {
  font-size: 1.25rem;
}

/* === GAUGE COMPONENT === */
.rating-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
}

.gauge-display {
  text-align: center;
  padding: var(--space-xl);
  background: var(--surface-light);
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-color);
  min-width: 200px;
  transition: all 0.3s var(--ease-smooth);
}

.gauge-emoji-large {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: var(--space-sm);
  animation: emoji-pop 0.3s var(--ease-spring);
}

.gauge-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.gauge-segments {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

.gauge-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-sm);
  background: var(--surface-light);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  min-width: 60px;
}

.gauge-segment:hover {
  background: var(--bg-hover);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.gauge-segment.active {
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.segment-emoji {
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.2s var(--ease-spring);
}

.gauge-segment:hover .segment-emoji {
  transform: scale(1.2);
}

.gauge-segment.active .segment-emoji {
  transform: scale(1.1);
}

/* === BINARY COMPONENT (YES/NO BUTTONS) === */
.rating-binary {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
}

.binary-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-xl);
  background: var(--surface-light);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  min-width: 120px;
  font-family: var(--font-sans);
}

.binary-button:hover {
  background: var(--bg-hover);
  border-color: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.binary-button.active {
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.5);
}

.binary-icon {
  font-size: 3rem;
  line-height: 1;
  transition: transform 0.3s var(--ease-spring);
}

.binary-button:hover .binary-icon {
  transform: scale(1.2);
}

.binary-button.active .binary-icon {
  transform: scale(1.15);
  animation: binary-pulse 1.5s ease-in-out infinite;
}

@keyframes binary-pulse {
  0%, 100% {
    transform: scale(1.15);
  }
  50% {
    transform: scale(1.25);
  }
}

.binary-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.binary-button:hover .binary-label,
.binary-button.active .binary-label {
  color: white;
}

.binary-no:hover {
  border-color: var(--error);
}

.binary-yes:hover {
  border-color: var(--success);
}

/* === ENHANCED EMOJI/SENTIMENT COMPONENT === */
/* Already styled above, but add touch target enhancement */
.rating-face {
  min-height: 44px; /* Minimum touch target size for mobile */
}

/* === RATING TYPE ICON === */
.rating-type-icon {
  font-size: 1.25rem;
  margin-right: var(--space-sm);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

/* === INTERACTIVE FEEDBACK === */
.rating-interactive {
  position: relative;
}

.rating-interactive::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
  border-radius: inherit;
  pointer-events: none;
  transition: transform 0.3s var(--ease-spring);
}

.rating-interactive:active::after {
  transform: translate(-50%, -50%) scale(1.5);
  transition: transform 0.1s;
}

/* === SUCCESS ANIMATION === */
.rating-success-animation {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.success-checkmark {
  display: inline-block;
  margin-bottom: var(--space-lg);
}

.success-checkmark svg {
  color: var(--success);
  animation: checkmark-draw 0.8s ease forwards;
}

.success-checkmark circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: checkmark-circle 0.6s ease-in-out forwards;
}

.success-checkmark polyline {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkmark-check 0.3s 0.6s ease-in-out forwards;
}

.rating-success-animation h3 {
  color: var(--success);
  margin-bottom: var(--space-sm);
  animation: fade-in-up 0.5s 0.3s ease backwards;
}

.rating-success-animation p {
  color: var(--text-secondary);
  animation: fade-in-up 0.5s 0.4s ease backwards;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Rating faces responsive design */
@media (max-width: 640px) {
  .rating-faces {
    gap: 4px;
  }

  .rating-face {
    min-width: 60px;
    padding: var(--space-sm) 4px;
  }

  .face-emoji {
    font-size: 1.75rem;
  }

  .face-label {
    font-size: 0.65rem;
  }

  .slider-track {
    height: 10px;
  }

  .slider-thumb {
    width: 28px;
    height: 28px;
  }

  .gauge-display {
    min-width: 160px;
    padding: var(--space-lg);
  }

  .gauge-emoji-large {
    font-size: 3rem;
  }

  .gauge-label {
    font-size: 1rem;
  }

  .gauge-segments {
    gap: 4px;
  }

  .gauge-segment {
    min-width: 50px;
    padding: var(--space-sm) 4px;
  }

  .segment-emoji {
    font-size: 1.25rem;
  }

  .rating-binary {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .binary-button {
    min-width: 100%;
    padding: var(--space-md) var(--space-lg);
  }

  .binary-icon {
    font-size: 2.5rem;
  }

  .binary-label {
    font-size: 1rem;
  }

  .slider-value-display .value-emoji {
    font-size: 2.5rem;
  }

  .slider-value-display .value-label {
    font-size: 1rem;
  }
}

/* Chapter action buttons container */
.chapter-action-buttons {
  display: flex;
  gap: var(--space-sm);
}

/* Rating parameters list (author settings) */
.rating-params-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  min-height: 60px;
}

.rating-param-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface-light);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.rating-param-row:hover {
  background: var(--bg-hover);
  border-color: var(--border-color-light);
}

.rating-param-drag {
  color: var(--text-tertiary);
  cursor: grab;
  padding: var(--space-xs);
}

.rating-param-drag:active {
  cursor: grabbing;
}

.rating-param-content {
  flex: 1;
  min-width: 0;
}

.rating-param-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.rating-param-extremes {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.extreme-arrow {
  color: var(--text-quaternary);
}

.rating-param-actions {
  display: flex;
  gap: var(--space-xs);
}

.rating-params-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Chapter ratings summary (author view) */
.chapter-ratings-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.rating-summary-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.rating-summary-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rating-question {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.rating-extremes-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.rating-summary-value {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.rating-face-display {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.rating-bar-container {
  flex: 1;
  height: 10px;
  background: var(--surface-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.rating-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.rating-avg {
  font-weight: 700;
  color: var(--primary-light);
  font-size: 1.1rem;
  min-width: 45px;
  text-align: right;
  flex-shrink: 0;
}

.rating-max {
  font-weight: 500;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.rating-count {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Form row for side-by-side inputs */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Modal subtitle */
.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: var(--space-xs);
}

/* Rating success animation */
.rating-success-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
  animation: success-appear 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.success-checkmark {
  margin-bottom: var(--space-lg);
  animation: checkmark-pop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-checkmark svg {
  color: var(--success);
  filter: drop-shadow(0 4px 10px rgba(16, 185, 129, 0.3));
}

.success-checkmark circle {
  animation: checkmark-circle 0.6s ease-out forwards;
}

.success-checkmark polyline {
  animation: checkmark-check 0.4s 0.3s ease-out forwards;
}

@keyframes success-appear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes checkmark-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes checkmark-circle {
  from {
    stroke-dashoffset: 63;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes checkmark-check {
  from {
    stroke-dashoffset: 15;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.rating-success-animation h3 {
  margin: 0 0 var(--space-sm) 0;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.rating-success-animation p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ============================================
   ANALYTICS DASHBOARD - Smartwatch Style
   ============================================ */

#analytics-dashboard {
  padding: var(--space-md);
}

.analytics-header {
  margin-bottom: var(--space-xl);
}

.analytics-filters {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.5rem 1rem;
  background: var(--surface-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
}

.filter-dropdown {
  position: relative;
}

.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.filter-dropdown:hover .filter-dropdown-menu,
.filter-dropdown:focus-within .filter-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filter-dropdown-menu button {
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.filter-dropdown-menu button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-dropdown-menu button.active {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-light);
}

/* Analytics Empty State */
.analytics-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  text-align: center;
}

.analytics-empty-icon {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: 50%;
  margin-bottom: var(--space-xl);
  opacity: 0.7;
}

.analytics-empty-icon svg {
  color: white;
}

.analytics-empty h3 {
  margin: 0 0 var(--space-sm);
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* Hero Section - Main Score Ring */
.analytics-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-2xl);
  padding: var(--space-xl);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(139, 92, 246, 0.2);
  margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
  .analytics-hero {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.score-ring-container {
  position: relative;
  width: 200px;
  height: 200px;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 12;
}

.score-ring-progress {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease;
  animation: score-ring-appear 1.5s ease forwards;
}

@keyframes score-ring-appear {
  from {
    stroke-dasharray: 0 534;
  }
}

.score-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-value {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  animation: score-count-up 1s ease;
}

@keyframes score-count-up {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.score-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
}

.score-subtext {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Mini Score Rings */
.score-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-lg);
}

.mini-score {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.mini-ring {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(
    var(--color, var(--primary)) calc(var(--progress, 0) * 1%),
    var(--bg-tertiary) calc(var(--progress, 0) * 1%)
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-ring::before {
  content: '';
  position: absolute;
  width: 46px;
  height: 46px;
  background: var(--surface);
  border-radius: 50%;
}

.mini-ring span {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mini-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.mini-hint {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* Analytics Sections */
.analytics-section {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--surface-light);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
}

.analytics-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.analytics-section-title svg {
  color: var(--primary-light);
}

/* Distribution Chart */
.distribution-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.distribution-row {
  display: grid;
  grid-template-columns: 32px 1fr 50px 50px;
  align-items: center;
  gap: var(--space-md);
}

.distribution-face {
  font-size: 1.3rem;
  text-align: center;
}

.distribution-bar-container {
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.distribution-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  animation: bar-grow 0.8s ease forwards;
}

@keyframes bar-grow {
  from {
    width: 0 !important;
  }
}

.distribution-count {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.distribution-pct {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-align: right;
}

/* Chapter Performance Cards */
.chapter-performance {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
}

.chapter-perf-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-lg);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.2s ease;
  animation: card-appear 0.5s ease backwards;
}

.chapter-perf-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

@keyframes card-appear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

.chapter-perf-ring {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: conic-gradient(
    var(--color, var(--primary)) calc(var(--progress, 0) * 1%),
    var(--bg-tertiary) calc(var(--progress, 0) * 1%)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.chapter-perf-ring::before {
  content: '';
  position: absolute;
  width: 54px;
  height: 54px;
  background: var(--surface);
  border-radius: 50%;
}

.chapter-perf-ring span {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color, var(--text-primary));
}

.chapter-perf-info {
  width: 100%;
}

.chapter-perf-title {
  font-weight: 700;
  color: var(--primary-light);
  font-size: 0.9rem;
}

.chapter-perf-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0;
}

.chapter-perf-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Question Insights */
.question-insights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.insight-card {
  padding: var(--space-lg);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  animation: card-appear 0.5s ease backwards;
}

.insight-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.insight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.insight-type {
  font-size: 1.5rem;
}

.insight-score {
  font-size: 1.8rem;
  font-weight: 800;
}

.insight-question {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.insight-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.insight-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.insight-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
  animation: bar-grow 0.8s ease forwards;
}

.insight-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Reader Leaderboard */
.reader-leaderboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.reader-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  animation: card-appear 0.4s ease backwards;
}

.reader-card:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.reader-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
}

.reader-card:nth-child(1) .reader-rank {
  background: linear-gradient(135deg, #FFD700, #FFA500);
}

.reader-card:nth-child(2) .reader-rank {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
}

.reader-card:nth-child(3) .reader-rank {
  background: linear-gradient(135deg, #CD7F32, #B8860B);
}

.reader-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reader-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reader-avatar-sm span {
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

.reader-info {
  flex: 1;
  min-width: 0;
}

.reader-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-stats {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin: 2px 0;
}

.reader-progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-xs);
}

.reader-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2000;
  animation: toast-in 0.3s ease;
  color: var(--text-primary);
  font-size: 0.9rem;
  min-width: 200px;
  max-width: 400px;
}

.toast-success {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.toast-error {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.toast-info {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
