/* ============================================
   TRADING SCHOOL PLATFORM - MAIN STYLESHEET
   Dark theme with gold/amber accents
   ============================================ */

/* ---- CSS Custom Properties ---- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --bg-card: #15151f;
  --bg-card-hover: #1c1c2a;
  --bg-input: #1a1a25;
  --bg-overlay: rgba(10, 10, 15, 0.92);

  --text-primary: #f5f5f5;
  --text-secondary: #a0a0b0;
  --text-muted: #6a6a7a;
  --text-inverse: #0a0a0f;

  --gold: #d4a843;
  --gold-light: #e8c468;
  --gold-dark: #b08930;
  --gold-glow: rgba(212, 168, 67, 0.15);
  --gold-glow-strong: rgba(212, 168, 67, 0.3);

  --success: #2ecc71;
  --success-bg: rgba(46, 204, 113, 0.1);
  --danger: #e74c3c;
  --danger-bg: rgba(231, 76, 60, 0.1);
  --warning: #f39c12;
  --warning-bg: rgba(243, 156, 18, 0.1);
  --info: #3498db;
  --info-bg: rgba(52, 152, 219, 0.1);

  --border-color: #2a2a3a;
  --border-light: #3a3a4a;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(212, 168, 67, 0.2);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  --header-height: 70px;
  --sidebar-width: 280px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) var(--bg-secondary);
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--gold-light);
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--gold);
}

pre {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  line-height: 1.7;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* ---- Utility Classes ---- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 800px;
}

.container-wide {
  max-width: 1400px;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--text-inverse);
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(212, 168, 67, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gold-glow);
  border-color: var(--gold-light);
}

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

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-tertiary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #c0392b;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

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

.btn-xl {
  padding: 1.25rem 2.5rem;
  font-size: 1.25rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  color: var(--danger);
  font-size: 0.8125rem;
  margin-top: 0.375rem;
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 0.375rem;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-base);
}

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

.card-highlight {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-glow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.badge-gold {
  background: var(--gold-glow);
  color: var(--gold);
  border: 1px solid rgba(212, 168, 67, 0.3);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(243, 156, 18, 0.3);
}

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

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 100px;
  transition: width var(--transition-slow);
}

.progress-bar-lg {
  height: 12px;
}

/* ---- Header / Navbar ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-inverse);
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-avatar {
  width: 36px;
  height: 36px;
  background: var(--gold-glow);
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--gold);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ---- Sidebar (Dashboard/Lesson) ---- */
.layout-with-sidebar {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 1.5rem 0;
  z-index: 100;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-title {
  padding: 0 1.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.sidebar-nav-item.active {
  color: var(--gold);
  background: var(--gold-glow);
  border-left-color: var(--gold);
}

.sidebar-nav-item.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.sidebar-nav-item .item-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav-item .item-badge {
  margin-left: auto;
  font-size: 0.75rem;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-height: calc(100vh - var(--header-height));
}

/* ---- Page Header ---- */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 1rem;
  color: var(--text-muted);
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.stat-card-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card-change {
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

/* ---- Tables ---- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.875rem 1rem;
  text-align: left;
}

th {
  background: var(--bg-tertiary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

td {
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg-card);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition-fast);
}

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

/* ---- Alert / Toast ---- */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(46, 204, 113, 0.3);
  color: var(--success);
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: var(--danger);
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(243, 156, 18, 0.3);
  color: var(--warning);
}

.alert-info {
  background: var(--info-bg);
  border: 1px solid rgba(52, 152, 219, 0.3);
  color: var(--info);
}

.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 1rem);
  right: 1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 400px;
  font-size: 0.9375rem;
}

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

/* ---- Loading ---- */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
}

