/* ===== THEME: GREEN HEADER FOOTER + WHITE CONTENT ===== */
:root {
  /* Main Colors */
  --primary: #166534;        /* Dark Green - Header/Footer */
  --primary-light: #22C55E;  /* Bright Green - Buttons, Hover */
  --primary-dark: #14532D;   /* Darker Green - Footer */
  
  /* Accent */
  --accent: #F59E0B;         /* Amber - Donate button only */
  
  /* Backgrounds */
  --bg-white: #FFFFFF;       /* Middle content pure white */
  --bg-light: #FFFFFF;       /* Sections white */
  --bg-soft: #F9FAFB;        /* Alternate section light gray */
  
  /* Text */
  --text-dark: #1F2937;      /* Dark text for white bg */
  --text-gray: #6B7280;      /* Secondary text */
  --text-light: #FFFFFF;     /* White text for green bg */
  
  /* Shadows & Effects */
  --shadow-sm: 0 2px 8px rgba(22, 101, 52, 0.08);
  --shadow-md: 0 4px 20px rgba(22, 101, 22, 0.15);
  --shadow-lg: 0 10px 40px rgba(22, 101, 52, 0.2);
  --shadow-hover: 0 20px 50px rgba(34, 197, 94, 0.3);
  --shadow-primary: 0 8px 25px rgba(34, 197, 94, 0.3);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #166534 0%, #22C55E 100%);
  --gradient-secondary: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
  --gradient-hero: linear-gradient(135deg, #166534 0%, #14532D 100%);
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-soft);
  color: var(--text-dark);
  line-height: 1.7;
  /* Removed background-image for a cleaner look on admin pages */
  transition: background 0.3s, color 0.3s;
}

html {
  scroll-behavior: smooth;
}

/* ===== FIX: LOADING SCREEN REMOVE ===== */
.preloader,
#preloader,
.loading,
#loading {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  z-index: -9999 !important;
}

body {
  overflow: visible !important;
}

/* ===== HEADER - GREEN ===== */
header {
  background: var(--primary);
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  transition: 0.3s;
}

header.scrolled {
  padding: 10px 5%;
  box-shadow: var(--shadow-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-light);
}

.logo-circle {
  width: 48px;
  height: 48px;
  background: var(--gradient-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
  box-shadow: var(--shadow-primary);
}

.logo-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  box-shadow: var(--shadow-primary);
}

.preloader-logo {
  width: 60px; /* Slightly larger for preloader */
  height: 60px;
}

.logo strong {
  font-size: 18px;
  line-height: 1.2;
}

.logo small {
  font-size: 11px;
  opacity: 0.9;
}

nav {
  display: flex;
  gap: 35px;
}

nav a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  position: relative;
  transition: 0.3s;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  background: var(--primary-light);
  transition: 0.3s;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

nav a:hover,
nav a.active {
  color: var(--accent);
  color: var(--primary-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

#darkModeToggle {
  background: transparent;
  border: 2px solid var(--text-light);
  color: var(--text-light);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

#darkModeToggle:hover {
  background: var(--text-light);
  color: var(--primary);
}

.btn {
  background: var(--gradient-primary);
  color: var(--text-light);
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-primary);
  border: none;
  cursor: pointer;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background: var(--accent);
  color: var(--text-dark);
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
  border: 2px solid var(--accent);
}

.btn-secondary:hover {
  background: transparent;
  color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.5);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(245, 158, 11, 0.5); }
  50% { box-shadow: 0 10px 40px rgba(245, 158, 11, 0.8); }
}

.btn-large {
  padding: 16px 40px;
  font-size: 16px;
}

.btn-sm {
  background: var(--accent);
  color: var(--text-dark);
  padding: 10px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
}

.btn-mobile-action {
  width: calc(100% - 50px);
  max-width: 300px;
  padding: 12px 20px;
  font-size: 15px;
  border-radius: 10px;
  margin: 10px 25px 0;
  background: var(--primary-light);
  color: white;
  border: none;
  cursor: pointer;
}

