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

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* Social-First Color Palette */
    /* Primary: Vibrant Orange - drives action */
    --mosquito-primary: #FF6B35;
    --mosquito-primary-light: #FF8A5B;
    --mosquito-primary-dark: #E55A2B;
    
    /* Secondary: Bright Teal - growth & success */
    --mosquito-secondary: #00D9C0;
    --mosquito-secondary-light: #5CEFD9;
    --mosquito-secondary-dark: #00B8A3;
    
    /* Accent: Warm Yellow - attention & rewards */
    --mosquito-accent: #FFD93D;
    --mosquito-accent-light: #FFE56D;
    --mosquito-accent-dark: #F5C700;
    
    /* Gradient backgrounds */
    --mosquito-gradient-primary: linear-gradient(135deg, #FF6B35 0%, #FF8A5B 100%);
    --mosquito-gradient-secondary: linear-gradient(135deg, #00D9C0 0%, #5CEFD9 100%);
    --mosquito-gradient-accent: linear-gradient(135deg, #FFD93D 0%, #FFE56D 100%);
    --mosquito-gradient-hero: linear-gradient(135deg, #FF6B35 0%, #FF8A5B 50%, #FFD93D 100%);
    
    /* Semantic colors */
    --mosquito-success: #00C781;
    --mosquito-warning: #FFB800;
    --mosquito-error: #FF4757;
    --mosquito-info: #4A90E2;
    
    /* Background & Surface */
    --mosquito-bg: #FEF9F6;
    --mosquito-bg-gradient: linear-gradient(180deg, #FFF8F5 0%, #FEF9F6 100%);
    --mosquito-surface: #FFFFFF;
    --mosquito-surface-elevated: #FFFFFF;
    
    /* Text colors */
    --mosquito-ink: #1A1A2E;
    --mosquito-ink-light: #4A4A68;
    --mosquito-muted: #8B8BA7;
    --mosquito-white: #FFFFFF;
    
    /* Borders & Shadows */
    --mosquito-border: rgba(255, 107, 53, 0.15);
    --mosquito-line: #FFE8E0;
    
    /* Shadows - softer, more approachable */
    --mosquito-shadow-sm: 0 2px 8px rgba(255, 107, 53, 0.08);
    --mosquito-shadow: 0 8px 24px rgba(255, 107, 53, 0.12);
    --mosquito-shadow-lg: 0 16px 48px rgba(255, 107, 53, 0.16);
    --mosquito-shadow-glow: 0 0 40px rgba(255, 107, 53, 0.2);
    
    /* Card shadows */
    --mosquito-card-shadow: 0 4px 16px rgba(26, 26, 46, 0.06);
    --mosquito-card-shadow-hover: 0 8px 24px rgba(26, 26, 46, 0.1);
    
    /* Typography */
    --mosquito-font-display: 'Poppins', 'Noto Sans SC', sans-serif;
    --mosquito-font-body: 'Noto Sans SC', 'Poppins', sans-serif;
    --mosquito-font-mono: 'IBM Plex Mono', ui-monospace, monospace;
    
    /* Animation timing */
    --mosquito-transition-fast: 150ms ease;
    --mosquito-transition: 250ms ease;
    --mosquito-transition-slow: 350ms ease;
    
    /* Touch targets - minimum 44px for accessibility */
    --mosquito-touch-min: 44px;
  }

  * {
    -webkit-tap-highlight-color: transparent;
  }

  body {
    font-family: var(--mosquito-font-body);
    background: var(--mosquito-bg);
    color: var(--mosquito-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

@layer components {
  /* App Container */
  .mosquito-app {
    min-height: 100vh;
    background: 
      radial-gradient(ellipse at top, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
      radial-gradient(ellipse at bottom right, rgba(0, 217, 192, 0.06) 0%, transparent 40%),
      var(--mosquito-bg);
  }

  /* Cards */
  .mos-card {
    border-radius: 20px;
    border: 1px solid var(--mosquito-border);
    background: var(--mosquito-surface);
    box-shadow: var(--mosquito-card-shadow);
    transition: transform var(--mosquito-transition), box-shadow var(--mosquito-transition);
  }

  .mos-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--mosquito-card-shadow-hover);
  }

  .mos-card-gradient {
    border-radius: 20px;
    background: var(--mosquito-gradient-primary);
    color: var(--mosquito-white);
    box-shadow: var(--mosquito-shadow);
  }

  /* Typography */
  .mos-title {
    font-family: var(--mosquito-font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }

  .mos-subtitle {
    font-family: var(--mosquito-font-body);
    font-weight: 500;
    color: var(--mosquito-ink-light);
  }

  .mos-muted {
    color: var(--mosquito-muted);
    font-size: 0.875rem;
  }

  .mos-kpi {
    font-family: var(--mosquito-font-display);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--mosquito-ink);
  }

  /* Buttons */
  .mos-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--mosquito-transition);
    cursor: pointer;
    border: none;
    min-height: var(--mosquito-touch-min);
  }

  .mos-btn-primary {
    background: var(--mosquito-gradient-primary);
    color: var(--mosquito-white);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  }

  .mos-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
  }

  .mos-btn-primary:active {
    transform: translateY(0);
  }

  .mos-btn-secondary {
    background: var(--mosquito-white);
    color: var(--mosquito-primary);
    border: 2px solid var(--mosquito-primary);
  }

  .mos-btn-secondary:hover {
    background: var(--mosquito-primary);
    color: var(--mosquito-white);
  }

  .mos-btn-accent {
    background: var(--mosquito-gradient-accent);
    color: var(--mosquito-ink);
    box-shadow: 0 4px 12px rgba(255, 217, 61, 0.3);
  }

  .mos-btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 217, 61, 0.4);
  }

  .mos-btn-ghost {
    background: transparent;
    color: var(--mosquito-ink-light);
    border: 1px solid var(--mosquito-line);
  }

  .mos-btn-ghost:hover {
    background: var(--mosquito-bg);
    color: var(--mosquito-ink);
  }

  /* Navigation */
  .mos-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    width: min(calc(100% - 32px), 400px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--mosquito-border);
    box-shadow: var(--mosquito-shadow-lg);
    padding: 8px 12px;
  }

  .mos-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 16px;
    color: var(--mosquito-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    transition: all var(--mosquito-transition);
    min-width: 64px;
  }

  .mos-nav-item:hover {
    color: var(--mosquito-primary);
    background: rgba(255, 107, 53, 0.08);
  }

  .mos-nav-item.active {
    color: var(--mosquito-primary);
    background: rgba(255, 107, 53, 0.12);
  }

  .mos-nav-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
  }

  /* Tags & Pills */
  .mos-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .mos-pill-primary {
    background: rgba(255, 107, 53, 0.12);
    color: var(--mosquito-primary);
  }

  .mos-pill-secondary {
    background: rgba(0, 217, 192, 0.12);
    color: var(--mosquito-secondary-dark);
  }

  .mos-pill-accent {
    background: rgba(255, 217, 61, 0.2);
    color: #B8860B;
  }

  /* Hero Section */
  .mos-hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: var(--mosquito-gradient-hero);
    color: var(--mosquito-white);
    box-shadow: var(--mosquito-shadow-glow);
  }

  .mos-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    animation: shimmer 6s ease-in-out infinite;
  }

  @keyframes shimmer {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10%, 10%) scale(1.1); }
  }

  /* KPI Cards */
  .mos-kpi-card {
    border-radius: 20px;
    background: var(--mosquito-surface);
    border: 1px solid var(--mosquito-border);
    padding: 20px;
    transition: all var(--mosquito-transition);
  }

  .mos-kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mosquito-shadow);
    border-color: var(--mosquito-primary-light);
  }

  .mos-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
  }

  .mos-kpi-icon-primary {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(255, 107, 53, 0.05) 100%);
    color: var(--mosquito-primary);
  }

  .mos-kpi-icon-secondary {
    background: linear-gradient(135deg, rgba(0, 217, 192, 0.15) 0%, rgba(0, 217, 192, 0.05) 100%);
    color: var(--mosquito-secondary-dark);
  }

  .mos-kpi-icon-accent {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.2) 0%, rgba(255, 217, 61, 0.05) 100%);
    color: #D4A017;
  }

  /* Status Badges */
  .mos-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
  }

  .mos-status-live {
    background: rgba(0, 199, 129, 0.12);
    color: var(--mosquito-success);
  }

  .mos-status-live::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mosquito-success);
    animation: pulse 2s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
  }

  /* Leaderboard */
  .mos-rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    transition: background var(--mosquito-transition);
  }

  .mos-rank-item:hover {
    background: rgba(255, 107, 53, 0.04);
  }

  .mos-rank-number {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
  }

  .mos-rank-1 {
    background: linear-gradient(135deg, #FFD93D 0%, #F5C700 100%);
    color: var(--mosquito-ink);
  }

  .mos-rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: var(--mosquito-white);
  }

  .mos-rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: var(--mosquito-white);
  }

  .mos-rank-other {
    background: rgba(26, 26, 46, 0.06);
    color: var(--mosquito-muted);
  }

  /* Share Section */
  .mos-share-card {
    border-radius: 24px;
    background: var(--mosquito-surface);
    border: 2px dashed var(--mosquito-line);
    padding: 32px 24px;
    text-align: center;
    transition: all var(--mosquito-transition);
  }

  .mos-share-card:hover {
    border-color: var(--mosquito-primary-light);
    background: rgba(255, 107, 53, 0.02);
  }

  /* Toast Notifications */
  .mos-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--mosquito-shadow-lg);
    animation: slideUp 0.3s ease;
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateX(-50%) translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
  }

  .mos-toast-success {
    background: var(--mosquito-success);
    color: var(--mosquito-white);
  }

  /* Empty States */
  .mos-empty {
    text-align: center;
    padding: 48px 24px;
  }

  .mos-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(0, 217, 192, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mosquito-primary);
  }

  /* Loading States */
  .mos-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 12px;
    animation: shimmer 1.5s infinite;
  }

  /* Accessibility */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* Focus states for keyboard navigation */
  .mos-btn:focus-visible,
  .mos-nav-item:focus-visible {
    outline: 3px solid var(--mosquito-primary);
    outline-offset: 2px;
  }
}

@layer utilities {
  .text-gradient {
    background: var(--mosquito-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .bg-gradient-primary {
    background: var(--mosquito-gradient-primary);
  }

  .bg-gradient-secondary {
    background: var(--mosquito-gradient-secondary);
  }

  .bg-gradient-accent {
    background: var(--mosquito-gradient-accent);
  }

  .shadow-glow {
    box-shadow: var(--mosquito-shadow-glow);
  }

  .touch-target {
    min-height: var(--mosquito-touch-min);
    min-width: var(--mosquito-touch-min);
  }
}
