/* ==========================================================================
   NON-PROFIT TEMPLATE STYLES
   Colors are driven by CSS variables set via config.js
   ========================================================================== */

/* --- CSS VARIABLES (set dynamically by main.js from config.js) --- */
:root {
  --primary: #2E7D32;
  --secondary: #FF8F00;
  --primary-dark: color-mix(in srgb, var(--primary) 80%, black);
  --primary-light: color-mix(in srgb, var(--primary) 20%, white);
  --secondary-dark: color-mix(in srgb, var(--secondary) 80%, black);
  --secondary-light: color-mix(in srgb, var(--secondary) 20%, white);
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

/* --- ACCESSIBILITY: Skip to content --- */
.skip-link {
  position: absolute; top: -100%; left: 50%;
  transform: translateX(-50%);
  background: var(--primary); color: #fff;
  padding: 12px 24px; border-radius: 0 0 8px 8px;
  font-weight: 600; font-size: 1rem;
  z-index: 10000; transition: top 0.2s;
  text-decoration: none;
}
.skip-link:focus {
  top: 0; outline: 3px solid var(--secondary);
  outline-offset: 2px;
}

/* --- ACCESSIBILITY: Focus styles --- */
*:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
}
/* Remove default outline when not using keyboard */
*:focus:not(:focus-visible) { outline: none; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- BUTTONS --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 50px;
  font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s ease;
  border: 2px solid transparent; text-decoration: none;
}
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark); border-color: var(--primary-dark); color: #fff;
  transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.btn-outline {
  background: transparent; color: #fff; border-color: #fff;
}
.btn-outline:hover {
  background: #fff; color: var(--primary);
  transform: translateY(-2px);
}

/* --- NAVBAR --- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  box-shadow: 0 1px 10px rgba(0,0,0,0.08);
  transition: background 0.3s;
}
.nav-container {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.nav-logo img { height: 44px; width: auto; }
.text-logo {
  font-size: 1.5rem; font-weight: 800; color: var(--primary);
  letter-spacing: -0.5px;
}
.nav-menu {
  display: flex; align-items: center; gap: 8px; list-style: none;
}
.nav-link {
  padding: 8px 16px; font-weight: 500; color: #555;
  border-radius: 8px; transition: all 0.2s;
}
.nav-link:hover { color: var(--primary); background: var(--primary-light); }
.nav-donate {
  background: var(--primary); color: #fff !important;
  border-radius: 50px; padding: 8px 24px;
}
.nav-donate:hover {
  background: var(--primary-dark); color: #fff !important;
}

/* Mobile toggle */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2.5px; background: #333; border-radius: 2px;
  transition: all 0.3s;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 90vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  background-size: cover; background-position: center;
  color: #fff; text-align: center;
  padding: 120px 24px 80px;
}
.hero-content { position: relative; z-index: 2; max-width: 800px; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.15; margin-bottom: 20px;
}
.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  opacity: 0.92; margin-bottom: 36px; line-height: 1.6;
}
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-wave {
  position: absolute; bottom: -1px; left: 0; right: 0;
  line-height: 0;
}
.hero-wave svg { width: 100%; height: auto; }