/* PC पर मोबाइल बटन्स को छिपाएं */
.mobile-menu-actions {
  display: none;
}

.menu-icon {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  width: 25px;
  z-index: 1002;
}

.menu-icon span {
  width: 100%;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* Hamburger Animation */
.menu-icon.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-icon.active span:nth-child(2) { opacity: 0; }
.menu-icon.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===== HERO SLIDER - WHITE BACKGROUND ===== */
.hero-slider {
  position: relative;
  height: 700px;
  overflow: hidden;
  background: var(--bg-white);
}

#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  background: var(--bg-white);
}

.slide.active {
  opacity: 1;
}

.slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(22, 101, 52, 0.3) 0%, rgba(34, 197, 94, 0.4) 100%);
  z-index: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: zoomPan 20s infinite;
}

@keyframes zoomPan {
  0%, 100% {transform: scale(1);}
  50% {transform: scale(1.1);}
}

.slide-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-light);
  z-index: 2;
  width: 90%;
  max-width: 900px;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: var(--text-dark);
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  animation: fadeInUp 1s;
}

.slide-content h1 {
  font-size: 62px;
  margin-bottom: 20px;
  font-weight: 800;
  animation: fadeInUp 1s 0.2s backwards;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.slide-content p {
  font-size: 22px;
  margin-bottom: 35px;
  opacity: 0.95;
  animation: fadeInUp 1s 0.4s backwards;
}

.hero-btns {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 1s 0.6s backwards;
}

@keyframes fadeInUp {
  from {opacity: 0; transform: translateY(40px);}
  to {opacity: 1; transform: translateY(0);}
}

.slider-dots {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 3;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: 0.3s;
  border: 2px solid transparent;
}

.dot.active {
  background: var(--accent);
  width: 35px;
  border-radius: 7px;
  border-color: white;
}

/* ===== IMPACT STATS ===== */
.impact-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  padding: 80px 5%;
  background: var(--bg-soft);
}

.stat-item {
  text-align: center;
  padding: 30px;
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: 0.4s;
}

.stat-item:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.stat-item i {
  font-size: 48px;
  color: var(--primary-light);
  margin-bottom: 15px;
}

.stat-item h2 {
  font-size: 52px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 10px;
  font-weight: 800;
}

.stat-item p {
  color: var(--text-gray);
  font-weight: 600;
  font-size: 16px;
}

/* ===== SECTION ===== */
.section {
  padding: 100px 5%;
  background: var(--bg-white);
}

.bg-light {
  background: var(--bg-soft);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--text-dark);
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  font-size: 14px;
}

.section-title {
  font-size: 42px;
  color: var(--text-dark);
  margin-bottom: 15px;
  font-weight: 700;
}

.section-header p {
  color: var(--text-gray);
  font-size: 18px;
}

/* ===== CARDS ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
}

.card {
  background: var(--bg-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: 0.4s;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: var(--gradient-secondary);
  border-radius: 16px;
  opacity: 0;
  transition: 0.4s;
  z-index: -1;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s;
}

.card:hover img {
  transform: scale(1.1);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: 0.4s;
}

.card:hover .card-overlay {
  opacity: 1;
}

.card-body {
  padding: 30px;
}

.card-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 28px;
  margin-bottom: 15px;
  transition: 0.3s;
}

.card:hover .card-icon {
  transform: rotateY(360deg);
}

.card h3 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 22px;
}

.card p {
  color: var(--text-gray);
  line-height: 1.7;
  margin-bottom: 15px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-soft);
  border-radius: 10px;
  overflow: hidden;
  margin: 15px 0 8px;
}

.progress {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: width 1s ease;
}

.card small {
  color: var(--text-gray);
  font-size: 13px;
}

/* ===== 🔥 ROTATING BORDER HOVER - NO GREEN OVERLAY ===== */
.gallery-item,
.team-member,
.impact-card,
.program-card {
  overflow: hidden;
  border-radius: 15px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  background: var(--bg-white);
  padding: 3px;
}

