@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-blue: #0A28C8; /* Brand deep blue */
  --text-dark: #121829;
  --text-light: #5A6273;
  --bg-white: #F9FAFC; /* slightly dimmed white */
  --bg-offwhite: #F8FAFC;
  --bg-light-blue: #F0F4FE;
  --bg-light-pink: #FFF4F8;
  --border-color: #E2E8F0;
  
  --font-main: 'Inter', sans-serif;
  
  --transition: all 0.3s ease;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text-dark);
  background-color: var(--bg-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html {
  font-size: clamp(12px, 2.5vw, 16px);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* Prevent stretching for content images */
img:not(.logo img, .footer-logo img) {
  object-fit: cover;
  height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.5em;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw + 1rem, 4rem); }
h2 { font-size: clamp(2rem, 4vw + 0.5rem, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem); }
h4 { font-size: clamp(1.1rem, 2vw + 0.25rem, 1.5rem); }

.text-gradient, .text-blue {
  color: var(--primary-blue);
}

.font-light { font-weight: 300; }
.italic { font-style: italic; }

/* Layout Utilities */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section-padding {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.flex {
  display: flex;
}
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }
.gap-3 { gap: 3rem; }

.grid {
  display: grid;
}
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-gap { gap: 2rem; }

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  border: 1px solid transparent;
  transform: translateY(0);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 40, 200, 0.15);
}

.btn-primary {
  background-color: var(--primary-blue);
  color: #fff;
}
.btn-primary:hover {
  background-color: #061c9e;
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}
.btn-outline:hover {
  background-color: var(--bg-light-blue);
}

.btn-white {
  background-color: #fff;
  color: var(--primary-blue);
}

/* Image Placeholder */
.img-placeholder {
  background-color: var(--bg-light-pink);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.8rem;
  letter-spacing: 1px;
  min-height: 200px;
  width: 100%;
}

/* User Avatar (No-DP look) */
.user-avatar {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 50%;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  overflow: hidden;
}
.user-avatar svg {
  width: 24px;
  height: 24px;
}

.user-avatar.featured-avatar {
  background-color: rgba(255,255,255,0.2);
  color: white;
}

/* Header & Nav */
header {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-blue);
  flex-shrink: 0;
}

.logo img {
  height: 80px; /* Increased size */
  width: auto;
  transition: transform 0.3s ease;
}

.logo:hover img {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links li a {
  font-size: 0.95rem;
  color: var(--text-light);
  padding-bottom: 0.5rem;
  transition: color 0.3s ease, border-color 0.3s ease;
  border-bottom: 2px solid transparent;
}
.nav-links li a:hover, 
.nav-links li a.active {
  color: var(--text-dark);
  border-bottom-color: var(--primary-blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
}
.icon-btn:hover { color: var(--primary-blue); }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
}

/* Badge overlay / Small pills */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--bg-light-pink);
  color: #C20F5C;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 20px;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

/* Footer */
footer {
  padding: 4rem 0 2rem;
  background-color: var(--bg-white);
  border-top: 1px solid var(--border-color);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 4rem;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-blue);
  margin-bottom: 1rem;
  display: block;
}

.footer-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  max-width: 300px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-light);
  font-size: 0.9rem;
}
.footer-links a:hover { color: var(--primary-blue); }

.footer-socials {
  display: flex;
  gap: 1rem;
}
.footer-socials a { color: var(--text-light); }
.footer-socials a:hover { color: var(--primary-blue); }

.footer-bottom {
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-light);
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

/* Standardized Hero Sections (split text / image) */
.hero-split {
  align-items: center;
  min-height: 80vh;
  position: relative;
  overflow: hidden;
}
.hero-split::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 50%; height: 100%;
  background: transparent;
  z-index: -1;
}
.hero-content {
  padding-right: 3rem;
}
.hero-img {
  width: 100%;
  height: 500px;
}

