/* =========================================
   Base & Reset
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary-color: #2e5c31;      
  --primary-hover: #1e3d20;      
  --secondary-color: #ff6600;    
  --secondary-hover: #cc5200;
  --text-main: #222222;
  --text-muted: #555555;
  --bg-main: #ffffff;
  --bg-light: #f4f1ea;           
  --bg-accent: #2e5c31;          
  --font-main: "Helvetica Neue", Arial, sans-serif;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;
}
body { font-family: var(--font-main); color: var(--text-main); background-color: var(--bg-main); line-height: 1.6; font-size: 16px; overflow-x: hidden; }
a { text-decoration: none; color: var(--primary-color); transition: color 0.2s ease; }
a:hover { color: var(--secondary-color); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-md); }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; margin-bottom: var(--spacing-md); color: #111; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
p { margin-bottom: var(--spacing-md); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-white { color: #ffffff !important; }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-4 { margin-top: var(--spacing-lg); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.pt-0 { padding-top: 0 !important; }
.w-100 { width: 100%; }
.bg-light { background-color: var(--bg-light); }
.bg-accent { background-color: var(--bg-accent); }
.section-padding { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }
.align-start { align-items: start !important; }
.overflow-hidden { overflow: hidden; }

/* Buttons */
button, .btn-primary, .btn-donate { display: inline-block; padding: 0.75rem 1.5rem; font-weight: bold; text-align: center; border: none; cursor: pointer; transition: background-color 0.2s ease; font-size: 1rem; font-family: var(--font-main); }
.btn-primary { background-color: var(--primary-color); color: #ffffff; }
.btn-primary:hover { background-color: var(--primary-hover); color: #ffffff; }
.btn-donate { background-color: var(--secondary-color); color: #ffffff; padding: 0.5rem 1rem; }
.btn-donate:hover { background-color: var(--secondary-hover); color: #ffffff; }
.large-btn { padding: 1rem 2rem; font-size: 1.125rem; }

/* Navigation */
.navbar { background-color: var(--bg-main); border-bottom: 1px solid #ddd; position: sticky; top: 0; z-index: 1000; padding: var(--spacing-md) 0; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo a { font-size: 1.5rem; font-weight: bold; color: var(--primary-color); }
.nav-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--text-main); font-weight: bold; font-size: 0.9rem; text-transform: uppercase; }
.nav-links a:hover { color: var(--secondary-color); }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 5px; }
.mobile-menu-btn span { display: block; width: 25px; height: 3px; background-color: var(--text-main); }

/* Grids & Layouts */
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-xl); align-items: center; }
.grid-3-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-lg); }

.text-img-wrap { display: flex; gap: var(--spacing-lg); align-items: flex-start; justify-content: space-between; }
.text-img-wrap .text-content { flex: 1; }
.text-img-wrap .img-content { flex-shrink: 0; }

.cursive-bold { font-family: 'Georgia', 'Times New Roman', cursive, serif; font-weight: bold; font-style: italic; font-size: 1.8rem; }
.land-owners-list { margin-left: var(--spacing-lg); margin-bottom: var(--spacing-md); }
.land-owners-list li { margin-bottom: var(--spacing-sm); }