/* Rotating Border */
.gallery-item::before,
.team-member::before,
.impact-card::before,
.program-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: conic-gradient(
    from 0deg,
    var(--accent) 0deg,
    #FBBF24 90deg,
    #FFF 180deg,
    #FBBF24 270deg,
    var(--accent) 360deg
  );
  border-radius: 15px;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.4s ease;
  animation: borderRotate 3s linear infinite;
  animation-play-state: paused;
}

.gallery-item:hover::before,
.team-member:hover::before,
.impact-card:hover::before,
.program-card:hover::before {
  opacity: 1;
  animation-play-state: running;
}

@keyframes borderRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.gallery-item img,
.team-member img,
.impact-card img,
.program-card img {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  transition: all 0.5s ease;
  display: block;
  width: 100%;
}

/* Hover: Only Lift + Zoom, NO GREEN */
.gallery-item:hover,
.team-member:hover,
.impact-card:hover,
.program-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.gallery-item:hover img,
.team-member:hover img,
.impact-card:hover img,
.program-card:hover img {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* ===== 🔥 FORM HOVER ANIMATIONS ===== */
.registration-form,
.contact-form,
.form-container {
  background: var(--bg-white);
  padding: 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: all 0.4s ease;
  border: 1px solid rgba(22, 101, 52, 0.1);
  /* Removed ::after for a cleaner form container */
  position: relative;
  overflow: hidden;
}

.form-container::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 100px;
  height: 100px;
  background: var(--primary-light);
  opacity: 0.1;
  border-radius: 50%;
}

input,
textarea,
select {
  width: 100%;
  padding: 15px;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
  box-sizing: border-box; /* Ensure padding doesn't increase width */
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
  transform: translateY(-2px);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  outline: none;
  transform: translateY(-2px);
}

/* General form input styles for admin panel */
.form-input, .form-textarea, .form-select {
    width: 100%; padding: 12px 15px; border: 1px solid #cbd5e0; border-radius: 8px; font-size: 15px; margin-bottom: 15px; box-sizing: border-box;
}

button[type="submit"] {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

button[type="submit"]:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

button[type="submit"]:active {
  transform: translateY(-1px) scale(1.02);
}

/* ===== PAGE HERO SECTIONS ===== */
.page-hero {
  color: var(--text-light);
  padding: 120px 5% 80px;
  text-align: center;
}

.page-hero-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent);
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  font-size: 14px;
  border: 1px solid var(--accent);
}

.page-hero-title {
  color: var(--text-light);
  font-size: 52px;
  margin-bottom: 20px;
  font-weight: 800;
}

.page-hero-text {
  font-size: 20px;
  opacity: 0.95;
  max-width: 700px;
  margin: 20px auto 0;
}

/* Specific Page Hero Overrides */
.volunteer-hero { background: var(--gradient-hero); }
.volunteer-hero .page-hero-badge { background: rgba(255,255,255,0.2); color: white; }
.volunteer-hero .page-hero-title { color: white; }

.contact-hero { background: var(--gradient-hero); }
.contact-hero .page-hero-badge { background: rgba(245, 158, 11, 0.2); color: var(--accent); }
.contact-hero .page-hero-title { color: white; }

.donate-hero { background: var(--gradient-hero); color: var(--text-light); }
.donate-hero .page-hero-badge { background: rgba(245, 158, 11, 0.2); color: var(--accent); }
.donate-hero .donate-hero-title { color: var(--text-light); }
.donate-hero .page-hero-text { color: var(--text-light); }

.programs-hero { background: var(--gradient-hero); }
.programs-hero .page-hero-badge { background: rgba(245, 158, 11, 0.2); color: var(--accent); }
.programs-hero .page-hero-title { color: white; }

.gallery-hero { background: var(--gradient-hero); }
.gallery-hero .page-hero-badge { background: rgba(245, 158, 11, 0.2); color: var(--accent); }
.gallery-hero .page-hero-title { color: white; }

