/* ═══════════════════════════════════════════════════════════════════════════
   SPEED READ — Design System v1.0
   The foundation for a billion-dollar reading platform
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   DESIGN TOKENS
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  /* Color Palette - Dark Theme (Default) */
  --sr-bg-base: #0a0a0a;
  --sr-bg-subtle: #111111;
  --sr-bg-elevated: #1a1a1a;
  --sr-bg-surface: #151515;
  --sr-bg-hover: #222222;
  --sr-bg-active: #2a2a2a;
  
  --sr-text-primary: #EDEDEC;
  --sr-text-secondary: #A1A1A0;
  --sr-text-muted: #6B6B6A;
  --sr-text-inverse: #0a0a0a;
  
  --sr-accent: #6DB89A;
  --sr-accent-hover: #5CA889;
  --sr-accent-muted: rgba(109, 184, 154, 0.15);
  --sr-accent-glow: rgba(109, 184, 154, 0.4);
  
  --sr-border: rgba(255, 255, 255, 0.08);
  --sr-border-hover: rgba(255, 255, 255, 0.12);
  --sr-border-strong: rgba(255, 255, 255, 0.18);
  --sr-border-accent: rgba(109, 184, 154, 0.4);
  
  --sr-success: #81C784;
  --sr-warning: #FFB74D;
  --sr-error: #E57373;
  --sr-info: #64B5F6;
  
  --sr-twitter: #1DA1F2;
  --sr-gold: #FFD700;
  --sr-silver: #C0C0C0;
  --sr-bronze: #CD7F32;
  
  /* Shadows */
  --sr-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --sr-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --sr-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --sr-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --sr-shadow-accent: 0 4px 20px rgba(109, 184, 154, 0.3);
  --sr-shadow-glow: 0 0 40px rgba(109, 184, 154, 0.2);
  
  /* Typography */
  --sr-font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sr-font-serif: 'Instrument Serif', Georgia, serif;
  --sr-font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  
  --sr-text-xs: 11px;
  --sr-text-sm: 13px;
  --sr-text-base: 15px;
  --sr-text-md: 17px;
  --sr-text-lg: 20px;
  --sr-text-xl: 24px;
  --sr-text-2xl: 32px;
  --sr-text-3xl: 40px;
  --sr-text-4xl: 56px;
  
  --sr-leading-tight: 1.2;
  --sr-leading-normal: 1.5;
  --sr-leading-relaxed: 1.7;
  
  /* Spacing */
  --sr-space-1: 4px;
  --sr-space-2: 8px;
  --sr-space-3: 12px;
  --sr-space-4: 16px;
  --sr-space-5: 20px;
  --sr-space-6: 24px;
  --sr-space-7: 32px;
  --sr-space-8: 40px;
  --sr-space-9: 48px;
  --sr-space-10: 64px;
  --sr-space-11: 80px;
  --sr-space-12: 96px;
  
  /* Border Radius */
  --sr-radius-sm: 6px;
  --sr-radius-md: 10px;
  --sr-radius-lg: 14px;
  --sr-radius-xl: 18px;
  --sr-radius-2xl: 24px;
  --sr-radius-full: 9999px;
  
  /* Transitions */
  --sr-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sr-ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --sr-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --sr-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  --sr-duration-instant: 100ms;
  --sr-duration-fast: 150ms;
  --sr-duration-normal: 250ms;
  --sr-duration-slow: 400ms;
  --sr-duration-slower: 600ms;
  
  /* Z-Index Scale */
  --sr-z-base: 1;
  --sr-z-dropdown: 100;
  --sr-z-sticky: 200;
  --sr-z-overlay: 300;
  --sr-z-modal: 400;
  --sr-z-toast: 500;
  --sr-z-tooltip: 600;
  --sr-z-max: 999;
  
  /* Breakpoints (for reference in JS) */
  --sr-bp-sm: 640px;
  --sr-bp-md: 768px;
  --sr-bp-lg: 1024px;
  --sr-bp-xl: 1280px;
}

