/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Light mode variables */
  --background-color: #f4f4f4;
  --text-color: #333;
  --heading-color: #2d3748;
  --card-bg-color: #ffffff;
  --border-color: rgba(0, 0, 0, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.08);
  --primary-color: #38a169;
  --primary-color-rgb: 56, 161, 105; /* RGB values for primary color */
  --primary-color-light: rgba(56, 161, 105, 0.1);
  --primary-color-hover: #2f855a;
  --secondary-bg: #ffffff;
  --table-header-bg: #f8f9fa;
  --negative-color: #e53e3e;
  --positive-color: #38a169;
  --header-bg: rgba(255, 255, 255, 0.95);
  --footer-bg: #2d3748;
  --footer-text: #f7fafc;
  --section-alt-bg: #f9fafb;
  --africa-bg: linear-gradient(135deg, #ebf4ff 0%, #e6fffa 100%);
}

/* Dark mode variables */
[data-theme="dark"] {
  --background-color: #1a202c;
  --text-color: #e2e8f0;
  --heading-color: #f7fafc;
  --card-bg-color: #2d3748;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --primary-color: #4fd1c5;
  --primary-color-rgb: 79, 209, 197; /* RGB values for primary color in dark mode */
  --primary-color-light: rgba(79, 209, 197, 0.1);
  --primary-color-hover: #38b2ac;
  --secondary-bg: #2d3748;
  --table-header-bg: #4a5568;
  --negative-color: #fc8181;
  --positive-color: #68d391;
  --header-bg: rgba(26, 32, 44, 0.95);
  --footer-bg: #171923;
  --footer-text: #e2e8f0;
  --section-alt-bg: #2d3748;
  --africa-bg: linear-gradient(135deg, #2a4365 0%, #234e52 100%);
}

body {
  font-family: "Open Sans", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  min-height: 100vh;
  padding-top: 110px; /* Increased padding to account for larger fixed header */
  overflow-x: hidden; /* Prevent horizontal scrolling */
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Dark mode toggle styles */
.theme-toggle {
  display: flex;
  align-items: center;
  margin-right: 10px;
  position: relative;
}

.dark-mode-checkbox {
  opacity: 0;
  position: absolute;
}

.dark-mode-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 50px;
  height: 25px;
  background: #4a5568;
  border-radius: 50px;
  position: relative;
  padding: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.dark-mode-label i {
  color: #f0f0f0;
  font-size: 14px;
  transition: color 0.3s ease;
}

.toggle-ball {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  width: 19px;
  height: 19px;
  top: 3px;
  left: 3px;
  transition: transform 0.3s ease;
  z-index: 2;
}

.dark-mode-checkbox:checked + .dark-mode-label {
  background: var(--primary-color);
  transition: background-color 0.3s ease;
}

.dark-mode-checkbox:checked + .dark-mode-label .toggle-ball {
  transform: translateX(25px);
}

.dark-mode-checkbox:focus + .dark-mode-label {
  box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.5);
}

/* Loader styles */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-in-out;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(var(--primary-color-rgb), 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
  box-shadow: 0 0 20px var(--shadow-color);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(180deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Fade-in animation for main content */
body.loaded {
  animation: fadeIn 0.8s ease;
  margin: 0; /* Ensure no margin is added during animation */
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    margin-bottom: 0; /* Prevent margin changes during animation */
  }
  100% {
    opacity: 1;
    margin-bottom: 0; /* Prevent margin changes during animation */
  }
}

/* Fix for unwanted margins on small screens */
main {
  display: block;
  margin: 0;
  padding: 0;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.4s ease;
  padding: 5px 0;
}

.header.scrolled {
  box-shadow: 0 10px 30px var(--shadow-color);
  background: var(--header-bg);
  padding: 0.6rem 0;
}

.header.scrolled .nav-brand img {
  transform: scale(0.9);
  height: 60px;
}

.header.scrolled .nav-links a {
  font-size: 0.95rem;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: nowrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d3748;
  max-height: 110px;
  overflow: visible;
}

.nav-brand img {
  transition: transform 0.4s ease;
  height: 100px;
  width: auto;
  margin: 0;
  padding: 0;
  display: block;
  object-fit: contain;
}

.nav-brand a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-brand a:hover {
  opacity: 0.9;
}

.nav-brand a:active {
  opacity: 0.8;
}

.logo {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--heading-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.cta-button {
  background-color: var(--primary-color);
  color: white !important;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(56, 161, 105, 0.3);
}

.mobile-menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--heading-color);
  transition: color 0.3s ease;
}

/* Enhanced mobile menu styles */
.nav-links.active {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  background: var(--header-bg);
  padding: 2rem;
  box-shadow: 0 10px 30px var(--shadow-color);
  animation: slideDown 0.3s ease-in-out;
  z-index: 999;
  transition: background-color 0.3s ease;
}

@keyframes slideDown {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Hero Section */
.hero {
  padding: 30px 0 120px; /* Increased bottom padding even more to prevent content from being cut off */
  margin-top: 0; /* Explicitly remove top margin */
  margin-bottom: 20px; /* Add some margin at the bottom */
  border-bottom: none;
  background-color: var(--card-bg-color); /* Use theme variable */
  color: var(--text-color); /* Use theme variable */
  position: relative;
  overflow: visible; /* Changed from hidden to visible */
  min-height: 550px; /* Increased minimum height for hero section */
  transition: padding 0.3s ease, margin 0.3s ease, background-color 0.3s ease,
    color 0.3s ease; /* Smooth transitions */
  padding-top: 120px; /* Adjust as needed to clear the fixed header */
  z-index: 2; /* Ensure hero section has higher z-index */
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Removed background image/pattern */
  opacity: 0;
}

/* Clearfix for hero section to prevent content cutoff */
.hero::after {
  content: "";
  display: block;
  clear: both;
  height: 0;
  visibility: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
  padding-bottom: 20px; /* Add padding to prevent content cutoff */
}

.hero-title {
  font-family: "Montserrat", sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--heading-color);
}

.gradient-text {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    #667eea 100%
  ); /* Use variable for primary color */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1rem;
  opacity: 0.9;
  color: var(--text-color);
}

