/**
 * 3888.sh Design System  
 * Modern, immersive CSS design system with comprehensive variables
 * No template literals - pure CSS custom properties
 */

:root {
  /* Brand Colors */
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-primary-light: #60a5fa;
  
  --color-secondary: #8b5cf6;
  --color-secondary-dark: #7c3aed;
  --color-secondary-light: #a78bfa;
  
  --color-accent: #10b981;
  --color-accent-dark: #059669;
  --color-accent-light: #34d399;
  
  --color-success: #10b981;
  --color-success-dark: #059669;
  --color-success-light: #34d399;
  
  --color-danger: #ef4444;
  --color-danger-dark: #dc2626;
  --color-danger-light: #f87171;
  
  --color-warning: #f59e0b;
  --color-info: #06b6d4;
  
  /* Light Mode Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-hover: #f1f5f9;
  --bg-overlay: rgba(0, 0, 0, 0.5);
  
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-inverse: #ffffff;
  
  --border-color: #e5e7eb;
  --border-color-dark: #d1d5db;
  --border-color-light: #f3f4f6;
  
  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --input-focus: #3b82f6;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Spacing Scale (4px base unit) */
  --spacing-0: 0;
  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-5: 1.25rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  --spacing-10: 2.5rem;
  --spacing-12: 3rem;
  --spacing-16: 4rem;
  --spacing-20: 5rem;
  --spacing-24: 6rem;
  
  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 0.125rem;
  --radius-base: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-base: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.05);
  --shadow-2xl: 0 35px 60px rgba(0, 0, 0, 0.2), 0 15px 30px rgba(0, 0, 0, 0.08);

  /* Glow Effects */
  --glow-primary: 0 0 20px rgba(168, 85, 247, 0.35), 0 0 40px rgba(168, 85, 247, 0.15);
  --glow-secondary: 0 0 20px rgba(139, 92, 246, 0.35), 0 0 40px rgba(139, 92, 246, 0.15);
  --glow-accent: 0 0 20px rgba(16, 185, 129, 0.30), 0 0 40px rgba(16, 185, 129, 0.12);
  --glow-danger: 0 0 20px rgba(239, 68, 68, 0.30), 0 0 40px rgba(239, 68, 68, 0.12);
  --glow-focus: 0 0 0 3px rgba(168, 85, 247, 0.25), 0 0 16px rgba(168, 85, 247, 0.15);
  
  /* Transitions */
  --transition-fast: 150ms;
  --transition-normal: 300ms;
  --transition-slow: 500ms;
  
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Z-Index Layers */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-toast: 1060;
  --z-tooltip: 1070;
  
  /* Component-Specific */
  --navbar-height: 64px;
  --navbar-bg: rgba(255, 255, 255, 0.95);
  --navbar-border: rgba(0, 0, 0, 0.1);
  --navbar-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  
  --badge-size: 18px;
  --badge-bg: var(--color-danger);
  --badge-text: var(--text-inverse);
  
  --modal-backdrop: rgba(0, 0, 0, 0.6);
  --modal-blur: 4px;
  --modal-max-width: 600px;
  
  --toast-width: 320px;
  --toast-height: 400px;
  --toast-gap: 16px;
  
  --button-height-sm: 32px;
  --button-height-md: 40px;
  --button-height-lg: 48px;
  
  --input-height-sm: 32px;
  --input-height-md: 40px;
  --input-height-lg: 48px;
  
  --card-padding: var(--spacing-6);
  --card-bg: var(--bg-primary);
  --card-border: var(--border-color);
  --card-radius: var(--radius-lg);
  --card-shadow: var(--shadow-sm);
  --card-hover-shadow: var(--shadow-md), var(--glow-secondary);
  
  /* Icon System */
  --icon-font-family: 'Font Awesome 5 Free';
  --icon-checkmark: '\f00c';
}