/* General Stats Row */
.stats-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
  padding: 3rem 0;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0,0,0,0.02);
}
.stat-item h3 {
  font-size: 2.5rem;
  color: var(--primary-blue);
  margin-bottom: 0.25rem;
}
.stat-item p {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

/* Call to Action Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--primary-blue), #3b5bdb);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  color: white;
  margin: 6rem auto;
}
.cta-banner h2 {
  color: white;
}
.cta-banner p {
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin: 1.5rem auto 2.5rem;
}
.cta-banner .btn {
  margin: 0 0.5rem;
}

/* Responsive */
@media (max-width: 1200px) {
  .nav-links {
    gap: 1rem;
  }
  .nav-links li a {
    font-size: 0.85rem;
  }
}

@media (max-width: 910px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  
  .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
  
  .hero-split {
    flex-direction: column;
    padding-top: 3rem;
  }
  .hero-split::before { display: none; }
  .hero-content {
    padding-right: 0;
    margin-bottom: 3rem;
    text-align: center;
    align-items: center;
  }
  .hero-content h1 {
    text-align: center !important;
  }
  .hero-content p {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .hero-content .badge {
    align-self: center !important;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-desc {
    margin: 0 auto;
  }
  .footer-socials {
    justify-content: center;
  }
  
  .carousel-container {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .carousel-container::-webkit-scrollbar {
    display: none;
  }
  .carousel-track {
    animation: none !important;
    width: max-content;
  }
  .carousel-card {
    scroll-snap-align: start;
    width: 280px;
  }
}

@media (max-width: 910px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; width: 100%;
    background: var(--bg-light-blue);
    flex-direction: column;
    padding: 0;
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    z-index: 100;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    gap: 0;
  }
  .nav-links li {
    width: 100%;
    list-style: none;
    border-bottom: 1px solid rgba(10, 40, 200, 0.05);
  }
  .nav-links li:last-child {
    border-bottom: none;
  }
  .nav-links a {
    display: block;
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 18px !important;
    color: var(--primary-blue) !important;
    text-align: center;
    border-bottom: none !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 500;
  }
  .nav-links a:hover, .nav-links a.active {
    background-color: rgba(10, 40, 200, 0.08);
    color: var(--text-dark) !important;
  }
  .nav-links.active { 
    max-height: 500px;
    opacity: 1;
  }
  .mobile-menu-btn { 
    display: block; 
    transition: transform 0.3s ease; 
    margin-left: 1rem; 
    font-size: 28px !important;
    padding: 0.25rem 0.5rem;
  }
  .mobile-menu-btn.active { transform: rotate(90deg); }
  .header-actions { 
    display: flex !important; 
    margin-left: auto;
  }
  .header-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  
  /* Main structural elements stack */
  main section.flex, .hero-split, .stats-row, section[style*="display: flex"], section > div[style*="display: grid"], .flex.gap-3 {
    flex-direction: column !important;
    gap: 2rem !important;
  }
  
  /* Ensure structural columns expand */
  main section.flex > div, section > div[style*="display: flex"], .hero-split > div, .flex.gap-3 > div {
    width: 100% !important;
    flex-direction: column !important;
  }
  
  /* Ensure nested cards stack */
  section > div > div[style*="display: flex"]:not(:has(.img-placeholder)):not(.flex.gap-3) {
    flex-direction: column !important;
  }
  
  .hover-card[style*="display: flex"] {
    flex-direction: column !important;
    text-align: center;
  }
  
  .hover-card[style*="display: flex"] .img-placeholder {
    width: 100% !important;
    height: 200px !important;
    margin-bottom: 1.5rem;
  }
  
  .hover-card {
    width: 100% !important;
  }
  
  .hero-btns {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
  }
  .cta-banner, section[style*="background-color: var(--primary-blue)"], div[style*="padding: 4rem"][style*="var(--primary-blue)"] {
    padding: 3rem 1.5rem !important;
    text-align: center;
    gap: 2rem !important;
  }
  .cta-banner .grid, section .grid, .grid-cols-2, .grid-cols-3, .gallery-grid {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .mobile-hide {
    display: none !important;
  }
  
  .reverse-on-mobile {
    flex-direction: column-reverse !important;
  }

  .contact-info-container { order: 1; }
  .contact-whatsapp-container { order: 2; }
  .contact-map-container { order: 3; }
  
  /* Footer structured split */
  .footer-top {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
    text-align: left;
  }
  .footer-top > div:first-child {
    grid-column: 1 / -1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .footer-col {
    text-align: left;
    align-items: flex-start;
    display: flex;
    flex-direction: column;
  }
  .footer-col:last-child {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
  }
  .footer-links {
    align-items: flex-start;
  }
  .footer-socials {
    justify-content: center;
    width: 100%;
  }
  .footer-bottom {
    text-align: center;
    gap: 1rem;
    flex-direction: column;
  }
  
  /* Gap under video box on mobile */
  .video-section {
    padding-bottom: 6rem !important;
  }
  
  .gallery-item.large {
    grid-column: span 1;
    display: none !important;
  }

  .gallery-grid {
    gap: 1.5rem !important;
  }
  main > section:first-child > h1, 
  main > section:first-child > p,
  main > section:first-child > h2,
  main > section:first-child > .badge {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }
  .shg-mobile-hide {
    display: none !important;
  }
  .gallery-mobile-hide {
    display: none !important;
  }
  
  /* Make Blue CTA responsive typography */
  div[style*="padding: 4rem"][style*="var(--primary-blue)"] h2 {
    font-size: 2rem !important;
  }
  div[style*="padding: 4rem"][style*="var(--primary-blue)"] p {
    font-size: 1.15rem !important;
  }
  
  /* Impact Page buttons stacking */
  .flex.gap-1.justify-center {
    flex-direction: column !important;
    width: 100% !important;
  }
  .flex.gap-1.justify-center > a {
    width: 100% !important;
    text-align: center;
    box-sizing: border-box;
  }
  
  .hero-btns {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  
  /* Reduce excessive padding in donation box */
  div[style*="padding: 3rem;"] {
    padding: 1.5rem !important;
  }
  section[style*="padding: 5rem 2rem;"] {
    padding: 2.5rem 1rem !important;
  }
  section[style*="padding: 5rem 3rem;"] {
    padding: 2.5rem 1rem !important;
  }
  
  .mobile-center-text {
    padding-left: 0 !important;
    text-align: center;
  }
  .mobile-center-ul {
    align-items: center;
    text-align: center;
  }
  .mobile-center-ul li {
    justify-content: center;
  }
  .filter-tabs {
    justify-content: center;
  }
  
  /* Disable carousel and stack cards for Academy page */
  .carousel-container {
    overflow: visible !important;
  }
  .carousel-track {
    animation: none !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  .carousel-card {
    width: 100% !important;
  }
  /* Hide the duplicated cards used for infinite scroll */
  .carousel-card:nth-child(n+5) {
    display: none !important;
  }
}

/* Page Load Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

main > section {
  animation: fadeIn 0.8s ease-out forwards;
}

/* General Card Hover Effect */
.hover-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.hover-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08) !important;
}

/* Float Animation */
@keyframes floatAnimation {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

.float-anim {
  animation: floatAnimation 6s ease-in-out infinite;
}

.no-pink-bg::before {
  display: none !important;
}

/* Image Placeholder Hover */
.img-placeholder {
  transition: transform 0.4s ease, opacity 0.4s ease;
  overflow: hidden;
}
.img-placeholder:hover {
  transform: translateY(-4px);
  opacity: 0.9;
}

/* Infinite Carousel */
.carousel-container {
  overflow: hidden;
  width: 100%;
  position: relative;
  padding: 1rem 0;
}
.carousel-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: scrollRight 25s linear infinite;
}
.carousel-track:hover {
  animation-play-state: paused;
}
.carousel-card {
  width: min(85vw, 350px);
  flex-shrink: 0;
}
@keyframes scrollRight {
  0% { transform: translateX(calc(-50% - 1rem)); }
  100% { transform: translateX(0); }
}

/* WhatsApp Button Smooth Hover */
.wa-btn {
  transition: all 0.3s ease !important;
}
.wa-btn:hover {
  background-color: #1DA851 !important;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
}
.reveal.active {
  animation: slideUpFade 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Floating Mosaic Grid */
.floating-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  perspective: 1000px;
}

.floating-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  animation: floatingMosaic 8s ease-in-out infinite;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.floating-item:hover {
  transform: scale(1.05) rotateX(5deg) rotateY(5deg) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  z-index: 10;
  animation-play-state: paused;
}

@keyframes floatingMosaic {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(1deg); }
  50% { transform: translateY(-5px) rotate(-1deg); }
  75% { transform: translateY(-20px) rotate(0.5deg); }
}

@media (max-width: 992px) {
  .floating-mosaic {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .floating-mosaic {
    grid-template-columns: 1fr;
  }
}

/* Hero Album Animation */
.hero-album {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-width: 550px;
  margin: 0 auto;
}

.album-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  opacity: 0;
  transform: scale(0.9) translateX(50px);
  animation: albumStack 12s infinite;
  background: var(--bg-offwhite);
}

.album-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-item:nth-child(1) { animation-delay: 0s; }
.album-item:nth-child(2) { animation-delay: 3s; }
.album-item:nth-child(3) { animation-delay: 6s; }
.album-item:nth-child(4) { animation-delay: 9s; }

@keyframes albumStack {
  0% { opacity: 0; transform: scale(0.9) translateX(50px); z-index: 1; }
  4% { opacity: 1; transform: scale(1) translateX(0); z-index: 10; }
  25% { opacity: 1; transform: scale(1) translateX(0); z-index: 10; }
  30% { opacity: 0; transform: scale(1.1) translateX(-100px) rotate(-5deg); z-index: 1; }
  100% { opacity: 0; transform: scale(0.9) translateX(50px); z-index: 1; }
}

/* Instagram Reel Overlay */
.reel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-blue);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  border-radius: var(--radius-sm);
  transition: opacity 0.3s ease;
}
.reel-overlay:hover {
  opacity: 0.95;
}
.reel-overlay .play-icon {
  margin-bottom: 1rem;
  opacity: 0.9;
  width: 50px;
  height: 50px;
  background: white;
  color: var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-overlay .text-brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 2px;
}
.reel-overlay .text-hint {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  opacity: 0.8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}