.hero-description {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.8;
  color: var(--text-color);
}

.hero-cta {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  width: 100%;
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  transform: none !important;
  justify-content: flex-start;
  position: relative;
  z-index: 10; /* Higher z-index to ensure buttons appear above other elements */
  padding-bottom: 15px; /* Extra padding at the bottom */
  border-bottom: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-align: center;
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  transform: none !important;
}

.btn-primary {
  background-color: var(
    --primary-color
  ); /* Using variable for primary button */
  color: white;
  transition: background-color 0.3s ease, transform 0.3s ease,
    box-shadow 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(var(--primary-color-rgb), 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color); /* Using variable for outline button */
  border: 2px solid var(--primary-color);
  width: auto;
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  transform: none !important;
  text-align: center !important;
  padding: 1rem 2rem;
  position: relative;
  z-index: 5;
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease, transform 0.3s ease;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.btn-hero {
  background-color: var(--primary-color); /* Using variable for hero button */
  color: white;
  font-size: 1.2rem;
  padding: 1.2rem 3rem;
  transition: background-color 0.3s ease, transform 0.3s ease,
    box-shadow 0.3s ease;
}

.btn-hero:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(var(--primary-color-rgb), 0.4);
}

/* Hero Visual */
.hero-image {
  max-width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-visual {
  position: relative;
}

/* Animations */
@keyframes rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.4;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Sections */
.section-title {
  font-family: "Montserrat", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--heading-color);
}

