/* ===== Custom CSS for Sankalp Seva Parmo Dharma Trust ===== */

/* --- Marquee Animation --- */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-25%); }
}

@keyframes marquee-reverse {
  0% { transform: translateX(-25%); }
  100% { transform: translateX(0); }
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 25s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

/* --- Navbar Transitions --- */
@keyframes navFadeDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.navbar-main {
  transition: background-color 0.4s, padding 0.4s;
}

.navbar-main.scrolled {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  animation: navFadeDown 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  width: 95%;
  max-width: 1400px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 32px rgba(13, 115, 119, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  padding: 0.5rem 2rem;
  border: 1px solid rgba(13, 115, 119, 0.1);
}

.navbar-main.scrolled .nav-logo {
  height: 44px;
}

/* --- Glassmorphism --- */
.glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.glass-dark {
  background: rgba(13, 60, 62, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(13, 115, 119, 0.12);
}

/* --- Gradient Overlays --- */
.hero-overlay {
  background: linear-gradient(135deg, rgba(6, 90, 94, 0.85) 0%, rgba(13, 115, 119, 0.65) 50%, rgba(232, 136, 47, 0.4) 100%);
}

.gradient-teal {
  background: linear-gradient(135deg, #065a5e 0%, #0d7377 50%, #149599 100%);
}

.gradient-saffron {
  background: linear-gradient(135deg, #c96f22 0%, #e8882f 50%, #f0a556 100%);
}

/* --- Lotus Pattern Background --- */
.lotus-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 10 C25 20, 15 25, 10 30 C15 35, 25 40, 30 50 C35 40, 45 35, 50 30 C45 25, 35 20, 30 10Z' fill='none' stroke='%230d7377' stroke-width='0.5' opacity='0.06'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

/* --- Counter Animation --- */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* --- Gallery Lightbox --- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* --- Mobile Drawer --- */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 360px;
  height: 100vh;
  background: linear-gradient(180deg, #065a5e 0%, #0d7377 100%);
  z-index: 9998;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

.mobile-drawer.open {
  right: 0;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9997;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* --- Section Divider --- */
.section-divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #0d7377, #e8882f);
  border-radius: 2px;
  margin: 0 auto;
}

/* --- Card Hover Effects --- */
.team-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.team-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(13, 115, 119, 0.18);
}

.team-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0d7377, #e8882f);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.team-card:hover::after {
  transform: scaleX(1);
}

/* --- Focus Area Cards --- */
.cause-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cause-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0d7377, #e8882f);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.cause-card:hover::before {
  transform: scaleX(1);
}

.cause-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(13, 115, 119, 0.15);
}

/* --- Scroll Animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Page Hero Banner --- */
.page-hero {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, #faf8f5, transparent);
}

/* --- Smooth Scroll --- */
html {
  scroll-behavior: smooth;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0d7377, #065a5e);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #065a5e;
}

/* --- Form Styles --- */
.form-input {
  transition: all 0.3s ease;
  border: 2px solid #e5e7eb;
}

.form-input:focus {
  border-color: #0d7377;
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.15);
  outline: none;
}

/* --- Donation / CTA Button Pulse --- */
.pulse-btn {
  animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(232, 136, 47, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(232, 136, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 136, 47, 0); }
}

/* --- Responsive Tweaks --- */
@media (max-width: 768px) {
  .marquee-track {
    animation-duration: 20s;
  }
  
  .navbar-main.scrolled {
    width: 97%;
    padding: 0.35rem 1rem;
    top: 8px;
    border-radius: 24px;
  }
}

/* --- Gallery Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 90, 94, 0.6), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* --- Membership Cards --- */
.membership-card {
  transition: all 0.4s ease;
  position: relative;
}

.membership-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.membership-card.featured {
  border: 2px solid #e8882f;
}

.membership-card.featured::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #0d7377, #e8882f);
  border-radius: inherit;
  z-index: -1;
  padding: 2px;
}

/* --- Loading Spinner --- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(13, 115, 119, 0.2);
  border-top-color: #0d7377;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- Hindi Typography Adjustments --- */
html[lang="hi"] #mainNav a[data-hi] {
  font-size: 1.05rem; /* ~15% larger than text-sm (0.875rem) for desktop nav */
}

html[lang="hi"] #mobileDrawer nav a span[data-hi] {
  font-size: 1.15rem; /* ~15% larger than base (1rem) for mobile drawer nav */
}
