/* ═══════════════════════════════════════════════
   LifeSync – main.css
   Design tokens, reset, base typography
   ═══════════════════════════════════════════════ */

/* ─── Google Fonts via @import fallback ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ─── Design Tokens ─── */
:root {
  /* Palette */
  --bg-primary:    #080D1A;
  --bg-secondary:  #0F1629;
  --bg-tertiary:   #151D35;
  --bg-card:       rgba(15, 22, 41, 0.85);
  --bg-glass:      rgba(255, 255, 255, 0.04);
  --bg-glass-hover:rgba(255, 255, 255, 0.07);

  /* Accents */
  --indigo:        #6366F1;
  --indigo-light:  #818CF8;
  --indigo-dark:   #4F46E5;
  --cyan:          #06B6D4;
  --cyan-light:    #22D3EE;
  --sky:           #38BDF8;
  --violet:        #8B5CF6;
  --rose:          #F43F5E;
  --amber:         #F59E0B;
  --emerald:       #10B981;
  --slate:         #94A3B8;

  /* Priority */
  --priority-urgent: #F43F5E;
  --priority-high:   #F97316;
  --priority-medium: #F59E0B;
  --priority-low:    #10B981;

  /* Text */
  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #475569;
  --text-accent:    #818CF8;

  /* Border */
  --border:         rgba(255, 255, 255, 0.07);
  --border-focus:   rgba(99, 102, 241, 0.6);
  --border-hover:   rgba(255, 255, 255, 0.14);

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full:9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow:0 0 24px rgba(99,102,241,0.3);
  --shadow-glow-cyan: 0 0 24px rgba(6,182,212,0.25);

  /* Layout */
  --sidebar-width:  260px;
  --topbar-height:  64px;
  --mobile-nav-h:   64px;

  /* Transitions */
  --trans-fast:   0.15s ease;
  --trans-normal: 0.25s ease;
  --trans-slow:   0.4s ease;

  /* Typography */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

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

  /* Animated gradient background */
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(99,102,241,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(6,182,212,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(139,92,246,0.05) 0%, transparent 70%),
    var(--bg-primary);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

/* ─── Layout Shell ─── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md);
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--trans-slow);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0; z-index: 100;
  height: var(--topbar-height);
  background: rgba(8, 13, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-lg);
}

.view-container {
  flex: 1;
  padding: var(--space-xl) var(--space-xl);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.view { display: none; }
.view.active { display: block; }

/* ─── Brand ─── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--indigo), var(--cyan));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-icon i { color: white; width: 18px; height: 18px; }

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--indigo-light), var(--cyan-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Sidebar Nav ─── */
.nav-section-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-xs) var(--space-sm);
  margin-bottom: var(--space-xs);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--trans-fast);
  position: relative;
}

.nav-item i { width: 18px; height: 18px; flex-shrink: 0; }

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

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(6,182,212,0.1));
  color: var(--indigo-light);
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -4px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: linear-gradient(to bottom, var(--indigo), var(--cyan));
  border-radius: 0 3px 3px 0;
}

/* ─── Streak Widget ─── */
.sidebar-streak {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(244,63,94,0.1));
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-lg);
}

.streak-fire { font-size: 24px; }

.streak-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.streak-count {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
}

.streak-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ─── Topbar ─── */
.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background var(--trans-fast);
}

.topbar-menu-btn:hover { background: var(--bg-glass-hover); color: var(--text-primary); }

.topbar-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  flex: 1;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

/* ─── Utility Classes ─── */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-sm { gap: var(--space-sm); }

/* ─── Scrollbar Global ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