.about-hero { background: var(--gradient-hero); }
.about-hero .page-hero-badge { background: rgba(245, 158, 11, 0.2); color: var(--accent); }
.about-hero .page-hero-title { color: white; }

/* ===== CONTACT & INFO ITEMS ===== */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.info-item {
  display: flex;
  align-items: start;
  gap: 20px;
  margin-bottom: 25px;
}

.info-icon-wrapper {
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.info-item h4 {
  color: var(--primary);
  margin-bottom: 5px;
}

.info-item p {
  color: #4A5568;
}

/* ===== TIMELINE ===== */
.timeline-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

/* ===== TESTIMONIALS ===== */
.testimonial-slider {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  padding: 40px;
}

.testimonial {
  display: none;
  text-align: center;
  animation: fadeIn 0.5s;
}

.testimonial.active {
  display: block;
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

.testimonial img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 20px;
  border: 4px solid var(--accent);
  box-shadow: var(--shadow-primary);
}

.testimonial p {
  font-size: 18px;
  color: var(--text-gray);
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.8;
}

.testimonial h4 {
  color: var(--primary);
  margin-bottom: 5px;
}

.testimonial span {
  color: var(--text-gray);
  font-size: 14px;
}

.testimonial-nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.testimonial-nav button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--bg-white);
  color: var(--primary);
  cursor: pointer;
  transition: 0.3s;
}

.testimonial-nav button:hover {
  background: var(--primary);
  color: var(--text-light);
}

/* ===== CTA SECTION ===== */
.cta-section {
  background: var(--gradient-hero);
  padding: 100px 5%;
  text-align: center;
  color: var(--text-light);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {transform: rotate(0deg);}
  to {transform: rotate(360deg);}
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-content h2 {
  font-size: 48px;
  margin-bottom: 20px;
}

.cta-content p {
  font-size: 20px;
  margin-bottom: 40px;
  opacity: 0.95;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== FOOTER ===== */
footer {
  background: var(--primary-dark);
  color: #E2E8F0;
  padding: 60px 5% 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 50px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 600;
}

.footer-col p {
  margin-bottom: 12px;
  opacity: 0.85;
  line-height: 1.8;
}

.footer-col a {
  color: #E2E8F0;
  text-decoration: none;
  opacity: 0.85;
  transition: 0.3s;
  display: inline-block;
}

.footer-col a:hover {
  opacity: 1;
  color: var(--accent);
  transform: translateX(5px);
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: rgba(245, 158, 11, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: 0.3s;
}

.social-links a:hover {
  background: var(--accent);
  color: var(--primary-dark);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 30px;
  text-align: center;
  opacity: 0.7;
  font-size: 14px;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-white);
  padding: 50px;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  position: relative;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from {transform: translateY(50px); opacity: 0;}
  to {transform: translateY(0); opacity: 1;}
}

.close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 32px;
  cursor: pointer;
  color: var(--text-gray);
  transition: 0.3s;
}

.close:hover {
  color: var(--text-dark);
  transform: rotate(90deg);
}

.modal-content h2 {
  margin-bottom: 10px;
  color: var(--primary);
}

.modal-content p {
  color: var(--text-gray);
  margin-bottom: 20px;
}

.amount-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 25px 0;
}

.amount-btn {
  padding: 15px;
  border: 2px solid #E5E7EB;
  background: var(--bg-white);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
  font-size: 16px;
}

.amount-btn:hover,
.amount-btn.selected {
  border-color: var(--accent);
  background: #FFFBEB;
  color: var(--primary);
}

.custom-input {
  width: 100%;
  padding: 15px;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 16px;
}

.tax-note {
  text-align: center;
  margin-top: 15px;
  font-size: 13px;
  color: var(--text-gray);
}

/* ===== BACK TO TOP ===== */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  color: var(--text-light);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-primary);
  transition: 0.3s;
  z-index: 999;
}

#backToTop.show {
  display: flex;
}