/* Light Theme */
[data-theme="light"] {
  --sr-bg-base: #FDFBF7;
  --sr-bg-subtle: #F7F4EE;
  --sr-bg-elevated: #FFFFFF;
  --sr-bg-surface: #FFFFFF;
  --sr-bg-hover: #F0EDE6;
  --sr-bg-active: #E8E4DC;
  
  --sr-text-primary: #1A1814;
  --sr-text-secondary: #4A4640;
  --sr-text-muted: #8A8580;
  --sr-text-inverse: #FDFBF7;
  
  --sr-accent: #2D5A4A;
  --sr-accent-hover: #234839;
  --sr-accent-muted: rgba(45, 90, 74, 0.1);
  --sr-accent-glow: rgba(45, 90, 74, 0.3);
  
  --sr-border: rgba(0, 0, 0, 0.06);
  --sr-border-hover: rgba(0, 0, 0, 0.1);
  --sr-border-strong: rgba(0, 0, 0, 0.15);
  --sr-border-accent: rgba(45, 90, 74, 0.4);
  
  --sr-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --sr-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --sr-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --sr-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
  --sr-shadow-accent: 0 4px 20px rgba(45, 90, 74, 0.15);
  --sr-shadow-glow: 0 0 40px rgba(45, 90, 74, 0.1);
}

/* ─────────────────────────────────────────────────────────────────────────────
   BASE RESETS
   ───────────────────────────────────────────────────────────────────────────── */

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

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

body {
  font-family: var(--sr-font-sans);
  font-size: var(--sr-text-base);
  line-height: var(--sr-leading-normal);
  color: var(--sr-text-primary);
  background: var(--sr-bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--sr-accent);
  color: white;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Ensure all interactive elements show pointer cursor */
a, button, [role="button"], [onclick], label[for], 
select, summary, input[type="submit"], input[type="button"],
input[type="reset"], input[type="checkbox"], input[type="radio"],
input[type="range"], .clickable {
  cursor: pointer;
}

input, textarea, select {
  font-family: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────────
   PAGE TRANSITIONS
   ───────────────────────────────────────────────────────────────────────────── */

/* Page fade-in animation - opacity only to preserve fixed positioning */
@keyframes sr-page-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  animation: sr-page-enter var(--sr-duration-slow) var(--sr-ease-out) both;
}

/* Staggered children animation */
@keyframes sr-stagger-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sr-animate-stagger > * {
  animation: sr-stagger-in var(--sr-duration-normal) var(--sr-ease-out) both;
}

.sr-animate-stagger > *:nth-child(1) { animation-delay: 0ms; }
.sr-animate-stagger > *:nth-child(2) { animation-delay: 50ms; }
.sr-animate-stagger > *:nth-child(3) { animation-delay: 100ms; }
.sr-animate-stagger > *:nth-child(4) { animation-delay: 150ms; }
.sr-animate-stagger > *:nth-child(5) { animation-delay: 200ms; }
.sr-animate-stagger > *:nth-child(6) { animation-delay: 250ms; }
.sr-animate-stagger > *:nth-child(7) { animation-delay: 300ms; }
.sr-animate-stagger > *:nth-child(8) { animation-delay: 350ms; }

/* ─────────────────────────────────────────────────────────────────────────────
   SKELETON LOADERS
   ───────────────────────────────────────────────────────────────────────────── */

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

.sr-skeleton {
  background: linear-gradient(
    90deg,
    var(--sr-bg-subtle) 0%,
    var(--sr-bg-elevated) 50%,
    var(--sr-bg-subtle) 100%
  );
  background-size: 200% 100%;
  animation: sr-shimmer 1.5s infinite;
  border-radius: var(--sr-radius-sm);
}

.sr-skeleton-text {
  height: 1em;
  border-radius: var(--sr-radius-sm);
}

.sr-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--sr-radius-full);
}

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

.sr-skeleton-stat {
  height: 80px;
  border-radius: var(--sr-radius-md);
}

/* ─────────────────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────────────────── */

.sr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sr-space-2);
  padding: var(--sr-space-3) var(--sr-space-5);
  font-size: var(--sr-text-sm);
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--sr-radius-md);
  cursor: pointer;
  transition: color var(--sr-duration-fast) var(--sr-ease-out),
              background var(--sr-duration-fast) var(--sr-ease-out),
              border-color var(--sr-duration-fast) var(--sr-ease-out),
              transform var(--sr-duration-fast) var(--sr-ease-out),
              box-shadow var(--sr-duration-fast) var(--sr-ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.sr-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--sr-duration-fast);
}

