/* ==========================================================================
   BantuWarga - Cheerful & Playful Design System
   Inspired by Modern Bento, Colorful EdTech & Playful Gamified Apps
   ========================================================================== */

/* Note: Font Plus Jakarta Sans is loaded asynchronously via HTML link rel with preconnect for optimal performance */

:root {
  /* Cheerful Color Palette */
  --ceria-bg: #FAF6F0;           /* Warm Ivory Cream canvas */
  --ceria-card: #FFFFFF;         /* Crisp White */
  --ceria-border: #F1E9DF;       /* Warm subtle border */
  --ceria-dark: #18181B;         /* Charcoal Pill Dark */
  
  --ceria-coral: #FF6584;        /* Vibrant Coral / Pink */
  --ceria-peach: #FF8A5B;        /* Warm Peach */
  --ceria-orange: #FF9F43;       /* Sunny Tangerine */
  --ceria-yellow: #FBBF24;       /* Warm Yellow */
  --ceria-mint: #2EC4B6;         /* Fresh Mint */
  --ceria-pine: #1E5E4E;         /* Deep Jade / Pine Green */
  --ceria-purple: #7C5CFC;       /* Cheerful Periwinkle */
  
  --card-border: #F1E9DF;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #FAF6F0;
  color: #1E293B;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Custom Scrollbar for sleek cheerful feel */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #F3EDE4;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Glassmorphism Accents */
.glass-header {
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(241, 233, 223, 0.9);
}

.glass-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

/* Cheerful Bento Cards */
.ceria-card {
  border-radius: 28px;
  background: #FFFFFF;
  border: 1.5px solid #F1E9DF;
  box-shadow: 0 10px 25px -4px rgba(28, 25, 23, 0.04), 0 4px 10px -2px rgba(28, 25, 23, 0.02);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.26s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.26s ease;
}

.ceria-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px -6px rgba(28, 25, 23, 0.08), 0 8px 16px -3px rgba(255, 101, 132, 0.08);
  border-color: #F8D7DA;
}

.ceria-card:active {
  transform: translateY(-1px);
}

/* Legacy tool-card alias */
.tool-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px -6px rgba(28, 25, 23, 0.08);
}

/* Cheerful Pill Badges & Buttons */
.ceria-pill {
  border-radius: 9999px;
  transition: all 0.2s ease;
}

/* High-Contrast Charcoal Dark Pill Button (Reference Screen 1, 4, 5, 6) */
.btn-dark-pill {
  background-color: #18181B;
  color: #FFFFFF;
  border-radius: 9999px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(24, 24, 27, 0.18);
}
.btn-dark-pill:hover {
  background-color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(24, 24, 27, 0.28);
}
.btn-dark-pill:active {
  transform: scale(0.96);
}

/* Colorful Cheerful Gradients */
.bg-ceria-coral {
  background: linear-gradient(135deg, #FF6584 0%, #FF8A5B 100%);
  color: #FFFFFF;
}

.bg-ceria-pine {
  background: linear-gradient(135deg, #1B4D3E 0%, #2A7A66 100%);
  color: #FFFFFF;
}

.bg-ceria-purple {
  background: linear-gradient(135deg, #7C5CFC 0%, #9F7AEA 100%);
  color: #FFFFFF;
}

.bg-ceria-tangerine {
  background: linear-gradient(135deg, #FF9F43 0%, #FF7675 100%);
  color: #FFFFFF;
}

/* Circular Stat Bubble (Reference Screen 2) */
.stat-bubble {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

/* Cheerful Mascot Animations */
@keyframes floatMascot {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-6px) rotate(1.5deg);
  }
}

.animate-mascot {
  animation: floatMascot 3.2s ease-in-out infinite;
}

/* Waving Hand Delight Animation */
@keyframes waveHand {
  0%, 100% { transform: rotate(0deg); }
  20%, 60% { transform: rotate(14deg); }
  40%, 80% { transform: rotate(-8deg); }
}

.animate-wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: waveHand 2s ease-in-out infinite;
}

/* Hero Staggered Entrance Animations */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-hero-1 {
  animation: heroFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
.animate-hero-2 {
  animation: heroFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}
.animate-hero-3 {
  animation: heroFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}
.animate-hero-4 {
  animation: heroFadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both;
}

/* Bubbly Tap & Micro-interaction Classes */
.bubbly-tap {
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, background-color 0.15s ease !important;
}
.bubbly-tap:hover {
  transform: translateY(-2px);
}
.bubbly-tap:active {
  transform: scale(0.94) !important;
}

/* Tool Card Subcard Icon Delight Hover */
.subcard-icon {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.tool-card:hover .subcard-icon {
  transform: scale(1.15) rotate(-6deg);
}

/* Gentle Pulse for Live Badges */
@keyframes gentlePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.2); }
}
.pulse-dot {
  animation: gentlePulse 2.4s ease-in-out infinite;
}

@keyframes cuteWiggle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.06) rotate(-3deg); }
  75% { transform: scale(1.06) rotate(3deg); }
}

.hover-wiggle:hover {
  animation: cuteWiggle 0.6s ease-in-out infinite;
}