.loading-screen p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

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

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Achievement Tiers ---- */
.tier-bronze { color: #cd7f32; }
.tier-silver { color: #c0c0c0; }
.tier-gold { color: var(--gold); }
.tier-platinum { color: #e5e4e2; }

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.tier-badge-bronze {
  background: rgba(205, 127, 50, 0.1);
  border: 1px solid rgba(205, 127, 50, 0.3);
  color: #cd7f32;
}

.tier-badge-silver {
  background: rgba(192, 192, 192, 0.1);
  border: 1px solid rgba(192, 192, 192, 0.3);
  color: #c0c0c0;
}

.tier-badge-gold {
  background: var(--gold-glow);
  border: 1px solid rgba(212, 168, 67, 0.3);
  color: var(--gold);
}

.tier-badge-platinum {
  background: rgba(229, 228, 226, 0.1);
  border: 1px solid rgba(229, 228, 226, 0.3);
  color: #e5e4e2;
}

/* ---- Quiz Styles ---- */
.quiz-container {
  max-width: 700px;
}

.quiz-question {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.quiz-question-text {
  font-size: 1.0625rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9375rem;
}

.quiz-option:hover {
  border-color: var(--border-light);
  background: var(--bg-tertiary);
}

.quiz-option.selected {
  border-color: var(--gold);
  background: var(--gold-glow);
}

.quiz-option.correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.quiz-option.incorrect {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.quiz-option-radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.quiz-option.selected .quiz-option-radio {
  border-color: var(--gold);
}

.quiz-option.selected .quiz-option-radio::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
}

.quiz-feedback {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

/* ---- Chart Diagram (ASCII) ---- */
.chart-diagram {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-x: auto;
  white-space: pre;
  color: var(--gold);
}

/* ---- Footer ---- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

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

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  text-align: center;
}

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

.footer-disclaimer {
  max-width: 800px;
  margin: 1.5rem auto 0;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Auth Pages ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.auth-header p {
  font-size: 0.9375rem;
}

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

.auth-footer a {
  color: var(--gold);
  font-weight: 500;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

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

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary, #1a1a2e);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color, #2a2a4a);
    z-index: 1000;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .container {
    padding: 0 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    padding: 1rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

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

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

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

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

.animate-fade-in {
  animation: fadeIn 0.5s ease;
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease;
}

/* Staggered animations */
.stagger > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

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

/* ---- Page Transition: Fade-in on Load ---- */
body {
  animation: pageFadeIn 0.5s ease both;
}

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

/* ---- Button Hover Animations (scale + glow) ---- */
.btn {
  position: relative;
  overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 28px rgba(212, 168, 67, 0.4), 0 0 20px rgba(212, 168, 67, 0.15);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 12px rgba(212, 168, 67, 0.25);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 4px 16px rgba(212, 168, 67, 0.15);
}

.btn-ghost:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* Button ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::after {
  opacity: 1;
}

/* ---- Card Hover Effects (lift + shadow) ---- */
.card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(212, 168, 67, 0.2);
}

/* ---- Progress Bar Animations (fill with ease) ---- */
.progress-bar-fill {
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.progress-bar-animated .progress-bar-fill {
  animation: progressFillIn 1.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes progressFillIn {
  from { width: 0 !important; }
}

/* ---- Loading Spinner Styles (enhanced) ---- */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
}

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

.spinner-xl {
  width: 56px;
  height: 56px;
  border-width: 5px;
}

.spinner-gold {
  border-color: rgba(212, 168, 67, 0.2);
  border-top-color: var(--gold);
}

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

.loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: loadingDot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDot {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---- Toast Notification Styles ---- */
.toast-container {
  pointer-events: none;
}

.toast {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  animation: toastSlideIn 0.4s cubic-bezier(0.21, 1.02, 0.73, 1) both;
}

.toast-exiting {
  animation: toastSlideOut 0.3s ease forwards;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-info {
  border-left: 4px solid var(--info);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.125rem;
}

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

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.125rem;
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

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

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--gold);
  border-radius: 0 0 var(--radius-md) 0;
  animation: toastProgress 4s linear forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ---- Confetti Animation Keyframes ---- */
@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@keyframes confettiSway {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(30px); }
  75% { transform: translateX(-30px); }
}

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall 3s ease-in forwards, confettiSway 1.5s ease-in-out infinite;
}

.confetti-piece:nth-child(odd) { border-radius: 50%; }
.confetti-piece:nth-child(even) { border-radius: 2px; }

.confetti-piece:nth-child(1) { left: 10%; background: var(--gold); animation-delay: 0s; animation-duration: 2.5s; }
.confetti-piece:nth-child(2) { left: 20%; background: var(--success); animation-delay: 0.2s; animation-duration: 3s; }
.confetti-piece:nth-child(3) { left: 30%; background: var(--info); animation-delay: 0.4s; animation-duration: 2.8s; }
.confetti-piece:nth-child(4) { left: 40%; background: var(--gold-light); animation-delay: 0.1s; animation-duration: 3.2s; }
.confetti-piece:nth-child(5) { left: 50%; background: var(--danger); animation-delay: 0.3s; animation-duration: 2.6s; }
.confetti-piece:nth-child(6) { left: 60%; background: var(--warning); animation-delay: 0.5s; animation-duration: 2.9s; }
.confetti-piece:nth-child(7) { left: 70%; background: var(--gold); animation-delay: 0.15s; animation-duration: 3.1s; }
.confetti-piece:nth-child(8) { left: 80%; background: var(--success); animation-delay: 0.35s; animation-duration: 2.7s; }
.confetti-piece:nth-child(9) { left: 90%; background: var(--info); animation-delay: 0.25s; animation-duration: 3.3s; }
.confetti-piece:nth-child(10) { left: 15%; background: var(--gold-light); animation-delay: 0.45s; animation-duration: 2.4s; }
.confetti-piece:nth-child(11) { left: 35%; background: var(--danger); animation-delay: 0.6s; animation-duration: 3.0s; }
.confetti-piece:nth-child(12) { left: 55%; background: var(--warning); animation-delay: 0.7s; animation-duration: 2.5s; }
.confetti-piece:nth-child(13) { left: 75%; background: var(--gold); animation-delay: 0.55s; animation-duration: 2.8s; }
.confetti-piece:nth-child(14) { left: 85%; background: var(--success); animation-delay: 0.8s; animation-duration: 3.2s; }
.confetti-piece:nth-child(15) { left: 45%; background: var(--info); animation-delay: 0.65s; animation-duration: 2.6s; }

/* ---- Modal Overlay with Backdrop Blur ---- */
.modal-overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal {
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.modal-lg {
  max-width: 700px;
}

.modal-xl {
  max-width: 900px;
}

.modal-fullscreen {
  max-width: 100%;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  border-radius: 0;
  margin: 0;
}

/* ---- Skeleton Loading Placeholders ---- */
.skeleton-text {
  height: 1em;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-title {
  height: 1.5em;
  width: 40%;
  margin-bottom: 1rem;
}

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

.skeleton-card {
  height: 200px;
  border-radius: var(--radius-lg);
}

.skeleton-image {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
}

.skeleton-button {
  height: 44px;
  width: 120px;
  border-radius: var(--radius-md);
}

.skeleton-circle {
  border-radius: 50%;
}

/* ---- Tooltip Styles ---- */
.tooltip-wrapper {
  position: relative;
  display: inline-flex;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 5000;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-tertiary);
}

.tooltip-wrapper:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.tooltip-right {
  bottom: auto;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) scale(0.9);
}

.tooltip-right::after {
  top: 50%;
  left: auto;
  right: 100%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--bg-tertiary);
}

.tooltip-wrapper:hover .tooltip-right {
  transform: translateY(-50%) scale(1);
}

.tooltip-bottom {
  bottom: auto;
  top: calc(100% + 8px);
}

.tooltip-bottom::after {
  top: auto;
  bottom: 100%;
  border: 5px solid transparent;
  border-bottom-color: var(--bg-tertiary);
}

/* ---- Badge Styles (affiliate, achievement) ---- */
.badge-lg {
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
}

.badge-affiliate {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.15), rgba(232, 196, 104, 0.15));
  color: var(--gold-light);
  border: 1px solid rgba(212, 168, 67, 0.4);
  font-weight: 700;
}

.badge-affiliate::before {
  content: '\2605 ';
}

.badge-achievement {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all var(--transition-base);
}

.badge-achievement.earned {
  background: var(--gold-glow);
  border-color: rgba(212, 168, 67, 0.3);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.15);
}

