/* ==========================================================================
   CAMCONNECT DESIGN SYSTEM
   Theme: Cameroon Hyper-Local Classifieds & Agent Economy
   Colors: Emerald Green (#059669), Sunset Gold (#F59E0B), Deep Royal Blue (#1E3A8A)
   Typography: Poppins (Headings/Badges) & Inter (Body/Data)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@500;600;700;800;900&display=swap');

:root {
  /* Brand Primary - Trust & Action */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #d1fae5;
  --primary-dark: #065f46;
  --primary-glow: rgba(5, 150, 105, 0.35);

  /* Brand Secondary - Energy & CTA / Gold Accents */
  --secondary: #F59E0B;
  --secondary-hover: #D97706;
  --secondary-light: #FEF3C7;
  --secondary-dark: #B45309;
  --secondary-glow: rgba(245, 158, 11, 0.4);

  /* Brand Accent - Authority, Security & Header */
  --accent-blue: #1E3A8A;
  --accent-blue-hover: #1E40AF;
  --accent-blue-light: #DBEAFE;
  --accent-blue-dark: #172554;
  --accent-blue-glow: rgba(30, 58, 138, 0.35);

  /* Status Palette */
  --status-success: #10B981;
  --status-success-bg: #ECFDF5;
  --status-warning: #FBBF24;
  --status-warning-bg: #FFFBEB;
  --status-danger: #EF4444;
  --status-danger-bg: #FEF2F2;
  --status-info: #3B82F6;
  --status-info-bg: #EFF6FF;

  /* Neutrals & Surfaces (Light Mode Default) */
  --bg-canvas: #F3F4F6;
  --bg-surface: #FFFFFF;
  --bg-surface-secondary: #F9FAFB;
  --bg-surface-tertiary: #F3F4F6;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-glass-card: rgba(255, 255, 255, 0.95);
  --border-subtle: #E5E7EB;
  --border-strong: #D1D5DB;
  --border-focus: var(--primary);

  /* Typography Colors */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --text-inverse: #FFFFFF;
  --text-on-primary: #FFFFFF;
  --text-on-secondary: #78350F;

  /* Typography Tokens */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow-gold: 0 0 16px rgba(245, 158, 11, 0.45);
  --shadow-glow-emerald: 0 0 16px rgba(5, 150, 105, 0.35);

  /* Spring Physics Timings */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 150ms var(--ease-smooth);
  --transition-normal: 250ms var(--ease-smooth);
  --transition-spring: 350ms var(--ease-spring);

  /* Border Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Layout Consts */
  --header-height: 64px;
  --bottom-nav-height: 64px;
  --demo-bar-height: 42px;
}

/* Dark Mode Theme Overrides */
[data-theme="dark"] {
  --bg-canvas: #0B1120;
  --bg-surface: #131E35;
  --bg-surface-secondary: #1E293B;
  --bg-surface-tertiary: #334155;
  --bg-glass: rgba(19, 30, 53, 0.88);
  --bg-glass-card: rgba(19, 30, 53, 0.96);
  --border-subtle: #243452;
  --border-strong: #3B5277;

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-tertiary: #64748B;
  --text-inverse: #0F172A;

  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.6);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

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

button {
  font-family: var(--font-heading);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  transition: all var(--transition-fast);
}

input, select, textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

/* ==========================================================================
   SIGNATURE ANIMATIONS & MICRO-INTERACTIONS
   ========================================================================== */

/* 1. Shimmering Skeleton Loader */
@keyframes shimmerAnim {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(229, 231, 235, 0.8) 0%,
    rgba(243, 244, 246, 0.9) 25%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(243, 244, 246, 0.9) 75%,
    rgba(229, 231, 235, 0.8) 100%
  );
  background-size: 200% 100%;
  animation: shimmerAnim 1.6s infinite ease-in-out;
  border-radius: var(--radius-sm);
  display: inline-block;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(30, 41, 59, 0.8) 0%,
    rgba(51, 65, 85, 0.9) 25%,
    rgba(71, 85, 105, 0.95) 50%,
    rgba(51, 65, 85, 0.9) 75%,
    rgba(30, 41, 59, 0.8) 100%
  );
  background-size: 200% 100%;
}

/* 2. Verified Blue/Gold Tick Shimmer & Pulse Glow */
@keyframes verifiedGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 10px 3px rgba(245, 158, 11, 0.35);
    transform: scale(1.05);
  }
}

.badge-verified-glow {
  animation: verifiedGlow 4s infinite ease-in-out;
}

/* 3. Location Radar Pulse Ripple */
@keyframes radarRipple {
  0% {
    transform: scale(0.85);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.6);
    opacity: 0.4;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

.radar-pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  margin-left: -12px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background-color: var(--primary-glow);
  pointer-events: none;
  animation: radarRipple 2.2s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
}

.radar-pulse-ring.secondary {
  border-color: var(--secondary);
  background-color: var(--secondary-glow);
  animation-delay: 0.6s;
}

/* 4. Spring Physics Popups & Modals */
@keyframes springPop {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(16px);
  }
  70% {
    opacity: 1;
    transform: scale(1.02) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-spring-pop {
  animation: springPop 0.38s var(--ease-spring) forwards;
}

/* 5. Heart Bookmark Elastic Bounce */
@keyframes heartBounce {
  0% { transform: scale(1); }
  35% { transform: scale(1.35) rotate(-8deg); }
  65% { transform: scale(0.88) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.animate-heart-bounce {
  animation: heartBounce 0.45s var(--ease-spring);
}

/* 6. FAB Morph & Transition */
.fab-morph {
  transition: all 0.35s var(--ease-spring);
}

/* Scroll Snapping Container */
.scroll-snap-x {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll-snap-x::-webkit-scrollbar {
  display: none;
}
.scroll-snap-item {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Glassmorphism Classes */
.glass-header {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.glass-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* Utility Helpers */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