/* Category Filter Active Pill */
.filter-btn {
  border-radius: 9999px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.filter-btn.active {
  background-color: #18181B;
  color: #FFFFFF;
  border-color: #18181B;
  box-shadow: 0 6px 18px -2px rgba(24, 24, 27, 0.3);
}
.filter-btn .filter-count {
  transition: background-color 0.2s ease, color 0.2s ease;
}
.filter-btn.active .filter-count {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: #FFFFFF !important;
}

/* Quick Keyword Search Chips */
.quick-chip {
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease;
}
.quick-chip:hover {
  transform: translateY(-1px);
}
.quick-chip:active {
  transform: scale(0.94);
}

/* ========================================================
   FLOATING BOTTOM DOCK & APP SWITCHER DRAWER STYLES
   ======================================================== */
.bantuwarga-floating-dock {
  position: fixed !important;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
  left: 0.75rem !important;
  right: 0.75rem !important;
  max-width: 440px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  z-index: 50 !important;
  background-color: #1E1E1E !important;
  color: #FFFFFF !important;
  border-radius: 9999px !important;
  box-shadow: 0 20px 40px -6px rgba(0, 0, 0, 0.55), 0 8px 20px -2px rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  padding: 8px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-around !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

.bantuwarga-floating-dock .dock-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  padding: 6px 4px !important;
  color: #A1A1AA !important;
  text-decoration: none !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 9999px !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  outline: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.bantuwarga-floating-dock .dock-item i,
.bantuwarga-floating-dock .dock-item svg {
  width: 20px !important;
  height: 20px !important;
  margin-bottom: 2px !important;
  stroke-width: 2.2 !important;
  transition: transform 0.2s ease, color 0.2s ease !important;
}

.bantuwarga-floating-dock .dock-item:active {
  transform: scale(0.92) !important;
}

.bantuwarga-floating-dock .dock-item:hover {
  color: #FFFFFF !important;
}

.bantuwarga-floating-dock .dock-item.active {
  color: #52B788 !important;
}

.bantuwarga-floating-dock .dock-item.active i,
.bantuwarga-floating-dock .dock-item.active svg {
  color: #52B788 !important;
  transform: translateY(-1px) scale(1.05) !important;
}

/* Tombol Highlight Khusus: Semua Alat (App Switcher) */
.bantuwarga-floating-dock .dock-item.dock-item-highlight {
  color: #52B788 !important;
}

.bantuwarga-floating-dock .dock-item.dock-item-highlight i,
.bantuwarga-floating-dock .dock-item.dock-item-highlight svg {
  color: #52B788 !important;
  stroke-width: 2.4 !important;
}

.bantuwarga-floating-dock .dock-item.dock-item-highlight:hover i,
.bantuwarga-floating-dock .dock-item.dock-item-highlight:hover svg {
  transform: scale(1.12) !important;
}

/* App Switcher Drawer Animations */
#bw-app-switcher-backdrop {
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#bw-app-switcher-drawer {
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
  will-change: transform;
}

/* ========================================================
   SOLID NATIVE MOBILE BOTTOM NAVIGATION BAR (NON-FLOATING)
   ======================================================== */
.bantuwarga-bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 50 !important;
  width: 100% !important;
  height: 58px !important;
  background-color: #FFFFFF !important;
  border-top: 1px solid #E2E8F0 !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
  padding: 6px 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-around !important;
}

.bantuwarga-nav-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  height: 100% !important;
  padding: 2px !important;
  color: #64748B !important;
  text-decoration: none !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  background: transparent !important;
  transform: none !important;
  transition: color 0.15s ease-in-out, transform 0.15s ease-in-out !important;
}

.bantuwarga-nav-item i,
.bantuwarga-nav-item svg {
  width: 20px !important;
  height: 20px !important;
  margin-bottom: 2px !important;
  stroke-width: 2.2 !important;
  transition: transform 0.15s ease-in-out, color 0.15s ease-in-out !important;
}

.bantuwarga-nav-item:active {
  transform: scale(0.9) !important;
}

.bantuwarga-nav-item.active {
  color: #059669 !important; /* emerald-600 */
}

.bantuwarga-nav-item.active i,
.bantuwarga-nav-item.active svg {
  color: #059669 !important;
  transform: translateY(-1px) scale(1.08) !important;
}

@media (min-width: 768px) {
  .bantuwarga-bottom-nav,
  .bantuwarga-floating-dock,
  .ceria-bottom-dock,
  .habitz-bottom-dock {
    display: none !important;
  }
}

@media print {
  .bantuwarga-bottom-nav,
  .bantuwarga-floating-dock,
  .ceria-bottom-dock,
  .habitz-bottom-dock {
    display: none !important;
  }
}

/* Modal Animations */
@keyframes modalBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalContentSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-backdrop-animate {
  animation: modalBackdropFadeIn 0.22s ease-out forwards;
}

.modal-content-animate {
  animation: modalContentSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Toast Notification Animation */
@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-animate {
  animation: toastSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ========================================================
   PERFORMANCE ACCELERATION UTILITIES (Core Web Vitals)
   ======================================================== */
.content-visibility-auto {
  content-visibility: auto;
  contain-intrinsic-size: 1px 650px;
}

/* Hardware-acceleration hint for interactive bento cards */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ========================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION SUPPORT
   ======================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print Optimization */
@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #FFFFFF;
    color: #000000;
  }
}