/* Dark Mode */
[data-theme='dark'] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-hover: #475569;
  --bg-overlay: rgba(0, 0, 0, 0.7);
  
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverse: #0f172a;
  
  --border-color: #334155;
  --border-color-dark: #475569;
  --border-color-light: #1e293b;
  
  --input-bg: #1e293b;
  --input-border: #475569;
  --input-focus: #60a5fa;
  
  --navbar-bg: rgba(15, 23, 42, 0.95);
  --navbar-border: rgba(255, 255, 255, 0.1);
  --navbar-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  
  --card-bg: var(--bg-secondary);
  --card-border: var(--border-color);
  --card-shadow: var(--shadow-md);

  --glow-primary: 0 0 24px rgba(168, 85, 247, 0.40), 0 0 48px rgba(168, 85, 247, 0.18);
  --glow-secondary: 0 0 24px rgba(167, 139, 250, 0.40), 0 0 48px rgba(167, 139, 250, 0.18);
  --glow-accent: 0 0 24px rgba(52, 211, 153, 0.35), 0 0 48px rgba(52, 211, 153, 0.15);
  --glow-danger: 0 0 24px rgba(248, 113, 113, 0.35), 0 0 48px rgba(248, 113, 113, 0.15);
  --glow-focus: 0 0 0 3px rgba(168, 85, 247, 0.30), 0 0 20px rgba(168, 85, 247, 0.20);
}

/* Light theme — pale blue-gray palette matching styles.css */
[data-theme='light'] {
  --bg-primary: #edf3fb;
  --bg-secondary: #e2ecf7;
  --bg-tertiary: #d5e3f2;
  --bg-hover: #d8e8f5;
  --bg-overlay: rgba(0, 20, 60, 0.55);

  --text-primary: #0f172a;
  --text-secondary: #1e3a5f;
  --text-tertiary: #4b6e9e;
  --text-inverse: #ffffff;

  --border-color: rgba(100, 140, 200, 0.22);
  --border-color-dark: rgba(100, 140, 200, 0.35);
  --border-color-light: rgba(100, 140, 200, 0.12);

  --input-bg: #edf3fb;
  --input-border: rgba(100, 140, 200, 0.30);
  --input-focus: #a855f7;

  --navbar-bg: rgba(225, 237, 252, 0.97);
  --navbar-border: rgba(100, 140, 200, 0.18);
  --navbar-shadow: 0 1px 4px rgba(30, 60, 120, 0.12);

  --card-bg: #eef4fc;
  --card-border: rgba(100, 140, 200, 0.18);
  --card-shadow: 0 2px 14px rgba(30, 60, 120, 0.10), 0 0 0 1px rgba(168, 85, 247, 0.10);

  --glow-primary: 0 0 16px rgba(168, 85, 247, 0.32), 0 0 32px rgba(168, 85, 247, 0.14);
  --glow-secondary: 0 0 16px rgba(167, 139, 250, 0.28), 0 0 32px rgba(167, 139, 250, 0.12);
  --glow-accent: 0 0 16px rgba(52, 211, 153, 0.24), 0 0 32px rgba(52, 211, 153, 0.10);
  --glow-danger: 0 0 16px rgba(248, 113, 113, 0.24), 0 0 32px rgba(248, 113, 113, 0.10);
  --glow-focus: 0 0 0 3px rgba(168, 85, 247, 0.22), 0 0 16px rgba(168, 85, 247, 0.16);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  transition: background-color var(--transition-normal) var(--ease-in-out),
              color var(--transition-normal) var(--ease-in-out);
}

/* Utility Classes */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.align-center { align-items: center !important; }
.gap-2 { gap: var(--spacing-2) !important; }
.gap-4 { gap: var(--spacing-4) !important; }

.text-center { text-align: center !important; }
.fw-medium { font-weight: var(--font-weight-medium) !important; }
.fw-bold { font-weight: var(--font-weight-bold) !important; }

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.m-0 { margin: 0 !important; }
.m-4 { margin: var(--spacing-4) !important; }
.mt-4 { margin-top: var(--spacing-4) !important; }
.mb-4 { margin-bottom: var(--spacing-4) !important; }

.p-4 { padding: var(--spacing-4) !important; }
.p-6 { padding: var(--spacing-6) !important; }