section {
  padding: 80px 0;
  background: var(--card-bg-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

section:nth-child(even) {
  background: var(--section-alt-bg);
}

/* Features Section */
.features {
  background: var(--card-bg-color);
  position: relative;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

.comparison-table {
  max-width: 800px;
  margin: 20px auto;
  background: var(--card-bg-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px var(--shadow-color);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  background-color: #2d3748; /* Dark background for table header */
  color: white;
  font-weight: 600;
  padding: 1.5rem;
}

.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.3s ease;
}

.table-row:hover {
  background: #f7fafc;
}

.table-row:last-child {
  border-bottom: none;
}

.feature-col {
  font-weight: 600;
  color: #72968a;
}

/* Make feature-col text white in dark mode */
body.dark-mode .feature-col {
  color: white;
}

/* Alternatively, if you're using a dark-theme class instead of body.dark-mode */
.dark-theme .feature-col {
  color: white;
}

.manual-col,
.ai-col {
  text-align: center;
}

.negative {
  color: #e53e3e;
  font-weight: 500;
}

.positive {
  color: #38a169;
  font-weight: 600;
}

/* How It Works */
.how-it-works {
  background: var(--section-alt-bg);
  transition: background-color 0.3s ease;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.step {
  background: var(--card-bg-color);
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 30px var(--shadow-color);
  transition: transform 0.3s ease, background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.step:hover {
  transform: translateY(-10px);
}

.step-number {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background-color: var(--primary-color); /* Using variable for step number */
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  transition: background-color 0.3s ease;
}

.step h3 {
  margin: 1rem 0;
  color: var(--heading-color);
  font-size: 1.3rem;
  transition: color 0.3s ease;
}

.step p {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  transition: color 0.3s ease;
}

.step-icon {
  font-size: 3rem;
  color: var(--primary-color); /* Using variable for step icon */
  margin-top: 1rem;
  transition: color 0.3s ease;
}

/* Africa Section */
.africa-section {
  background: var(--africa-bg); /* Using variable for Africa section */
  color: var(--text-color);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 100px var(--shadow-color);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.africa-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("../images/africa-map-overlay.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.1;
  z-index: 0;
  animation: pulseMap 8s infinite ease-in-out;
}

@keyframes pulseMap {
  0%,
  100% {
    opacity: 0.07;
    transform: scale(1);
  }
  50% {
    opacity: 0.12;
    transform: scale(1.05);
  }
}

.africa-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.africa-section .section-title {
  color: var(--footer-text);
  transition: color 0.3s ease;
}

.africa-description {
  font-size: 1.3rem;
  margin-bottom: 3rem;
  opacity: 0.9;
  color: var(--footer-text);
  transition: color 0.3s ease;
}

.africa-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.africa-feature {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(20, 26, 40, 0.75);
  border: 1px solid rgba(var(--primary-color-rgb), 0.3);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 15px var(--shadow-color);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease,
    border-color 0.3s ease;
  position: relative;
  z-index: 1;
}

.africa-feature:hover {
  transform: translateY(-5px);
  background: rgba(var(--primary-color-rgb), 0.3);
  border-color: rgba(var(--primary-color-rgb), 0.6);
  box-shadow: 0 8px 25px var(--shadow-color);
}

.africa-feature i {
  font-size: 2rem;
  color: var(--primary-color);
  filter: drop-shadow(0 0 5px rgba(var(--primary-color-rgb), 0.4));
  transition: transform 0.3s ease, filter 0.3s ease, color 0.3s ease;
}

.africa-feature:hover i {
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px rgba(var(--primary-color-rgb), 0.7));
}

.africa-feature span {
  font-weight: 600;
  color: var(--footer-text);
  font-size: 1.05rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: color 0.3s ease;
}

.africa-feature.feature-highlight {
  background: rgba(56, 161, 105, 0.4);
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.bounce-animation {
  animation: bounce 0.8s ease;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* Results Section */
.results {
  background: var(--secondary-bg);
  transition: background-color 0.3s ease;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.stat-card {
  background-color: var(--primary-color); /* Using variable for stat card */
  color: white;
  padding: 3rem 2rem;
  border-radius: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-10px);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.stat-card:hover::before {
  transform: translateX(100%);
}

.stat-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Testimonials */
.testimonials {
  background: var(--section-alt-bg);
  transition: background-color 0.3s ease;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.testimonial-card {
  background: var(--card-bg-color);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 15px 40px var(--shadow-color);
  position: relative;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  color: var(--primary-color); /* Using variable for quote */
  font-family: serif;
  transition: color 0.3s ease;
}

.testimonial-content p {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--heading-color); /* Using variable for text */
  margin-bottom: 2rem;
  font-style: italic;
  transition: color 0.3s ease;
}

.author-name {
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.author-title {
  color: var(--primary-color); /* Using variable for author title */
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

/* Integrations */
.integrations {
  background: var(--secondary-bg);
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.integration-item {
  background: var(--section-alt-bg);
  padding: 1.5rem;
  border-radius: 15px;
  text-align: center;
  font-weight: 600;
  color: var(--text-color);
  border: 2px solid transparent;
  transition: all 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.integration-item:hover {
  border-color: var(--primary-color); /* Using variable for border */
  background: var(--card-bg-color);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px var(--shadow-color);
}

/* Trust Section */
.trust {
  background: var(--section-alt-bg);
  transition: background-color 0.3s ease;
}

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

.trust-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.trust-feature {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background: var(--card-bg-color);
  border-radius: 15px;
  box-shadow: 0 5px 20px var(--shadow-color);
  transition: transform 0.3s ease, background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.trust-feature:hover {
  transform: translateY(-5px);
}

.trust-feature i {
  font-size: 2rem;
  color: var(--primary-color); /* Using variable for icon */
  transition: color 0.3s ease;
}

.trust-feature span {
  font-weight: 500;
  color: var(--heading-color);
  transition: color 0.3s ease;
}

/* CTA Section */
.cta-section {
  background-color: var(--footer-bg); /* Using variable for CTA background */
  color: var(--footer-text);
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.cta-section .section-title {
  color: var(--footer-text);
  transition: color 0.3s ease;
}

.cta-description {
  max-width: 700px;
  margin: 0 auto 2rem;
  font-size: 1.2rem;
  opacity: 0.9;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0 3rem;
  flex-wrap: wrap;
}

.cta-buttons .btn {
  padding: 1rem 3rem;
  border-radius: 50px;
  font-weight: 600;
  min-width: 220px;
  text-align: center;
  justify-content: center;
}

.cta-buttons .btn-primary {
  background: var(--primary-color);
  color: white;
  transition: background-color 0.3s ease, transform 0.3s ease,
    box-shadow 0.3s ease;
}

.cta-buttons .main-cta:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(var(--primary-color-rgb), 0.3);
}

.cta-buttons .btn-outline {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.cta-buttons .btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Footer */
.footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0 1rem;
  transition: background-color 0.3s ease;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand h3 {
  margin-bottom: 1rem;
  color: var(--primary-color); /* Using variable for footer brand */
  transition: color 0.3s ease;
}

.footer-brand p {
  opacity: 0.8;
  transition: color 0.3s ease;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.contact-item a {
  color: var(--footer-text); /* Using variable for footer contact links */
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-item a:hover {
  color: var(--primary-color); /* Using variable for hover */
  text-decoration: none;
}

.footer-links h3 {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 1rem;
}

.footer-links ul li a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links ul li a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  opacity: 0.7;
  transition: border-color 0.3s ease;
}

/* Toast notifications for buttons */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.toast {
  background-color: rgba(var(--primary-color-rgb), 0.9);
  color: white;
  padding: 12px 20px;
  border-radius: 4px;
  margin-top: 10px;
  box-shadow: 0 3px 10px var(--shadow-color);
  display: flex;
  align-items: center;
  animation: fadeInUp 0.3s ease-out forwards;
  transition: all 0.3s ease-in-out, background-color 0.3s ease,
    box-shadow 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button visibility helper class */
.always-visible {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

@media (max-width: 480px) {
  .always-visible {
    width: 100% !important;
    margin: 0.5rem 0 !important;
    padding: 1rem !important;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .nav {
    padding: 0.8rem 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
    overflow-x: hidden;
  }

  .nav-brand {
    max-height: 50px;
  }

  .nav-brand img {
    height: 80px;
  }

  .header.scrolled .nav-brand img {
    height: 50px;
  }

  .nav-links {
    display: none;
  }
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
    display: flex;
    flex-direction: column-reverse;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  /* Improved Africa section responsive styling */
  .africa-features {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
  .africa-feature {
    padding: 1.5rem;
    flex-direction: column;
    text-align: center;
    background: rgba(20, 26, 40, 0.75);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
  }

  .africa-feature i {
    margin-bottom: 0.75rem;
    font-size: 2.5rem;
  }

  .africa-feature span {
    font-size: 1.1rem;
    line-height: 1.4;
  }

  .hero-cta {
    justify-content: center;
  }

  .comparison-table {
    font-size: 0.9rem;
  }

  .table-header,
  .table-row {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .table-header > div,
  .table-row > div {
    padding: 0.5rem 0;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* Hero Section Mobile Improvements */
@media (max-width: 768px) {
  .hero {
    padding-top: 80px; /* Less padding on mobile */
    padding-bottom: 60px;
  }

  .hero-visual {
    margin-bottom: 2rem; /* Add space between image and content */
  }

  .hero-image {
    max-width: 90%; /* Slightly smaller image on mobile */
    margin: 0 auto; /* Center the image */
    display: block;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  }

  .hero-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem); /* Responsive font size */
  }

  .hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  .hero-description {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
    word-wrap: break-word;
  }
  .hero-cta {
    display: block !important;
    flex-direction: column;
    gap: 1rem;
    width: 100% !important;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-cta .btn {
    width: 100% !important;
    display: block !important;
    justify-content: center;
    margin: 0.8rem 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    min-height: 3rem;
  }
  .hero-cta .btn-outline {
    display: inline-block !important;
    width: 100% !important;
    margin-top: 1rem !important;
    padding: 1rem 2rem;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .container {
    padding: 0 15px;
    width: 100%;
    overflow-x: hidden;
  }

  .comparison-table {
    max-width: 100%;
    margin-left: 10px;
    margin-right: 10px;
  }

  /* Prevent horizontal overflow */
  body {
    overflow-x: hidden;
    width: 100%;
  }

  .nav-brand img {
    height: 38px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 0 20px;
  }

  .stat-card {
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    box-sizing: border-box;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .testimonial-card {
    padding: 1.5rem;
  }

  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Stats and Data Card Improvements */
@media (max-width: 768px) {
  .stats-grid {
    margin-top: 2rem;
  }

  .stat-card {
    margin-bottom: 1.5rem;
  }

  /* Prevent overflow with clamp for font sizes */
  .stat-number {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
  }

  .stat-label {
    font-size: clamp(0.9rem, 5vw, 1.1rem);
    padding: 0 10px;
  }
}

/* Mobile-first button layout fixes */
@media (max-width: 767px) {
  .hero-content {
    text-align: center;
    padding: 0 10px;
  }
  .hero-cta {
    display: flex;
    flex-direction: column;
    align-items: center; /* Changed to center on mobile */
    padding-bottom: 20px; /* Added extra padding at bottom */
    z-index: 10; /* Ensure high z-index on mobile too */
    position: relative;
  }

  .hero-cta a {
    margin: 10px 0;
    display: block !important;
    width: 100%;
    max-width: 280px;
    z-index: 5;
  }
  .hero-cta a.btn-outline {
    margin-top: 15px;
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    z-index: 5;
    transition: color 0.3s ease, border-color 0.3s ease;
  }
}

/* Hero CTA buttons responsive styling */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: flex-start;
  margin-top: 30px;
}

.hero-cta .btn {
  margin: 0;
  min-width: 180px;
  text-align: center;
}

/* Media queries for smaller screens */
@media (max-width: 768px) {
  .hero-cta {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .hero-cta .btn {
    width: 80%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .hero-cta .btn {
    width: 100%;
  }
}

/* Mobile styles for theme toggle */
@media (max-width: 768px) {
  .theme-toggle {
    position: absolute;
    top: 80px;
    right: 20px;
    z-index: 1000;
    margin: 0;
  }

  .nav-links.active .theme-toggle {
    position: relative;
    top: auto;
    right: auto;
    margin: 15px auto;
  }
}
