/* ============================================
   POCKET TRIBE - DESIGN SYSTEM
   Mobile-first, clean, modern design
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES (Variables)
   ============================================ */
:root {
  /* Colors - Default Dark Theme (Emerald) */
  --color-bg-primary: #0a0b0d;
  --color-bg-secondary: #12141a;
  --color-bg-tertiary: #1a1d24;
  --color-bg-elevated: #1f232b;
  --color-bg-hover: #252a35;
  
  /* Text Colors */
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #71717a;
  --color-text-inverse: #0a0b0d;
  
  /* Accent Colors */
  --color-accent-primary: #6ee7b7;
  --color-accent-secondary: #34d399;
  --color-accent-gradient: linear-gradient(135deg, #6ee7b7 0%, #34d399 50%, #10b981 100%);
  
  /* Semantic Colors */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  
  /* Border Colors */
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.15);
  --color-border-focus: var(--color-accent-primary);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(110, 231, 183, 0.3);
  
  /* Typography */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-md: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 2rem;      /* 32px */
  --font-size-4xl: 2.5rem;    /* 40px */
  --font-size-5xl: 3rem;      /* 48px */
  
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Spacing Scale */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  
  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-toast: 700;
  --z-tooltip: 800;
  --z-max: 9999;
  
  /* Layout */
  --container-max: 1200px;
  --container-padding: var(--space-4);
  --header-height: 60px;
  --nav-height: 72px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
}

/* ============================================
   CSS RESET
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: var(--color-accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-secondary);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

/* Gradient text */
.gradient-text {
  background: var(--color-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Spacing */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Width */
.w-full { width: 100%; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Border Radius */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Transitions */
.transition { transition: all var(--transition-normal); }
.transition-fast { transition: all var(--transition-fast); }

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.animate-fade-in { animation: fadeIn var(--transition-normal) ease forwards; }
.animate-fade-in-up { animation: fadeInUp var(--transition-normal) ease forwards; }
.animate-fade-in-down { animation: fadeInDown var(--transition-normal) ease forwards; }
.animate-slide-up { animation: slideInUp var(--transition-normal) ease forwards; }
.animate-scale-in { animation: scaleIn var(--transition-normal) ease forwards; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-hover);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ============================================
   SELECTION STYLING
   ============================================ */
::selection {
  background: var(--color-accent-primary);
  color: var(--color-text-inverse);
}

/* ============================================
   FOCUS STYLING
   ============================================ */
:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
/* 
  Mobile-first approach:
  - Default styles are for mobile (< 640px)
  - sm: 640px+  (small tablets)
  - md: 768px+  (tablets)
  - lg: 1024px+ (laptops)
  - xl: 1280px+ (desktops)
*/

@media (min-width: 640px) {
  :root {
    --container-padding: var(--space-6);
  }
}

@media (min-width: 768px) {
  :root {
    --container-padding: var(--space-8);
  }
}

@media (min-width: 1024px) {
  :root {
    --nav-height: 0px; /* No bottom nav on desktop */
  }
}

/* ============================================
   PREMIUM THEMES
   Only accessible by premium members
   ============================================ */

/* Ocean Blue Theme */
[data-theme="ocean"] {
  --color-bg-primary: #0a0d14;
  --color-bg-secondary: #0f1520;
  --color-bg-tertiary: #151e2d;
  --color-bg-elevated: #1a2638;
  --color-bg-hover: #213147;
  
  --color-accent-primary: #38bdf8;
  --color-accent-secondary: #0ea5e9;
  --color-accent-gradient: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 50%, #0284c7 100%);
  
  --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.3);
}

/* Sunset Purple Theme */
[data-theme="sunset"] {
  --color-bg-primary: #0f0a14;
  --color-bg-secondary: #170f20;
  --color-bg-tertiary: #21152d;
  --color-bg-elevated: #2b1c3a;
  --color-bg-hover: #38264a;
  
  --color-accent-primary: #c084fc;
  --color-accent-secondary: #a855f7;
  --color-accent-gradient: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #9333ea 100%);
  
  --shadow-glow: 0 0 30px rgba(192, 132, 252, 0.3);
}

/* Rose Pink Theme */
[data-theme="rose"] {
  --color-bg-primary: #140a0d;
  --color-bg-secondary: #1c0f14;
  --color-bg-tertiary: #2a151e;
  --color-bg-elevated: #381c28;
  --color-bg-hover: #4a2535;
  
  --color-accent-primary: #fb7185;
  --color-accent-secondary: #f43f5e;
  --color-accent-gradient: linear-gradient(135deg, #fb7185 0%, #f43f5e 50%, #e11d48 100%);
  
  --shadow-glow: 0 0 30px rgba(251, 113, 133, 0.3);
}

/* Amber Gold Theme */
[data-theme="amber"] {
  --color-bg-primary: #140f0a;
  --color-bg-secondary: #1c150f;
  --color-bg-tertiary: #2a2015;
  --color-bg-elevated: #382b1c;
  --color-bg-hover: #4a3925;
  
  --color-accent-primary: #fbbf24;
  --color-accent-secondary: #f59e0b;
  --color-accent-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  
  --shadow-glow: 0 0 30px rgba(251, 191, 36, 0.3);
}

/* Mint Fresh Theme */
[data-theme="mint"] {
  --color-bg-primary: #0a1411;
  --color-bg-secondary: #0f1c18;
  --color-bg-tertiary: #152a24;
  --color-bg-elevated: #1c3830;
  --color-bg-hover: #254a40;
  
  --color-accent-primary: #2dd4bf;
  --color-accent-secondary: #14b8a6;
  --color-accent-gradient: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 50%, #0d9488 100%);
  
  --shadow-glow: 0 0 30px rgba(45, 212, 191, 0.3);
}

/* Light Theme (Cream) */
[data-theme="light"] {
  --color-bg-primary: #fafaf9;
  --color-bg-secondary: #f5f5f4;
  --color-bg-tertiary: #e7e5e4;
  --color-bg-elevated: #ffffff;
  --color-bg-hover: #d6d3d1;
  
  --color-text-primary: #1c1917;
  --color-text-secondary: #57534e;
  --color-text-muted: #78716c;
  --color-text-inverse: #fafaf9;
  
  --color-accent-primary: #059669;
  --color-accent-secondary: #10b981;
  --color-accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
  
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-hover: rgba(0, 0, 0, 0.15);
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.2);
}