.rounded { border-radius: var(--radius-base) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

.cursor-pointer { cursor: pointer !important; }
.transition-normal { transition: all var(--transition-normal) var(--ease-in-out) !important; }

/* ================================================================
   VIEW CONTAINERS — 0 px horizontal margin / padding
   The feed wrapper owns its own 1px X padding; section views get none.
   ================================================================ */
.view {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

/* ================================================================
   ANIMATED MESH BACKGROUND — always-on behind all views
   Dark theme: deep purple/indigo mesh. Light theme: pale blue mesh.
   ================================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  /* Dark default — overridden in light theme below */
  background:
    radial-gradient(ellipse at top,    #1a0d2e 0%, #0d0d1a 60%, #0d1a2e 100%);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: -50%;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 35%, rgba(168,85,247,.10) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(59,130,246,.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 10%, rgba(236,72,153,.06) 0%, transparent 45%);
  animation: app-bg-drift 30s ease-in-out infinite;
  pointer-events: none;
}

@keyframes app-bg-drift {
  0%,100% { transform: translate(0,0)   rotate(0deg);   }
  33%      { transform: translate(-2%,3%) rotate(80deg);  }
  66%      { transform: translate(3%,-2%) rotate(190deg); }
}

/* Ambient diagonal shimmer sweep over the entire page */
body {
  position: relative;
}
#app-root { position: relative; z-index: 0; }

/* Light theme mesh — pale blue-gray radials, no purple darkness */
[data-theme='light'] body::before {
  background:
    radial-gradient(ellipse at top, #ddeeff 0%, #edf3fb 55%, #e2ecf7 100%);
}

[data-theme='light'] body::after {
  background:
    radial-gradient(circle at 20% 35%, rgba(100,160,255,.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(120,80,200,.07)  0%, transparent 50%),
    radial-gradient(circle at 50% 10%, rgba(60,180,220,.06)  0%, transparent 45%);
}

/* ================================================================
   SHIMMER / SHINE — light mode parity with dark mode
   The keyframes (shimmer, shimmerWide, shimmerDiagonal) live in
   animations.css. Here we tune the gradient colours for light theme.
   ================================================================ */

/* In light mode .shimmer uses a slightly stronger white sweep */
[data-theme='light'] .shimmer::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.55) 50%,
    transparent 100%
  );
}

[data-theme='light'] .shimmer-brand::before {
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(168,85,247,.12) 45%,
    rgba(59,130,246,.09) 55%,
    transparent 75%
  );
}

[data-theme='light'] .shimmer-diagonal::before {
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255,255,255,.40) 48%,
    rgba(168,85,247,.06) 52%,
    transparent 70%
  );
}

[data-theme='light'] .shimmer-intense::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.55) 35%,
    rgba(168,85,247,.10) 50%,
    rgba(255,255,255,.55) 65%,
    transparent 100%
  );
}

/* Cards: always carry a subtle shimmer sweep in both themes */
.card,
.cr-card,
.post-card,
.notification-card,
.user-card {
  position: relative;
  overflow: hidden;
}

.card::after,
.cr-card::after,
.post-card::after,
.notification-card::after,
.user-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255,255,255,.05) 48%,
    rgba(168,85,247,.04) 52%,
    transparent 70%
  );
  animation: shimmerDiagonal 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

[data-theme='light'] .card::after,
[data-theme='light'] .cr-card::after,
[data-theme='light'] .post-card::after,
[data-theme='light'] .notification-card::after,
[data-theme='light'] .user-card::after {
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255,255,255,.45) 48%,
    rgba(168,85,247,.07) 52%,
    transparent 70%
  );
}

/* Navbar: shimmer brand sweep */
.header {
  position: relative;
  overflow: hidden;
}

.header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(168,85,247,.06) 45%,
    rgba(236,72,153,.04) 55%,
    transparent 75%
  );
  background-size: 200% 100%;
  animation: shimmerWide 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

[data-theme='light'] .header::after {
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(100,160,255,.10) 45%,
    rgba(168,85,247,.08) 55%,
    transparent 75%
  );
  background-size: 200% 100%;
}