.sr-btn:hover::before {
  opacity: 1;
}

.sr-btn:active {
  transform: scale(0.98);
}

.sr-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Primary Button */
.sr-btn-primary {
  background: var(--sr-accent);
  color: white;
  box-shadow: var(--sr-shadow-sm), 0 0 0 1px rgba(0,0,0,0.1);
}

.sr-btn-primary:hover {
  background: var(--sr-accent-hover);
  box-shadow: var(--sr-shadow-md), 0 0 0 1px rgba(0,0,0,0.1);
}

/* Secondary Button */
.sr-btn-secondary {
  background: var(--sr-bg-elevated);
  color: var(--sr-text-primary);
  border: 1px solid var(--sr-border);
}

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

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

.sr-btn-ghost:hover {
  background: var(--sr-bg-subtle);
  color: var(--sr-text-primary);
}

/* Icon Button */
.sr-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--sr-bg-elevated);
  border: 1px solid var(--sr-border);
  border-radius: var(--sr-radius-md);
  color: var(--sr-text-muted);
}

.sr-btn-icon:hover {
  background: var(--sr-bg-hover);
  border-color: var(--sr-border-strong);
  color: var(--sr-text-primary);
}

/* Button Sizes */
.sr-btn-sm {
  padding: var(--sr-space-2) var(--sr-space-3);
  font-size: var(--sr-text-xs);
}

.sr-btn-lg {
  padding: var(--sr-space-4) var(--sr-space-7);
  font-size: var(--sr-text-base);
  border-radius: var(--sr-radius-lg);
}

/* ─────────────────────────────────────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────────────────────────────────────── */

.sr-card {
  background: var(--sr-bg-surface);
  border: 1px solid var(--sr-border);
  border-radius: var(--sr-radius-lg);
  padding: var(--sr-space-6);
  transition: all var(--sr-duration-fast) var(--sr-ease-out);
}

.sr-card-interactive {
  cursor: pointer;
}

.sr-card-interactive:hover {
  background: var(--sr-bg-hover);
  border-color: var(--sr-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--sr-shadow-md);
}

.sr-card-elevated {
  box-shadow: var(--sr-shadow-lg);
  border-color: var(--sr-border-strong);
}

.sr-card-accent {
  border-color: var(--sr-border-accent);
  background: linear-gradient(135deg, var(--sr-accent-muted) 0%, var(--sr-bg-surface) 100%);
}

/* ─────────────────────────────────────────────────────────────────────────────
   INPUTS
   ───────────────────────────────────────────────────────────────────────────── */

.sr-input {
  width: 100%;
  padding: var(--sr-space-3) var(--sr-space-4);
  font-size: var(--sr-text-base);
  color: var(--sr-text-primary);
  background: var(--sr-bg-subtle);
  border: 1px solid var(--sr-border);
  border-radius: var(--sr-radius-md);
  outline: none;
  transition: all var(--sr-duration-fast) var(--sr-ease-out);
}

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

.sr-input:hover {
  border-color: var(--sr-border-hover);
}

.sr-input:focus {
  border-color: var(--sr-accent);
  box-shadow: 0 0 0 3px var(--sr-accent-muted);
}

.sr-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: var(--sr-leading-relaxed);
}

/* ─────────────────────────────────────────────────────────────────────────────
   NAVIGATION
   ───────────────────────────────────────────────────────────────────────────── */

.sr-header {
  position: sticky;
  top: 0;
  z-index: var(--sr-z-sticky);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--sr-border);
}

[data-theme="light"] .sr-header {
  background: rgba(253, 251, 247, 0.85);
}