#backToTop:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* ===== RESPONSIVE ===== */
@media(max-width: 968px) {
  header { padding: 12px 4%; }
  .logo-img { width: 40px; height: 40px; }
  .logo strong { font-size: 15px; }
  .logo small { display: none; }
  .header-actions { gap: 10px; }

  /* मोबाइल पर बाहर वाले बटन्स को छिपाएं */
  #darkModeToggleDesktop, 
  .header-actions .desktop-donate-btn {
    display: none !important;
  }

  /* हैमबर्गर के अंदर वाले बटन्स का लेआउट */
  .mobile-menu-actions {
    flex-direction: column;
    gap: 15px;
    width: 100%;
    margin-top: 30px;
    display: none; /* डिफ़ॉल्ट रूप से बंद */
    align-items: center;
  }

  nav {
    position: fixed;
    top: 0; /* Changed from top: 0 */
    left: -100%; /* Changed from right: -100% */
    right: auto; /* Changed from left: auto */
    width: 100%;
    height: 100vh;
    background: rgba(22, 101, 52, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    justify-content: flex-start; /* ऊपर से शुरू करें */
    align-items: flex-start;    /* बाईं ओर अलाइन करें */
    padding: 90px 0 40px;       /* टॉप पैडिंग हेडर के लिए */
    gap: 5px;                  /* लिंक के बीच कम गैप */
    overflow-y: auto;          /* छोटे फोन पर स्क्रॉल करने दें */
    transition: all 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
  }

  nav.active {
    left: 0; /* Changed from right: 0 */
  }

  .menu-icon {
    display: flex;
  }

  /* मेनू खुलने पर ही बटन्स दिखाएं */
  nav.active .mobile-menu-actions { 
    display: flex !important; 
  }

  nav a { font-size: 18px; font-weight: 500; text-align: left; width: 100%; padding: 10px 20px; border-radius: 8px; }
  nav a:hover, nav a.active { background: rgba(255,255,255,0.1); }
  nav a::after { display: none; } /* Hide underline for mobile menu */

  .hero-slider {
    height: 550px;
  }

  .slide-content h1 {
    font-size: 36px;
  }

  .slide-content p {
    font-size: 16px;
  }

  .impact-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .cta-content h2 {
    font-size: 32px;
  }

  .amount-selector {
    grid-template-columns: 1fr;
  }

  .hero-btns {
    flex-direction: column;
    align-items: center;
  }

  .btn, .btn-secondary {
    width: 100%;
    max-width: 300px;
  }
}

@media(max-width: 640px) {
  .section {
    padding: 60px 5%;
  }

  .section-title {
    font-size: 32px;
  }

  .stat-item h2 {
    font-size: 40px;
  }

  .impact-stats {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .info-grid, .program-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Gallery Specific CSS ===== */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 12px 28px;
  border: 2px solid #E2E8F0;
  background: white;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
  font-family: 'Poppins';
}
.filter-btn:hover, .filter-btn.active {
  background: var(--gradient-primary);
  color: white;
  border-color: var(--primary);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}
.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: 0.4s;
  height: 300px;
}
.gallery-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(43, 108, 176, 0.2);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s;
}
.gallery-item:hover img {
  transform: scale(1.1);
}
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(43, 108, 176, 0.9) 100%);
  display: flex;
  align-items: flex-end;
  padding: 25px;
  opacity: 0;
  transition: 0.4s;
}
.gallery-item:hover .gallery-overlay {
  opacity: 1;
}
.gallery-overlay h4 {
  color: white;
  font-size: 18px;
  margin-bottom: 5px;
}
.gallery-overlay p {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
}
/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  align-items: center;
  justify-content: center;
}
.lightbox.active {
  display: flex;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}
.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  transition: 0.3s;
}
.lightbox-close:hover {
  transform: rotate(90deg);
  color: #F6AD55;
}

/* ===== ADMIN PANEL SPECIFIC STYLES ===== */
.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    background: var(--bg-soft);
}

.admin-header {
    background: var(--primary);
    color: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1001;
}