.badge-achievement:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.badge-icon-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  margin-bottom: 0.5rem;
}

.badge-achievement.earned .badge-icon-lg {
  background: var(--gold-glow);
  border-color: var(--gold);
}

.badge-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--danger);
  color: white;
}

/* ---- Price Strikethrough Animation ---- */
.price-original {
  position: relative;
  color: var(--text-muted);
  font-size: 1.25rem;
}

.price-original::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 2px;
  background: var(--danger);
  transform: scaleX(0);
  transform-origin: left;
  animation: strikethroughSlash 0.6s 0.3s ease forwards;
}

@keyframes strikethroughSlash {
  to { transform: scaleX(1); }
}

.price-current {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  animation: pricePopIn 0.5s 0.6s cubic-bezier(0.21, 1.02, 0.73, 1) both;
}

@keyframes pricePopIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.price-savings {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  animation: fadeInUp 0.5s 0.8s ease both;
}

/* ---- Notification Bell ---- */
.nav-bell {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.375rem;
  transition: color var(--transition-fast);
}

.nav-bell:hover {
  color: var(--gold);
}

.nav-bell-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  animation: bellPulse 2s ease infinite;
}

@keyframes bellPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ---- Progress Ring (circular SVG indicator) ---- */
.progress-ring-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring circle {
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.progress-ring-text {
  position: absolute;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-ring-label {
  position: absolute;
  bottom: -4px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Reading Progress Bar ---- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  z-index: 10000;
  transition: width 50ms linear;
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
}

/* ---- Font Size Toggle ---- */
.font-size-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.25rem;
}

.font-size-toggle button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.font-size-toggle button:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.font-size-toggle button.active {
  color: var(--gold);
  background: var(--gold-glow);
}

/* ---- Key Takeaways Section ---- */
.key-takeaways {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-top: 2.5rem;
  position: relative;
}

.key-takeaways::before {
  content: '\2728';
  position: absolute;
  top: -14px;
  left: 20px;
  background: var(--bg-primary);
  padding: 0 0.5rem;
  font-size: 1.25rem;
}

.key-takeaways h3 {
  color: var(--gold);
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.key-takeaways ul {
  list-style: none;
  padding: 0;
}

.key-takeaways li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.625rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.key-takeaways li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

/* ---- Estimated Reading Time ---- */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.375rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 100px;
}

/* ---- Leaderboard Styles ---- */
.leaderboard {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.leaderboard h4 {
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.leaderboard-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  flex-shrink: 0;
}

.leaderboard-rank.rank-1 { background: var(--gold-glow); color: var(--gold); border: 1px solid rgba(212, 168, 67, 0.3); }
.leaderboard-rank.rank-2 { background: rgba(192, 192, 192, 0.1); color: #c0c0c0; border: 1px solid rgba(192, 192, 192, 0.3); }
.leaderboard-rank.rank-3 { background: rgba(205, 127, 50, 0.1); color: #cd7f32; border: 1px solid rgba(205, 127, 50, 0.3); }

.leaderboard-user {
  flex: 1;
  min-width: 0;
}

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

.leaderboard-score {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Thread Pin Icon ---- */
.thread-pinned {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.03);
}

.thread-pin-icon {
  color: var(--gold);
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* ---- Emoji Reactions ---- */
.reactions {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-family: var(--font-sans);
}

.reaction-btn:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.reaction-btn.active {
  background: var(--gold-glow);
  border-color: rgba(212, 168, 67, 0.3);
  color: var(--gold);
}

.reaction-count {
  font-size: 0.75rem;
  font-weight: 600;
}

.reaction-add {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
}

.reaction-add:hover {
  border-color: var(--border-light);
  color: var(--text-secondary);
}

/* ---- Search Bar ---- */
.search-bar {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

/* ---- Daily Tip Card ---- */
.daily-tip {
  background: linear-gradient(135deg, var(--bg-card), rgba(212, 168, 67, 0.05));
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.daily-tip-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.daily-tip-content {
  flex: 1;
}

.daily-tip-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.375rem;
}

.daily-tip-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}

.daily-tip-author {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: normal;
}

/* ---- Continue Card ---- */
.continue-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
  border: 1px solid var(--gold);
  border-radius: var(--radius-xl);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.1);
  transition: all var(--transition-base);
  text-decoration: none;
  cursor: pointer;
}

.continue-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212, 168, 67, 0.2);
}

.continue-card-icon {
  width: 56px;
  height: 56px;
  background: var(--gold-glow);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.continue-card-info {
  flex: 1;
}

.continue-card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.continue-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.125rem;
}

.continue-card-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.continue-card-arrow {
  font-size: 1.5rem;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.continue-card:hover .continue-card-arrow {
  transform: translateX(4px);
}

/* ---- Upcoming Section ---- */
.upcoming-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: all var(--transition-fast);
}

.upcoming-item:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.upcoming-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.upcoming-info {
  flex: 1;
}

.upcoming-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* ---- Onboarding Styles ---- */
.onboarding-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.onboarding-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3rem;
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.5s ease both;
}