.sr-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sr-space-4) var(--sr-space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sr-nav {
  display: flex;
  align-items: center;
  gap: var(--sr-space-2);
}

.sr-nav-link {
  padding: var(--sr-space-2) var(--sr-space-4);
  font-size: var(--sr-text-sm);
  font-weight: 500;
  color: var(--sr-text-muted);
  border-radius: var(--sr-radius-md);
  transition: all var(--sr-duration-fast) var(--sr-ease-out);
}

.sr-nav-link:hover {
  color: var(--sr-text-primary);
  background: var(--sr-bg-subtle);
}

.sr-nav-link.active {
  color: var(--sr-text-primary);
  background: var(--sr-bg-elevated);
}

/* Logo */
.sr-logo {
  display: flex;
  align-items: center;
  gap: var(--sr-space-3);
  text-decoration: none;
}

.sr-logo svg {
  width: 24px;
  height: 24px;
  color: var(--sr-accent);
  transition: opacity var(--sr-duration-fast);
}

.sr-logo:hover svg {
  opacity: 0.8;
}

/* ─────────────────────────────────────────────────────────────────────────────
   AVATARS
   ───────────────────────────────────────────────────────────────────────────── */

.sr-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--sr-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--sr-text-sm);
  color: white;
  background: linear-gradient(135deg, var(--sr-accent) 0%, var(--sr-accent-hover) 100%);
  text-transform: uppercase;
  overflow: hidden;
  flex-shrink: 0;
}

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

.sr-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: var(--sr-text-xs);
}

.sr-avatar-lg {
  width: 64px;
  height: 64px;
  font-size: var(--sr-text-xl);
}

.sr-avatar-xl {
  width: 96px;
  height: 96px;
  font-size: var(--sr-text-3xl);
}

/* ─────────────────────────────────────────────────────────────────────────────
   DROPDOWNS
   ───────────────────────────────────────────────────────────────────────────── */

.sr-dropdown {
  position: relative;
}

.sr-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: var(--sr-space-2);
  background: var(--sr-bg-elevated);
  border: 1px solid var(--sr-border-strong);
  border-radius: var(--sr-radius-lg);
  box-shadow: var(--sr-shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transform-origin: top right;
  transition: all var(--sr-duration-fast) var(--sr-ease-out);
  z-index: var(--sr-z-dropdown);
}

.sr-dropdown.open .sr-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.sr-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sr-space-3);
  padding: var(--sr-space-3) var(--sr-space-4);
  font-size: var(--sr-text-sm);
  color: var(--sr-text-secondary);
  border-radius: var(--sr-radius-md);
  transition: color var(--sr-duration-instant), background var(--sr-duration-instant);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sr-dropdown-item:hover {
  color: var(--sr-text-primary);
  background: var(--sr-bg-hover);
}

.sr-dropdown-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.sr-dropdown-item.danger {
  color: var(--sr-error);
}

.sr-dropdown-item.danger:hover {
  background: rgba(229, 115, 115, 0.1);
}

.sr-dropdown-divider {
  height: 1px;
  background: var(--sr-border);
  margin: var(--sr-space-2) 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────────────────────────────────────── */

.sr-toast-container {
  position: fixed;
  bottom: var(--sr-space-6);
  right: var(--sr-space-6);
  z-index: var(--sr-z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--sr-space-3);
  pointer-events: none;
}

.sr-toast {
  display: flex;
  align-items: center;
  gap: var(--sr-space-3);
  padding: var(--sr-space-4) var(--sr-space-5);
  background: var(--sr-bg-elevated);
  border: 1px solid var(--sr-border-strong);
  border-radius: var(--sr-radius-lg);
  box-shadow: var(--sr-shadow-xl);
  font-size: var(--sr-text-sm);
  color: var(--sr-text-primary);
  pointer-events: auto;
  animation: sr-toast-in var(--sr-duration-normal) var(--sr-ease-spring) both;
}

@keyframes sr-toast-in {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.sr-toast.exiting {
  animation: sr-toast-out var(--sr-duration-fast) var(--sr-ease-out) both;
}

@keyframes sr-toast-out {
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
}

.sr-toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sr-toast.success {
  border-color: var(--sr-success);
}

.sr-toast.success .sr-toast-icon {
  color: var(--sr-success);
}

.sr-toast.error {
  border-color: var(--sr-error);
}

.sr-toast.error .sr-toast-icon {
  color: var(--sr-error);
}

.sr-toast.warning .sr-toast-icon {
  color: var(--sr-warning);
}

.sr-toast.info .sr-toast-icon {
  color: var(--sr-info);
}

/* ─────────────────────────────────────────────────────────────────────────────
   MODALS
   ───────────────────────────────────────────────────────────────────────────── */

.sr-modal {
  position: fixed;
  inset: 0;
  z-index: var(--sr-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sr-space-6);
  opacity: 0;
  visibility: hidden;
  transition: all var(--sr-duration-normal) var(--sr-ease-out);
}

.sr-modal.open {
  opacity: 1;
  visibility: visible;
}

.sr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.sr-modal-content {
  position: relative;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--sr-bg-elevated);
  border: 1px solid var(--sr-border-strong);
  border-radius: var(--sr-radius-2xl);
  box-shadow: var(--sr-shadow-xl);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--sr-duration-normal) var(--sr-ease-spring);
}