.admin-header .logo {
    gap: 12px;
    margin-bottom: 40px;
}

.admin-header .logo strong {
    font-size: 22px;
}

.admin-header .logo small {
    font-size: 12px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent) !important;
    color: var(--primary-light) !important;
}

.admin-main-content {
    padding: 0;
    overflow-y: auto;
    height: 100vh;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
}

.admin-body-content {
    padding: 30px 50px;
    flex-grow: 1;
}

.admin-topbar {
    background: white;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topbar-left h3 {
    font-size: 18px;
    color: var(--primary);
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: var(--text-gray);
}

.admin-footer {
    background: white;
    padding: 20px 40px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    color: var(--text-gray);
    font-size: 14px;
}

.admin-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    border: 1px solid #e2e8f0; /* Subtle border */
}

.admin-card h2, .admin-card h3 {
    color: var(--primary);
    margin-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 10px;
}

.admin-card .form-grid {
    margin-bottom: 20px;
}

.admin-card .btn {
    margin-top: 20px;
}

.admin-table-wrapper {
    overflow-x: auto; /* For responsive tables */
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden; /* For rounded corners */
    box-shadow: var(--shadow-sm);
}

.admin-table th, .admin-table td {
    border: 1px solid #e2e8f0;
    padding: 15px;
    text-align: left;
    font-size: 14px;
}

.admin-table th {
    background: var(--primary-light);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-table tr:nth-child(even) {
    background: #f8fafc; /* Zebra striping */
}

.admin-table tr:hover {
    background: #f0fdf4; /* Light green hover */
}

.admin-table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.admin-table .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 5px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Form input styles for admin */
.form-input, .form-textarea, .form-select {
    border: 1px solid #cbd5e0;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
}

input[type="file"] {
    padding: 8px;
    background: #f9fafb;
    border: 2px dashed #cbd5e0;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    outline: none;
}

.error-msg {
    background: #fee2e2;
    color: #dc2626;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #fecaca;
}

.success-msg {
    background: #d1fae5;
    color: #047857;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #a7f3d0;
}

/* Responsive adjustments for admin panel */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
    }
    .admin-nav {
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        gap: 10px;
    }
    .admin-nav a {
        padding: 8px 15px;
        background: rgba(255,255,255,0.1);
        border-radius: 5px;
    }
    .admin-main-content {
        padding: 20px;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .admin-table th, .admin-table td {
        padding: 10px;
    }
}
/* Dark mode for gallery filters */
body.dark-mode .filter-btn {
  background: var(--bg-light);
  border-color: #334155;
  color: var(--text-dark);
}

body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
  background: linear-gradient(135deg, #2B6CB0 0%, #2C5282 100%); /* Keep original gradient for active/hover */
  background: var(--gradient-primary);
  color: white;
  border-color: #2B6CB0;
  border-color: var(--primary);
}

/* ===== DARK MODE OVERRIDES ===== */
body.dark-mode {
  --bg-white: #0f172a;
  --bg-light: #1e293b;
  --bg-soft: #0f172a;
  --text-dark: #f8fafc;
  --text-gray: #94a3b8;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

body.dark-mode .card,
body.dark-mode .stat-item,
body.dark-mode .form-container,
body.dark-mode .modal-content,
body.dark-mode .filter-btn,
body.dark-mode .amount-btn,
body.dark-mode .testimonial-nav button,
body.dark-mode .timeline-content,
body.dark-mode .timeline-item > div {
  background-color: var(--bg-light) !important;
  color: var(--text-dark) !important;
  border-color: #334155 !important;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode .form-input,
body.dark-mode .form-select,
body.dark-mode .form-textarea {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #fff !important;
}

body.dark-mode .bg-light {
  background-color: var(--bg-soft) !important;
}

body.dark-mode .info-item p,
body.dark-mode .card p,
body.dark-mode .testimonial p,
body.dark-mode .section-header p,
body.dark-mode .timeline-item p {
  color: var(--text-gray) !important;
}