/* Animations & Transitions */
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* Horizontal Slideshows */
.slideshow-wrapper, .akwaaba-slideshow-wrapper { overflow: hidden; white-space: nowrap; width: 100%; padding: var(--spacing-md) 0; }
.slideshow-track { display: inline-flex; gap: var(--spacing-md); animation: scrollTrack 45s linear infinite; }
.akwaaba-track { display: inline-flex; gap: var(--spacing-md); animation: scrollTrack 80s linear infinite; }
.slideshow-track:hover, .akwaaba-track:hover { animation-play-state: paused; }
@keyframes scrollTrack { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.slide { width: 300px; flex-shrink: 0; white-space: normal; background: var(--bg-main); border: 1px solid #ddd; padding: 10px; }
.slide-image-placeholder { background-color: #e0e0e0; height: 200px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-weight: bold; }
.slide-text { padding-top: 10px; font-weight: bold; text-align: center; }

/* Fading Hero Slideshow (Tours) */
.tour-hero { position: relative; width: 100%; height: 60vh; min-height: 400px; background-color: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tour-hero .fade-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.5s ease-in-out; }
.tour-hero .fade-slide.active { opacity: 1; }
.tour-hero-content { position: relative; z-index: 10; text-align: center; background: rgba(0, 0, 0, 0.5); padding: var(--spacing-lg) var(--spacing-xl); }
.tour-hero-content h1 { color: #fff; font-size: 4rem; margin: 0; letter-spacing: 4px; text-transform: uppercase; }

/* Placeholders */
.image-placeholder { background-color: #e0e0e0; border: 1px solid #ccc; display: flex; align-items: center; justify-content: center; min-height: 250px; padding: var(--spacing-md); color: var(--text-muted); text-align: center; font-weight: bold; width: 100%; }
.tall-placeholder { min-height: 400px; }
.horizontal-placeholder { min-height: 150px; }
.large-horizontal-placeholder { min-height: 350px; }
.hero-fullscreen { height: calc(100vh - 80px); min-height: 600px; margin-bottom: var(--spacing-xl); border: none; background-color: #dcdcdc; }
.caption { margin-top: 10px; font-size: 0.9rem; font-style: italic; text-align: center; }

/* Forms */
.contact-box, .work-together-form { background-color: #ffffff; padding: var(--spacing-lg); border: 1px solid #ddd; margin: 0 auto;}
.work-together-form { max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: var(--spacing-md); }
input[type="text"], input[type="email"], input[type="tel"], textarea { width: 100%; padding: 0.75rem; border: 1px solid #ccc; font-family: inherit; font-size: 1rem; }
input:focus, textarea:focus { outline: none; border-color: var(--primary-color); }

/* PayPal Donation Interface */
.payment-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 1.5rem 2.5rem; max-width: 520px; margin: 2rem auto; box-shadow: 0 4px 16px rgba(0,0,0,0.05); position: relative; overflow: hidden; }
.amount-input-wrapper { display: flex; justify-content: center; align-items: center; margin-bottom: 0px; cursor: text; width: 100%; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
input.amount-input { width: 100%; border: none !important; box-shadow: none !important; font-weight: 300; text-align: center; outline: none !important; color: #001c3d; caret-color: #001c3d; padding: 0; background: transparent; line-height: 1; transition: font-size 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); font-size: 3.8rem !important; font-family: inherit; }

/* Focus font-size transition */
.amount-input-wrapper:focus-within input.amount-input { font-size: 4.4rem !important; }

.checkbox-wrapper { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.95rem; color: #111; }
.hidden { display: none !important; }

/* Pop-up Overlay */
.popup-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(8px); z-index: 100; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: all 0.3s ease; text-align: center; padding: 2rem; border-radius: 8px; }
.popup-overlay.active { opacity: 1; pointer-events: auto; }
.close-popup { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 2rem; cursor: pointer; color: #999; transition: color 0.2s; line-height: 1; }
.close-popup:hover { color: #111; }

/* Payment Buttons */
.btn-paypal:disabled, .btn-venmo:disabled, .btn-card:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(100%); }
.btn-paypal:disabled:hover, .btn-venmo:disabled:hover, .btn-card:disabled:hover { transform: none; box-shadow: none; opacity: 0.4; }
.checkbox-wrapper input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

/* Payment Buttons */
.btn-paypal, .btn-venmo, .btn-card { 
  width: 100%; padding: 14px; border-radius: 24px; font-size: 1.1rem; 
  font-weight: bold; border: none; cursor: pointer; display: flex; 
  align-items: center; justify-content: center; gap: 8px; 
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
  font-family: var(--font-main); position: relative; overflow: hidden;
}

.btn-paypal { background-color: #ffc439; color: #000; }
.btn-paypal:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 6px 15px rgba(255, 196, 57, 0.4); 
  background-color: #ffcc4d; 
}
.btn-paypal:active { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(255, 196, 57, 0.4); }

.btn-venmo { background-color: #008cff; color: #fff; font-style: italic; }
.btn-venmo:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 6px 15px rgba(0, 140, 255, 0.4); 
  background-color: #1a9cff; 
}
.btn-venmo:active { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0, 140, 255, 0.4); }

.btn-card { background-color: #fff; color: #003087; border: 1.5px solid #003087; z-index: 1; }
.btn-card::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background-color: #003087; transition: all 0.4s ease-in-out; z-index: -1;
}
.btn-card:hover {
  color: #fff; border-color: #003087; box-shadow: 0 6px 15px rgba(0, 48, 135, 0.3);
}
.btn-card:hover::before { left: 0; }
.btn-card:active { transform: scale(0.98); }

/* PayPal Footer */
.paypal-footer { max-width: 800px; margin: 0 auto 3rem; font-size: 0.85rem; color: #555; }
.paypal-footer a { color: #555; font-weight: bold; text-decoration: none; margin: 0 10px; }
.paypal-footer a:hover { text-decoration: underline; color: #111; }
.paypal-footer-links { display: flex; flex-wrap: wrap; justify-content: center; margin-bottom: 1rem; }
.paypal-footer-legal { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.paypal-footer-legal span { margin-right: 10px; }

.quote-text { font-size: 1.2rem; font-weight: bold; font-style: italic; max-width: 800px; margin: var(--spacing-lg) auto 0; }
.banner-text { font-weight: bold; text-align: center; letter-spacing: 2px; font-size: 1.1rem; }

/* Main Footer */
.site-footer { background-color: #222; color: #fff; padding: var(--spacing-xl) 0 var(--spacing-md); }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-lg); margin-bottom: var(--spacing-lg); }
.footer-col h3 { color: #fff; border-bottom: 2px solid var(--primary-color); padding-bottom: 10px; margin-bottom: 15px; }
.footer-links-list { list-style: none; }
.footer-links-list li { margin-bottom: 10px; }
.footer-links-list a { color: #ccc; }
.footer-links-list a:hover { color: var(--secondary-color); }
.footer-bottom { text-align: center; border-top: 1px solid #444; padding-top: var(--spacing-md); color: #aaa; }

/* Responsive */
@media (max-width: 992px) { 
  .grid-3-col, .footer-grid { grid-template-columns: 1fr 1fr; } 
  .text-img-wrap { flex-direction: column; }
  .text-img-wrap .img-content { max-width: 100% !important; width: 100%; margin-top: var(--spacing-md); }
}
@media (max-width: 768px) {
  .grid-2-col, .grid-3-col, .footer-grid { grid-template-columns: 1fr; gap: var(--spacing-lg); }
  .nav-links { display: none; flex-direction: column; width: 100%; position: absolute; top: 100%; left: 0; background-color: var(--bg-main); border-bottom: 1px solid #ddd; padding: var(--spacing-md) 0; align-items: flex-start; padding-left: var(--spacing-md); }
  .nav-links.active { display: flex; }
  .mobile-menu-btn { display: flex; }
  .tour-hero-content h1 { font-size: 2.5rem; }
  .payment-card { padding: 2rem 1.5rem; margin: 2rem 1rem; }
}

/* Impact Section */
.impact-hero { text-align: center; padding: 4rem 2rem 2rem; }
.impact-hero h1 { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.impact-hero h3 { font-size: 1.5rem; font-weight: 300; margin-bottom: 1rem; color: #555; }
.impact-hero p { max-width: 800px; margin: 0 auto; font-size: 1.1rem; line-height: 1.6; color: #333; }

.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; padding: 2rem; max-width: 1100px; margin: 0 auto 4rem; }
.impact-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); text-decoration: none; color: inherit; transition: transform 0.3s ease, box-shadow 0.3s ease; display: block; }
.impact-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.impact-card-img-wrapper { overflow: hidden; }
.impact-card-img { width: 100%; height: 220px; background-color: #ddd; background-size: cover; background-position: center; transition: transform 0.5s ease; }
.impact-card:hover .impact-card-img { transform: scale(1.05); }
.impact-card-content { padding: 1.5rem; text-align: center; }
.impact-card-content h2 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--primary-color); }
.impact-card-content p { color: #666; font-size: 0.95rem; }

/* Tabs & Posts */
.tabs-container { max-width: 1000px; margin: 2rem auto 4rem; padding: 0 1rem; }
.tabs-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 2rem; border-bottom: 2px solid #eee; padding-bottom: 1rem; }
.tab-btn { background: none; border: none; padding: 0.5rem 1rem; font-size: 1.1rem; cursor: pointer; color: #555; transition: all 0.3s ease; position: relative; font-weight: 500; outline: none; }
.tab-btn:hover { color: var(--primary-color); }
.tab-btn.active { color: var(--primary-color); }
.tab-btn.active::after { content: ''; position: absolute; bottom: -18px; left: 0; width: 100%; height: 3px; background: var(--secondary-color); }
.tab-pane { display: none; animation: fadeIn 0.4s ease; }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.post-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 2rem; }
.post-img { width: 100%; height: 400px; background-color: #eaeaea; background-size: cover; background-position: center; }
.post-content { padding: 2rem; }
.post-content h3 { font-size: 1.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.post-content p { line-height: 1.6; color: #444; font-size: 1.05rem; }
.coming-soon { text-align: center; padding: 4rem 2rem; color: #666; font-size: 1.2rem; font-style: italic; background: #f9f9f9; border-radius: 8px; border: 1px dashed #ccc; }

/* Global Rounded Corners */
button, .btn-primary, .btn-donate, .large-btn {
    border-radius: 8px !important;
}
img, .image-placeholder, .slide, .post-img, .impact-card-img, .impact-card, .post-card, .picture-box, .hero-image-box, div[style*="background-image"] {
    border-radius: 8px;
}
/* Specifically exclude the full screen tour hero from looking broken if it has corners */
.tour-hero .fade-slide {
    border-radius: 0 !important;
}

/* Active Navbar Link Indicator */
.nav-links a.active-nav-link {
    color: var(--secondary-color) !important;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 2px;
}

/* --- Comprehensive Mobile Enhancements --- */
@media (max-width: 768px) {
    /* Global Typography & Spacing */
    body { font-size: 15px; }
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.75rem !important; }
    .section-padding { padding-top: 3rem; padding-bottom: 3rem; }
    
    /* Navbar Tweaks */
    .nav-links a { width: 100%; display: block; padding: 10px 0; border-bottom: none !important; }
    .nav-links a.active-nav-link { color: var(--secondary-color) !important; font-weight: 900; background: rgba(255,102,0,0.05); padding-left: 10px; border-left: 4px solid var(--secondary-color); }
    
    /* Donate Form Scaling */
    .payment-card { padding: 1.5rem 1rem !important; margin: 1rem !important; }
    input.amount-input { font-size: 2.8rem !important; }
    .amount-input-wrapper:focus-within input.amount-input { font-size: 3.2rem !important; }
    
    /* Ghana Tabs Scaling */
    .tab-btn { padding: 0.5rem 0.8rem; font-size: 0.9rem; margin-bottom: 15px; }
    
    /* Forum Card (override inline padding) */
    main[style*="align-items: center"] > div { padding: 2rem 1.5rem !important; max-width: 95% !important; }
    
    /* Contributors Page Overrides */
    div[style*="minmax(300px"] { grid-template-columns: 1fr !important; padding: 1.5rem !important; gap: 2rem !important; }
    div[style*="height: 400px"] { height: 250px !important; } /* Shrink hero image */
    
    /* Form Inputs */
    input[type="text"], input[type="email"], input[type="tel"], textarea { font-size: 16px; /* prevents iOS zoom */ }
    
    /* Slideshow Adjustments */
    .tour-hero { min-height: 300px; height: 40vh; }
}

@media (max-width: 480px) {
    /* Extreme Mobile Scaling */
    input.amount-input { font-size: 2.2rem !important; }
    .amount-input-wrapper:focus-within input.amount-input { font-size: 2.5rem !important; }
    .tour-hero-content h1 { font-size: 2rem; }
}

/* Global text link styling */
main p a, main .slide-text a, main li a:not(.nav-links a) {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}
main p a:hover, main .slide-text a:hover, main li a:not(.nav-links a):hover {
    color: var(--secondary-color);
}




/* Location Links (Green Banner) */
a.location-link {
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    text-decoration: none;
    letter-spacing: 1px;
    display: inline-block;
    position: relative;
    /* User wants the hover to be INSTANT, so no transitions here on the base element! */
}

/* The animated underline (this still animates nicely underneath) */
a.location-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -4px;
    left: 0;
    background-color: var(--secondary-color);
    transition: width 0.2s ease;
}

/* Instant Hover effects */
a.location-link:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

/* Hover underline trigger */
a.location-link:hover::after {
    width: 100%;
}

/* Custom Animation Overrides for Entrance (these apply to the wrapper span) */
.anim-left { transform: translateX(-40px); }
.anim-right { transform: translateX(40px); }
.anim-zoom { transform: scale(0.5); }

/* The resting state after scroll entrance */
.animate-on-scroll.anim-left.visible, 
.animate-on-scroll.anim-right.visible, 
.animate-on-scroll.anim-zoom.visible {
    transform: none;
}


/* Location Navigation Arrows */
.nav-arrow:hover {
    color: var(--secondary-color) !important;
    transform: scale(1.3);
}

/* =========================================
   Dark Mode Overrides
   ========================================= */
html.dark-mode {
  --text-main: #f0f0f0;
  --text-muted: #bbbbbb;
  --bg-main: #121212;
  --bg-light: #1e1e1e;
}
html.dark-mode h1, html.dark-mode h2, html.dark-mode h3, html.dark-mode h4 { color: #f0f0f0; }
html.dark-mode .impact-box, html.dark-mode .bg-light { background-color: var(--bg-light); border-color: #333; }
html.dark-mode .image-placeholder { background-color: #222 !important; border-color: #444 !important; }
html.dark-mode .navbar { background-color: #1a1a1a; box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
html.dark-mode .nav-links a { color: #f0f0f0; }
html.dark-mode .mobile-menu-btn span { background-color: #f0f0f0; }

.dark-mode-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: 1rem;
  color: var(--text-main);
  transition: transform 0.3s ease;
}
.dark-mode-toggle:hover {
  transform: scale(1.1);
}

/* Enhanced Dark Mode Text Overrides */
html.dark-mode p,
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode li {
  color: #e0e0e0 !important;
}
html.dark-mode div[style*="color: #000"],
html.dark-mode div[style*="color: #111"],
html.dark-mode div[style*="color: #333"],
html.dark-mode div[style*="color: #444"],
html.dark-mode ul[style*="color: #444"] {
  color: #e0e0e0 !important;
}

/* =========================================
   Ultimate Dark Mode Overrides
   ========================================= */

/* Strip white backgrounds from specific UI elements */
html.dark-mode .bg-light,
html.dark-mode .work-together-form,
html.dark-mode .payment-card,
html.dark-mode .impact-card,
html.dark-mode .impact-card-content,
html.dark-mode .impact-box,
html.dark-mode .contact-box,
html.dark-mode .popup-overlay {
  background-color: #1a1a1a !important;
  background: #1a1a1a !important;
  border-color: #333 !important;
}

/* Force body background */
html.dark-mode {
  background-color: #121212 !important;
}

/* Force Inputs to Dark Mode */
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode select {
  background-color: #222 !important;
  color: #fff !important;
  border-color: #555 !important;
}
/* Special PayPal amount input */
html.dark-mode input.amount-input {
  background-color: transparent !important;
  color: #fff !important;
  border: none !important;
}
html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
  color: #888 !important;
}

/* Force Text to White/Light Grey */
html.dark-mode p,
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode li,
html.dark-mode label,
html.dark-mode .story-title,
html.dark-mode .text-center,
html.dark-mode [style*="color: #000"],
html.dark-mode [style*="color: #111"],
html.dark-mode [style*="color: #333"],
html.dark-mode [style*="color: #444"],
html.dark-mode [style*="color: #555"],
html.dark-mode [style*="color: #666"] {
  color: #f0f0f0 !important;
}

/* Hyperlinks exclusively Green */
html.dark-mode a {
  color: var(--primary-color) !important;
}
html.dark-mode a:hover {
  color: var(--secondary-color) !important;
}
html.dark-mode .nav-links a {
  color: #fff !important; /* Nav links stay white */
}
html.dark-mode .nav-links a:hover {
  color: var(--secondary-color) !important;
}

/* Buttons explicitly */
html.dark-mode button, 
html.dark-mode .btn-primary, 
html.dark-mode .btn-donate, 
html.dark-mode .btn-card {
  color: #fff !important;
}

/* =========================================
   Surgical Fixes for Dark Mode
   ========================================= */

/* Fix 1: 12 Locations on Homepage disappearing (Green text on Green background) */
html.dark-mode .location-link {
  color: #fff !important;
}
html.dark-mode .location-link:hover {
  color: var(--secondary-color) !important;
}

/* Fix 2: Prevent buttons from turning orange on hover */
html.dark-mode a.btn-primary:hover,
html.dark-mode a.btn-donate:hover,
html.dark-mode a.btn-card:hover,
html.dark-mode a.large-btn:hover {
  color: #fff !important;
}

/* Fix 3: Ensure story titles in Impact pages are Green */
html.dark-mode .story-title,
html.dark-mode div[style*="font-weight: bold"][style*="font-size: 1.2rem"] {
  color: var(--primary-color) !important;
}

/* Ensure the go back button remains green */
html.dark-mode .go-back-btn {
  color: var(--primary-color) !important;
}
html.dark-mode .go-back-btn:hover {
  color: #fff !important;
}

/* Fix 4: Restore explicitly green headings that were turned white */
html.dark-mode h1[style*="var(--primary-color)"],
html.dark-mode h2[style*="var(--primary-color)"],
html.dark-mode h3[style*="var(--primary-color)"],
html.dark-mode h4[style*="var(--primary-color)"],
html.dark-mode p[style*="var(--primary-color)"],
html.dark-mode div[style*="var(--primary-color)"] {
  color: var(--primary-color) !important;
}

/* Fix 5: Popup messages and Forum box backgrounds in dark mode */
html.dark-mode .success-popup-content,
html.dark-mode .forum-box {
  background-color: #1a1a1a !important;
  background: #1a1a1a !important;
}
html.dark-mode .success-popup-content h3,
html.dark-mode .success-popup-content p {
  color: #f0f0f0 !important;
}


html.dark-mode body {
  background-color: #121212 !important;
}

/* =========================================
   Navbar Alignment Fixes
   ========================================= */

/* Prevent the logo text from breaking into two lines */
.logo {
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Keep all nav links and the moon icon perfectly on one line */
.nav-links {
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 0.8rem !important; /* Slightly tighter gap to ensure it fits on all screens */
}

/* Remove the extra margin pushing the moon icon down */
.dark-mode-toggle {
  margin-left: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =========================================
   Ultimate Mobile Cleanup
   ========================================= */
@media (max-width: 768px) {
  /* Prevent horizontal scrolling globally */
  body {
    overflow-x: hidden;
  }
  
  /* Make sure all images stay within their boxes */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Fix the new Contributors Box layout for mobile */
  .contributors-box {
    grid-template-columns: 1fr !important;
    padding: 1.5rem !important;
    gap: 1.5rem !important;
  }
  
  /* Give the impact boxes breathing room on mobile */
  .impact-box {
    padding: 1rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  /* Ensure the navbar hamburger menu doesn't overlap the logo */
  .nav-container {
    padding: 0 1rem;
  }
  
  /* Give the footer some extra spacing so it isn't clustered */
  .footer-grid {
    gap: 2.5rem !important;
  }
  .footer-col {
    text-align: center;
  }
  .footer-links-list {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  /* Ensure the contact forms squeeze properly */
  .contact-box, .work-together-form {
    padding: 1.5rem 1rem !important;
    width: 100% !important;
    box-sizing: border-box;
  }
}

/* =========================================
   Hamburger Menu X Animation
   ========================================= */
.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text-main);
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-origin: center;
}

/* When the menu is active, animate into an X */
.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Ensure the dark mode color takes precedence */
html.dark-mode .mobile-menu-btn span {
  background-color: #f0f0f0 !important;
}
html.dark-mode div[style*="background: #f8f9fa;"] {
  background: #222 !important;
  border-color: #444 !important;
}
html.dark-mode #zellePhone {
  color: #e2d1f9 !important;
}

/* =========================================
   Donation Page Entrance Animation
   ========================================= */
@keyframes paymentCardEntrance {
  0% { 
    opacity: 0; 
    transform: translateY(40px) scale(0.98); 
  }
  100% { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.payment-card {
  animation: paymentCardEntrance 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* =========================================
   Zelle Button Animations
   ========================================= */
@keyframes zelleEntrance {
  0% { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  100% { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

#zelleBtn {
  width: 100%;
  background-color: #741bdf;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  margin-bottom: 15px;
  box-shadow: 0 4px 6px rgba(116, 27, 223, 0.2);
  
  /* Transitions for hover effects */
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  
  /* The entrance animation when page loads */
  opacity: 0; 
  animation: zelleEntrance 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.5s; /* Wait half a second before popping in */
}

/* Advanced Hover Animation */
#zelleBtn:hover {
  background-color: #8930f7; 
  transform: translateY(-3px); 
  box-shadow: 0 10px 20px rgba(116, 27, 223, 0.4); 
}

/* Click Animation */
#zelleBtn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(116, 27, 223, 0.2);
}


/* =========================================
   Zelle Popup Dark Mode Fixes
   ========================================= */
html.dark-mode .popup-content {
  background-color: #1a1a1a !important;
  background: #1a1a1a !important;
  border: 1px solid #333;
}

html.dark-mode #zelleCopyBtn {
  background-color: #741bdf !important;
  color: #fff !important;
}

/* Ensure the title text doesn't vanish */
html.dark-mode .popup-content h3 {
  color: #f0f0f0 !important;
}

/* =========================================
   Go Back Button (Locations & Impact Pages)
   ========================================= */
.go-back-btn {
  display: inline-flex;
  align-items: center;
  margin-bottom: 2rem;
  color: var(--primary-color);
  font-weight: bold;
  text-decoration: none !important;
  border: 2px solid var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}
.go-back-btn:hover {
  background-color: var(--primary-color);
  color: #fff !important;
}
html.dark-mode .go-back-btn {
  color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}
html.dark-mode .go-back-btn:hover {
  background-color: var(--primary-color) !important;
  color: #fff !important;
}

/* =========================================
   Fix for btn-card in Dark Mode
   ========================================= */
html.dark-mode .btn-card {
  background-color: transparent !important;
  border: 1.5px solid #66b2ff !important;
  color: #66b2ff !important;
}
html.dark-mode .btn-card:hover {
  background-color: #66b2ff !important;
  color: #1a1a1a !important;
}