.sr-modal.open .sr-modal-content {
  transform: scale(1) translateY(0);
}

.sr-modal-header {
  padding: var(--sr-space-6);
  border-bottom: 1px solid var(--sr-border);
}

.sr-modal-title {
  font-size: var(--sr-text-lg);
  font-weight: 600;
}

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

.sr-modal-footer {
  padding: var(--sr-space-4) var(--sr-space-6);
  border-top: 1px solid var(--sr-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--sr-space-3);
}

.sr-modal-close {
  position: absolute;
  top: var(--sr-space-4);
  right: var(--sr-space-4);
}

/* ─────────────────────────────────────────────────────────────────────────────
   BADGES & TAGS
   ───────────────────────────────────────────────────────────────────────────── */

.sr-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sr-space-1);
  padding: var(--sr-space-1) var(--sr-space-2);
  font-size: var(--sr-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--sr-radius-sm);
  background: var(--sr-accent-muted);
  color: var(--sr-accent);
}

.sr-badge-success {
  background: rgba(129, 199, 132, 0.15);
  color: var(--sr-success);
}

.sr-badge-warning {
  background: rgba(255, 183, 77, 0.15);
  color: var(--sr-warning);
}

.sr-badge-error {
  background: rgba(229, 115, 115, 0.15);
  color: var(--sr-error);
}

.sr-badge-gold {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 183, 77, 0.2) 100%);
  color: var(--sr-gold);
}

/* ─────────────────────────────────────────────────────────────────────────────
   STATS / METRICS
   ───────────────────────────────────────────────────────────────────────────── */

.sr-stat {
  display: flex;
  flex-direction: column;
  gap: var(--sr-space-1);
}

.sr-stat-value {
  font-size: var(--sr-text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  background: linear-gradient(135deg, var(--sr-text-primary) 0%, var(--sr-text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sr-stat-label {
  font-size: var(--sr-text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sr-text-muted);
}

.sr-stat-accent .sr-stat-value {
  background: linear-gradient(135deg, var(--sr-accent) 0%, var(--sr-accent-hover) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ─────────────────────────────────────────────────────────────────────────────
   PROGRESS BARS
   ───────────────────────────────────────────────────────────────────────────── */

.sr-progress {
  height: 8px;
  background: var(--sr-bg-subtle);
  border-radius: var(--sr-radius-full);
  overflow: hidden;
}

.sr-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--sr-accent) 0%, var(--sr-accent-hover) 100%);
  border-radius: var(--sr-radius-full);
  transition: width var(--sr-duration-slow) var(--sr-ease-out);
}

.sr-progress-animated .sr-progress-bar {
  position: relative;
  overflow: hidden;
}

.sr-progress-animated .sr-progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: sr-progress-shine 1.5s infinite;
}

@keyframes sr-progress-shine {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   EMPTY STATES
   ───────────────────────────────────────────────────────────────────────────── */

.sr-empty {
  text-align: center;
  padding: var(--sr-space-12) var(--sr-space-6);
}

.sr-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sr-space-5);
  color: var(--sr-text-muted);
  opacity: 0.5;
}

.sr-empty-title {
  font-size: var(--sr-text-lg);
  font-weight: 600;
  margin-bottom: var(--sr-space-2);
}

.sr-empty-desc {
  color: var(--sr-text-muted);
  max-width: 300px;
  margin: 0 auto var(--sr-space-6);
}

/* ─────────────────────────────────────────────────────────────────────────────
   UTILITY CLASSES
   ───────────────────────────────────────────────────────────────────────────── */

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

.sr-container-sm {
  max-width: 800px;
}

.sr-container-xs {
  max-width: 600px;
}

.sr-hidden {
  display: none !important;
}

.sr-invisible {
  visibility: hidden;
}

.sr-text-center { text-align: center; }
.sr-text-left { text-align: left; }
.sr-text-right { text-align: right; }

.sr-text-muted { color: var(--sr-text-muted); }
.sr-text-secondary { color: var(--sr-text-secondary); }
.sr-text-accent { color: var(--sr-accent); }

.sr-flex { display: flex; }
.sr-flex-col { flex-direction: column; }
.sr-items-center { align-items: center; }
.sr-justify-center { justify-content: center; }
.sr-justify-between { justify-content: space-between; }
.sr-gap-1 { gap: var(--sr-space-1); }
.sr-gap-2 { gap: var(--sr-space-2); }
.sr-gap-3 { gap: var(--sr-space-3); }
.sr-gap-4 { gap: var(--sr-space-4); }
.sr-gap-6 { gap: var(--sr-space-6); }

/* ─────────────────────────────────────────────────────────────────────────────
   CELEBRATION EFFECTS
   ───────────────────────────────────────────────────────────────────────────── */

@keyframes sr-confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.sr-confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--sr-z-overlay);
  overflow: hidden;
}

