/* 
 * Raibasi Foundation - Custom CSS Stylesheet
 * Integrates with Tailwind CSS for layout and provides custom themes, glassmorphism, and premium micro-interactions.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@400;500;600;700;800&display=swap');

/* Color Design System Tokens */
:root {
  --primary-rgb: 0, 82, 180;        /* Raibasi Royal Blue */
  --primary: hsl(213, 100%, 35%);
  --primary-light: hsl(213, 90%, 96%);
  --secondary: hsl(137, 67%, 42%);   /* Leaf Green */
  --accent: hsl(22, 90%, 55%);        /* Hope Orange */
  
  --bg-main: hsl(210, 20%, 98%);       /* Clean, soft slate background */
  --bg-card: hsl(0, 0%, 100%);
  --text-main: hsl(220, 25%, 12%);
  --text-muted: hsl(220, 10%, 45%);
  --border-color: hsl(220, 15%, 92%);
  --nav-bg: rgba(255, 255, 255, 0.8);
  
  --font-sans: 'Inter', sans-serif;
  --font-title: 'Montserrat', sans-serif;
}

/* Dark Mode Tokens */
.dark {
  --bg-main: hsl(222, 47%, 9%);      /* Dark Slate */
  --bg-card: hsl(222, 47%, 13%);
  --text-main: hsl(210, 40%, 96%);
  --text-muted: hsl(215, 20%, 70%);
  --border-color: hsl(222, 30%, 20%);
  --nav-bg: rgba(15, 23, 42, 0.8);
  --primary-light: hsl(213, 50%, 12%);
}

/* Global Reset & Typography Base */
html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: hsl(213, 60%, 45%);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(213, 70%, 35%);
}

/* Modern Glassmorphism Card Utility */
.glass-card {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

.dark .glass-card {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Interactive Sticky Navbar Glass Effect */
.nav-sticky {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.dark .nav-sticky {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

/* Animations Core Styles */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Custom Micro-animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(251, 146, 60, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(251, 146, 60, 0.6);
  }
}

.pulse-badge {
  animation: pulseGlow 2s infinite ease-in-out;
}

/* Floating WhatsApp Widget Animation */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.whatsapp-float {
  animation: float 3s ease-in-out infinite;
}

/* Grid Cause Cards Hover Enhancements */
.cause-card {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}
.cause-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(0, 82, 180, 0.15);
}

.dark .cause-card:hover {
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
}

/* Hero Gradient Overlay */
.hero-gradient {
  background: linear-gradient(
    135deg,
    rgba(0, 82, 180, 0.85) 0%,
    rgba(15, 23, 42, 0.85) 100%
  );
}

/* Dynamic Interactive Toggle Button */
.toggle-checkbox:checked + .toggle-label {
  background-color: var(--primary);
}

.toggle-checkbox:checked + .toggle-label .toggle-dot {
  transform: translateX(100%);
}

/* Carousel/Testimonial Fade Transitions */
.testimonial-slide {
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

/* Interactive SVG Icons Scale on hover */
.social-icon-hover {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.social-icon-hover:hover {
  transform: scale(1.2) rotate(8deg);
}

/* Highlight Text Gradient */
.text-brand-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dark .text-brand-gradient {
  background: linear-gradient(135deg, hsl(213, 75%, 55%) 0%, hsl(22, 90%, 65%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Event Campaign Banner Timeline Pulse Badge */
.event-live-indicator::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* ==========================================
   Header Text Color Scroll-Top Adaptations
   ========================================== */
#main-header:not(.nav-sticky) .text-slate-800,
#main-header:not(.nav-sticky) .text-slate-700,
#main-header:not(.nav-sticky) .text-slate-600 {
  color: rgba(255, 255, 255, 0.95);
}

/* Premium Orange Hover Transition for contrast when transparent at top */
#main-header:not(.nav-sticky) a:hover {
  color: var(--accent) !important;
}
#main-header:not(.nav-sticky) button:hover i {
  color: var(--accent) !important;
}

/* Smooth logo transitions and color adjustments for visibility */
img[alt="logo"] {
  transition: filter 0.3s ease, transform 0.3s ease;
}

/* Invert dark logo to high-contrast white when at top (transparent header) OR when dark mode is enabled */
#main-header:not(.nav-sticky) img[alt="logo"],
.dark #main-header img[alt="logo"] {
  filter: brightness(0) invert(1) brightness(1.2);
}

/* Revert back to original brand colors when scrolled down in light mode */
.nav-sticky:not(.dark) img[alt="logo"] {
  filter: none;
}