/* --- SECTIONS --- */
.section { padding: 100px 0; }
.section:nth-child(even) { background: #f8f9fa; }
.section-heading {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800; text-align: center; margin-bottom: 12px;
  color: #222;
}
.section-sub {
  text-align: center; color: #666; font-size: 1.1rem;
  max-width: 600px; margin: 0 auto 48px;
}

/* --- ABOUT --- */
.about-text {
  max-width: 800px; margin: 0 auto 48px;
  text-align: center; color: #555; font-size: 1.05rem;
}
.about-text p { margin-bottom: 16px; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px; margin-bottom: 48px;
}
.stat-card {
  text-align: center; padding: 32px 16px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  transition: transform 0.3s;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-number {
  display: block; font-size: 2.4rem; font-weight: 800;
  color: var(--primary); margin-bottom: 4px;
}
.stat-label { font-size: 0.95rem; color: #777; font-weight: 500; }

.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.info-card {
  background: #fff; padding: 40px 32px; border-radius: 16px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  text-align: center; transition: transform 0.3s;
}
.info-card:hover { transform: translateY(-4px); }
.info-card-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; font-size: 1.5rem; color: var(--primary);
}
.info-card h3 { font-size: 1.2rem; margin-bottom: 12px; color: #222; }
.info-card p { color: #666; font-size: 0.95rem; line-height: 1.6; }

/* --- GALLERY --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.gallery-item {
  border-radius: 12px; overflow: hidden;
  aspect-ratio: 4/3; cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-empty { text-align: center; color: #999; padding: 40px 0; }
.gallery-empty code {
  background: #eee; padding: 2px 8px; border-radius: 4px; font-size: 0.9rem;
}

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92);
  align-items: center; justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox-img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute; background: none; border: none;
  color: #fff; font-size: 2rem; cursor: pointer;
  padding: 16px; opacity: 0.8; transition: opacity 0.2s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }
.lightbox-close { top: 16px; right: 24px; font-size: 2.5rem; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* --- FORMS (Volunteer & Contact) --- */
.volunteer-section { background: #fff; }

.form { max-width: 700px; margin: 0 auto; }
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px; margin-bottom: 24px;
}
.form-full { grid-column: 1 / -1; }
.form-group label {
  display: block; font-weight: 600; margin-bottom: 6px;
  font-size: 0.9rem; color: #444;
}
.required { color: #e53935; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 12px 16px;
  border: 2px solid #e0e0e0; border-radius: 10px;
  font-size: 1rem; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-submit { width: 100%; justify-content: center; font-size: 1.05rem; }

/* CAPTCHA */
.captcha-group { margin-bottom: 20px; }
.captcha-label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; margin-bottom: 8px;
  font-size: 0.9rem; color: #444;
}
.captcha-label i { color: var(--primary); }
.captcha-challenge {
  display: flex; align-items: center; gap: 12px;
  background: var(--primary-light); padding: 14px 18px;
  border-radius: 10px; border: 2px solid #e0e0e0;
}
.captcha-question {
  font-size: 1.05rem; font-weight: 700; color: #333;
  white-space: nowrap;
}
.captcha-input {
  width: 80px !important; padding: 10px 14px !important;
  text-align: center; font-size: 1.1rem !important;
  font-weight: 700; border-radius: 8px !important;
  border: 2px solid #ccc !important; background: #fff !important;
}
.captcha-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-light) !important;
}
.captcha-error {
  display: none; color: #e53935; font-size: 0.85rem;
  margin-top: 6px; font-weight: 500;
}

/* --- CONTACT --- */
.contact-layout {
  display: grid; grid-template-columns: 1fr 1.2fr;
  gap: 48px; align-items: start;
}
.contact-info { padding: 32px 0; }
.contact-item {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 24px;
}
.contact-item i {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1rem;
}
.contact-item strong { display: block; font-size: 0.85rem; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }
.contact-item a, .contact-item span { color: #333; font-size: 1rem; }
.contact-social { margin-top: 32px; }
.contact-social strong { display: block; margin-bottom: 12px; color: #555; }

.contact-form { max-width: none; }
.contact-form .form-group { margin-bottom: 20px; }

/* Social links */
.social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.social-links a {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: all 0.3s;
}
.social-links a:hover {
  background: var(--primary); color: #fff;
  transform: translateY(-3px);
}

/* --- FOOTER --- */
.footer {
  background: #1a1a2e; color: #ccc;
  padding: 64px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 48px;
}
.footer-brand p { margin-top: 12px; color: #999; font-size: 0.95rem; }
.footer-logo { height: 40px; width: auto; filter: brightness(0) invert(1); }
.footer-text-logo { color: #fff; }
.footer h4 { color: #fff; margin-bottom: 16px; font-size: 1rem; }
.footer-links ul { list-style: none; }
.footer-links a { color: #999; display: block; padding: 4px 0; font-size: 0.95rem; }
.footer-links a:hover { color: var(--secondary); }
.footer-contact p {
  font-size: 0.9rem; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.footer-contact a { color: #999; }
.footer-contact a:hover { color: var(--secondary); }
.footer-contact i { color: var(--secondary); width: 16px; }
.footer-social .social-links a {
  background: rgba(255,255,255,0.1); color: #ccc;
}
.footer-social .social-links a:hover {
  background: var(--secondary); color: #fff;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 24px 0; text-align: center; font-size: 0.85rem; color: #777;
}
.footer-bottom p { margin-bottom: 4px; }
.tax-id { font-weight: 600; color: #999; }

/* --- FLOATING DONATE --- */
.floating-donate {
  position: fixed; bottom: 28px; right: 28px; z-index: 997;
  transition: bottom 0.3s ease;
  background: var(--secondary); color: #fff;
  padding: 14px 28px; border-radius: 50px;
  font-weight: 700; font-size: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: all 0.3s; display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.floating-donate:hover {
  background: var(--secondary-dark); color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}
.floating-donate i { animation: pulse-heart 1.5s ease-in-out infinite; }
@keyframes pulse-heart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* --- ANIMATIONS --- */
.fade-in {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
  .contact-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none; flex-direction: column;
    position: absolute; top: 72px; left: 0; right: 0;
    background: #fff; padding: 16px 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  .nav-menu.active { display: flex; }
  .nav-link { padding: 12px 16px; width: 100%; }
  .nav-donate { text-align: center; }

  .hero { min-height: 80vh; padding: 100px 24px 60px; }
  .section { padding: 64px 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }

  .floating-donate { bottom: 16px; right: 16px; padding: 12px 20px; font-size: 0.9rem; }
}

@media (max-width: 480px) {
  .hero-buttons { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 20px 12px; }
  .stat-number { font-size: 1.8rem; }
}

/* --- PWA INSTALL BANNER --- */
.install-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 998;
  background: #fff; border-top: 2px solid var(--primary);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  padding: 16px 24px;
  animation: slideUp 0.4s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.install-banner-content {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.install-banner-text {
  display: flex; align-items: center; gap: 16px;
}
.install-banner-text > i {
  font-size: 1.8rem; color: var(--primary);
  flex-shrink: 0;
}
.install-banner-text strong {
  display: block; font-size: 1rem; color: #222;
}
.install-banner-text span {
  display: block; font-size: 0.85rem; color: #666;
}
.install-banner-actions {
  display: flex; align-items: center; gap: 12px;
}
.install-btn {
  padding: 10px 28px; font-size: 0.95rem;
  white-space: nowrap;
}
.install-dismiss {
  background: none; border: none; font-size: 1.5rem;
  color: #999; cursor: pointer; padding: 4px 8px;
  transition: color 0.2s;
}
.install-dismiss:hover { color: #333; }

/* --- PWA INSTALL MODAL --- */
.install-modal {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 24px;
}
.install-modal-content {
  background: #fff; border-radius: 16px; padding: 36px 32px;
  max-width: 440px; width: 100%; position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.install-modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 1.8rem;
  color: #999; cursor: pointer; padding: 4px;
}
.install-modal-close:hover { color: #333; }
.install-modal-content h3 {
  font-size: 1.4rem; color: var(--primary); margin-bottom: 24px;
  padding-right: 32px;
}
.install-step {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 18px; font-size: 0.95rem; line-height: 1.5;
  color: #444;
}
.install-step i { color: var(--primary); }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}

@media (max-width: 480px) {
  .install-banner-content { flex-direction: column; text-align: center; }
  .install-banner-text { flex-direction: column; gap: 8px; }
  .install-banner-actions { width: 100%; justify-content: center; }
  .install-btn { width: 100%; }
}

/* --- ACCESSIBILITY: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; }
}

/* --- ACCESSIBILITY: High Contrast --- */
@media (prefers-contrast: more) {
  .btn { border-width: 3px; }
  .nav-link { border: 2px solid transparent; }
  .nav-link:focus-visible { border-color: var(--primary); }
  .form-group input, .form-group select, .form-group textarea {
    border-width: 3px;
  }
  .stat-card, .info-card { border: 2px solid #333; }
}

/* --- ACCESSIBILITY: Form status --- */
.form-status {
  text-align: center; padding: 8px 0; font-size: 0.9rem;
  color: #666; min-height: 1.5em;
}