.sr-confetti-piece {
  position: absolute;
  width: 10px;
  height: 20px;
  animation: sr-confetti-fall 3s linear forwards;
}

@keyframes sr-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.sr-pulse {
  animation: sr-pulse 2s ease-in-out infinite;
}

@keyframes sr-glow {
  0%, 100% { box-shadow: 0 0 20px var(--sr-accent-glow); }
  50% { box-shadow: 0 0 40px var(--sr-accent-glow), 0 0 60px var(--sr-accent-glow); }
}

.sr-glow {
  animation: sr-glow 2s ease-in-out infinite;
}

/* ─────────────────────────────────────────────────────────────────────────────
   FLOATING THEME TOGGLE
   ───────────────────────────────────────────────────────────────────────────── */

.sr-theme-toggle {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--sr-border);
  background: var(--sr-bg-elevated);
  color: var(--sr-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  z-index: 2147483647 !important;
  box-shadow: var(--sr-shadow-lg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sr-theme-toggle:hover {
  color: var(--sr-text-primary);
  transform: scale(1.1);
  box-shadow: var(--sr-shadow-xl);
  border-color: var(--sr-border-hover);
}

.sr-theme-toggle:active {
  transform: scale(0.95);
}

.sr-theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: opacity 0.2s, transform 0.3s;
}

.sr-theme-toggle .sr-icon-sun,
.sr-theme-toggle .sr-icon-moon {
  position: absolute;
}

/* Show sun in dark mode (to switch to light) */
[data-theme="dark"] .sr-theme-toggle .sr-icon-sun {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme="dark"] .sr-theme-toggle .sr-icon-moon {
  opacity: 0;
  transform: rotate(-90deg);
}

/* Show moon in light mode (to switch to dark) */
[data-theme="light"] .sr-theme-toggle .sr-icon-sun {
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme="light"] .sr-theme-toggle .sr-icon-moon {
  opacity: 1;
  transform: rotate(0deg);
}

/* Hover effect glow */
.sr-theme-toggle::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--sr-accent-muted) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.sr-theme-toggle:hover::after {
  opacity: 1;
}

/* Mobile adjustment */
@media (max-width: 768px) {
  .sr-theme-toggle {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
  
  .sr-theme-toggle svg {
    width: 18px;
    height: 18px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE BREAKPOINTS
   ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  :root {
    --sr-text-4xl: 40px;
    --sr-text-3xl: 32px;
    --sr-text-2xl: 24px;
  }
  
  .sr-header-inner {
    padding: var(--sr-space-3) var(--sr-space-4);
  }
  
  .sr-container {
    padding: 0 var(--sr-space-4);
  }
  
  .sr-nav {
    display: none;
  }
  
  .sr-toast-container {
    left: var(--sr-space-4);
    right: var(--sr-space-4);
    bottom: var(--sr-space-4);
  }
  
  .sr-toast {
    width: 100%;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   PRINT STYLES
   ───────────────────────────────────────────────────────────────────────────── */

@media print {
  .sr-header,
  .sr-toast-container,
  .sr-modal {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
}