.onboarding-step {
  display: none;
  animation: fadeInUp 0.4s ease both;
}

.onboarding-step.active {
  display: block;
}

.onboarding-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.onboarding-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
  transition: all var(--transition-base);
}

.onboarding-dot.active {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
}

.onboarding-dot.completed {
  background: var(--success);
}

.goal-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.goal-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.goal-option:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.goal-option.selected {
  border-color: var(--gold);
  background: var(--gold-glow);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.1);
}

.goal-option-icon {
  font-size: 2rem;
}

.goal-option-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.goal-option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.roadmap-visual {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1.5rem 0;
  position: relative;
}

.roadmap-phase {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  position: relative;
}

.roadmap-line {
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.roadmap-phase:last-child .roadmap-line {
  display: none;
}

.roadmap-node {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
  z-index: 1;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  color: var(--text-muted);
}

.roadmap-phase.phase-active .roadmap-node {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold);
}

.roadmap-content h4 {
  font-size: 0.9375rem;
  margin-bottom: 0.125rem;
}

.roadmap-content p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.roadmap-months {
  font-size: 0.6875rem;
  color: var(--gold);
  font-weight: 600;
}

/* ---- User Avatar Colors ---- */
.avatar-color-1 { background: rgba(231, 76, 60, 0.15); color: #e74c3c; border-color: rgba(231, 76, 60, 0.3); }
.avatar-color-2 { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border-color: rgba(46, 204, 113, 0.3); }
.avatar-color-3 { background: rgba(52, 152, 219, 0.15); color: #3498db; border-color: rgba(52, 152, 219, 0.3); }
.avatar-color-4 { background: rgba(155, 89, 182, 0.15); color: #9b59b6; border-color: rgba(155, 89, 182, 0.3); }
.avatar-color-5 { background: rgba(230, 126, 34, 0.15); color: #e67e22; border-color: rgba(230, 126, 34, 0.3); }
.avatar-color-6 { background: rgba(26, 188, 156, 0.15); color: #1abc9c; border-color: rgba(26, 188, 156, 0.3); }

/* ---- Additional Responsive Improvements ---- */
@media (max-width: 1440px) {
  .container-wide {
    max-width: 1200px;
  }
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .continue-card {
    padding: 1.25rem;
    gap: 1rem;
  }

  .onboarding-card {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .continue-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .continue-card-arrow {
    display: none;
  }

  .daily-tip {
    flex-direction: column;
    gap: 0.5rem;
  }

  .goal-picker {
    grid-template-columns: 1fr;
  }

  .onboarding-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
  }

  .leaderboard {
    display: none;
  }

  .toast {
    min-width: auto;
    max-width: calc(100vw - 2rem);
    margin-left: 1rem;
  }

  .toast-container {
    left: 0;
    right: 0;
    padding: 0 0.5rem;
  }

  .modal {
    padding: 1.5rem;
    width: 95%;
    border-radius: var(--radius-lg);
  }

  .reading-progress {
    height: 2px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
  }

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

  .btn-xl {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }

  .welcome-banner {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card-value {
    font-size: 1.5rem;
  }

  .quick-link {
    padding: 1rem;
  }

  .month-filter {
    gap: 0.25rem;
  }

  .month-filter button {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
  }

  .thread-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .thread-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.6875rem;
  }

  .thread-title {
    font-size: 0.875rem;
  }

  .thread-replies {
    min-width: 40px;
  }

  .onboarding-card {
    padding: 1.25rem;
  }

  .goal-option {
    padding: 1rem 0.75rem;
  }

  .key-takeaways {
    padding: 1.25rem;
  }

  .continue-card-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .font-size-toggle {
    display: none;
  }
}

@media (max-width: 320px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 0 0.75rem;
  }

  h1 { font-size: 1.375rem; }
  h2 { font-size: 1.125rem; }

  .header-inner {
    padding: 0 0.75rem;
  }

  .logo {
    font-size: 1rem;
    gap: 0.5rem;
  }

  .logo-icon {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .stat-card-value {
    font-size: 1.25rem;
  }

  .welcome-banner {
    padding: 1rem;
  }

  .auth-card {
    padding: 1.25rem;
  }

  .modal {
    padding: 1rem;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .onboarding-card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .goal-picker {
    gap: 0.75rem;
  }
}

/* ---- Additional Animations ---- */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.animate-slide-in-left { animation: slideInLeft 0.5s ease both; }
.animate-slide-in-right { animation: slideInRight 0.5s ease both; }
.animate-scale-in { animation: scaleIn 0.4s ease both; }
.animate-bounce-in { animation: bounceIn 0.6s ease both; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Stagger extended for more children */
.stagger > *:nth-child(9) { animation-delay: 0.45s; }
.stagger > *:nth-child(10) { animation-delay: 0.5s; }
.stagger > *:nth-child(11) { animation-delay: 0.55s; }
.stagger > *:nth-child(12) { animation-delay: 0.6s; }

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---- Print Styles (for invoices) ---- */
@media print {
  body {
    background: white;
    color: #000;
    animation: none;
  }

  .header, .sidebar, .footer, .no-print {
    display: none !important;
  }

  .main-content {
    margin: 0;
    padding: 0;
  }

  .card {
    border: 1px solid #ddd;
    box-shadow: none;
    transform: none;
  }
}
