/* Correction for horizontal overflow */
*,
*::before,
*::after {
  box-sizing: border-box;
}

a {
  text-decoration: none; /* Removes underline from all links */
}

/* 1. Variables and Base Styles
-------------------------------------------------- */
:root {
  --color-primary: #25a969; /* Main accent color (green) */
  --color-primary-dark: #1e8754; /* Darker shade of primary */
  --color-secondary: #3b82f6; /* Secondary accent color (blue) */
  --color-blue: #dbeafe; /* Light blue */
  --color-soft-green: #f0fdf4; /* Very light green, used for Hero section */
  --color-soft-greenPlus: #e0fae8; /* Slightly darker light green */
  --color-gray-50: #f9fafb; /* Very light gray */
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-500: #6b7281; /* Medium gray for text */
  --color-gray-5001: #dcdcdc;
  --color-gray-600: #4b5563; /* Darker gray for text */
  --color-gray-800: #1f2937; /* Darkest gray for headings/main text */
  --color-white: #ffffff; /* White */
  --color-section2: #c5ddd6; /* Custom section background color */
}

html {
  /* Enables smooth scrolling when clicking anchor links */
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--color-gray-800);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased; /* Improves font rendering on macOS/iOS */
  -moz-osx-font-smoothing: grayscale; /* Improves font rendering on macOS/iOS */
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* 2. Header and Navigation
-------------------------------------------------- */
.main-header {
  /* Changed: Initial background color now matches the hero section's soft-green */
  background-color: var(--color-soft-green); /* */
  position: sticky; /* Makes header stick to the top */
  top: 0;
  z-index: 50; /* Ensures header is above other content */
  transition: background-color 0.3s, box-shadow 0.3s; /* Smooth transition for scroll effect */
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.header-start,
.header-end {
  flex: 1; /* Allows elements to grow and shrink */
}

.header-end {
  display: flex;
  justify-content: flex-end; /* Pushes content to the right */
}

.logo {
  height: 2.5rem; /* Fixed height for the logo */
  width: auto;
}

.main-nav {
  display: none; /* Hidden on mobile by default */
  align-items: center;
  gap: 2rem; /* Space between navigation links */
}

.main-nav a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-gray-600);
  text-decoration: none;
  transition: color 0.2s; /* Smooth color change on hover */
}
.main-nav a:hover {
  color: var(--color-primary); /* Primary color on hover */
}
.main-nav a.active-link {
  color: var(--color-primary);
  font-weight: 700;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-600);
  padding: 0.5rem;
  position: relative; /* Needed for positioning SVG icons */
  display: flex; /* To align icons */
  align-items: center;
  justify-content: center;
}

.menu-btn svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2;
  position: absolute; /* Allows icons to overlap */
  transition: opacity 0.3s ease-in-out; /* Smooth transition for icon change */
}

/* Initially hide the close icon, show the menu icon */
.menu-btn .icon-close {
  display: none;
}
.menu-btn .icon-menu {
  display: block;
}

/* When menu is open (button has 'menu-open' class), hide menu icon, show close icon */
.menu-btn.menu-open .icon-close {
  display: block;
}
.menu-btn.menu-open .icon-menu {
  display: none;
}

.mobile-menu {
  display: none; /* Hidden by default, shown by JavaScript */
  padding: 0 1.5rem 1rem 1.5rem;
  background-color: var(--color-white);
  border-top: 1px solid var(--color-gray-200);
}
.mobile-menu.open {
  display: block; /* Displayed when 'open' class is added by JavaScript */
}
.mobile-menu a {
  display: block;
  padding: 0.75rem 0;
  text-align: center;
  color: var(--color-gray-600);
  text-decoration: none;
}
.mobile-menu a:hover {
  color: var(--color-primary);
}

#main-header.scrolled {
  background-color: var(--color-white); /* White background when scrolled */
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1); /* Subtle shadow when scrolled */
}

/* 3. Hero Section
-------------------------------------------------- */
.hero-section {
  background-color: var(--color-soft-green); /* Hero section's distinct background */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 500px; /* Minimum height ensures content is visible */
  padding: clamp(1rem, 2vh, 2rem) 0; /* Responsive vertical padding using clamp() for fluid sizing */
}

.hero-content h1 {
  font-size: clamp(2.25rem, 1rem + 1.2vw, 3.75rem); /* Responsive font size using clamp() */
  font-weight: 600;
  line-height: 1.2;
}

.hero-content p {
  margin-top: 5px;
  max-width: 50rem;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.25rem); /* Responsive font size using clamp() */
  color: var(--color-gray-500);
}

.hero-actions {
  margin-top: 2rem;
}

.button {
  display: inline-block;
  font-weight: 700;
  font-size: 1.125rem;
  padding: 0.8rem 2.2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.3s ease-in-out; /* Smooth transitions for hover effects */
  border: 2px solid var(--color-primary);
  background-color: var(--color-primary);
  color: var(--color-white);
  width: 80%; /* Full width on small screens */
  cursor: pointer;
}

.button:hover {
  background-color: var(--color-primary-dark);
  color: var(--color-white);
  transform: translateY(-2px); /* Slight lift on hover */
}

/* 4. Features Section
-------------------------------------------------- */
.features-section {
  /* background-color: var(--color-gray-50); */
   background-color: var(--color-soft-green); 
  padding: clamp(3rem, 8vw, 5rem) 0; /* Responsive vertical padding */
}

.section-title {
  font-size: clamp(1.8rem, 1.6rem + 1.2vw, 2.5rem); /* Responsive font size */
  font-weight: 700;
  text-align: center;
  margin-top: 0;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile, adapts dynamically */
  gap: 1.5rem;
  text-decoration: none; /* Removes underline from grid links */
}

.feature-card {
   position: relative;
  text-align: center;
  padding: 2rem;
  background-color: var(--color-white);
  border-radius: 1rem;
  border: 1px solid var(--color-gray-200);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  border-right: 3px solid #007bff; /* Decorative right border */
}

.feature-card:hover {
  transform: translateY(-0.5rem); /* Lift effect on hover */
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1); /* Stronger shadow on hover */
}

.card-icon-bg {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
}
.card-icon-bg.green {
  background-color: #dcfce7;
}
.card-icon-bg.green svg {
  color: #22c55e;
}
.card-icon-bg.blue {
  background-color: #dbeafe;
}
.card-icon-bg.blue svg {
  color: #3b82f6;
}
.card-icon-bg.purple {
  background-color: #f3e8ff;
}
.card-icon-bg.purple svg {
  color: #a855f7;
}

.card-icon-bg svg {
  width: 35px;
  height: 35px;
  stroke-width: 2;
}

.feature-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
}

.feature-card p {
  color: var(--color-gray-500);
  line-height: 1.625;
  font-size: 0.95rem;
  margin: 0;
}

/* 5. Blog Section
-------------------------------------------------- */
.blog-section {
  background-color: var(--color-soft-green);
  padding: clamp(3rem, 8vw, 5rem) 0; /* Responsive vertical padding */
}
.section-subtitle {
  text-align: center;
  font-size: 1.25rem;
  color: var(--color-gray-500);
  margin-top: -2.5rem; /* Pulls subtitle closer to title */
  margin-bottom: 3rem;
}
.blog-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile, adapts dynamically */
  gap: 2rem;
}
.blog-post-card {
  background-color: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: 1rem;
  overflow: hidden;
  text-align: right; /* Aligns text to the right for RTL */
  padding: 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
  border-right: 3px solid #ffd000; /* Decorative right border */
}
.blog-post-card:hover {
  transform: translateY(-0.5rem); /* Lift effect on hover */
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1); /* Stronger shadow on hover */
}
.blog-post-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
.blog-post-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
}
.blog-post-card p {
  color: var(--color-gray-500);
  margin-bottom: 1rem;
}
.read-more {
  color: var(--color-primary);
  font-weight: bold;
  text-decoration: none;
}

/* 6. Contact Section
-------------------------------------------------- */
.contact-section {
  /* background-color: var(--color-gray-50); */
   background-color: var(--color-soft-green); 
  padding: clamp(3rem, 8vw, 5rem) 0; /* Responsive vertical padding */
  text-align: center;
}
.contact-description {
  color: var(--color-gray-500);
  font-size: 1.1rem;
  margin-top: -2rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.contact-form {
  display: grid;
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 169, 105, 0.2); /* Focus ring effect */
}
.contact-form .button {
  width: 100%;
}

/* 7. Footer
-------------------------------------------------- */
.main-footer {
  background-color: var(--color-gray-800);
  color: var(--color-white);
}
.main-footer .container {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  text-align: center;
}

/* 8. Responsive Media Queries
-------------------------------------------------- */
@media (min-width: 640px) {
  /* Small screens (sm) */
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .button {
    width: auto; /* Buttons are no longer full width */
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr); /* Two columns for features */
  }
  .blog-grid {
    grid-template-columns: repeat(2, 1fr); /* Two columns for blog posts */
  }
  .contact-form .button {
    width: auto;
    justify-self: center; /* Centers the button in the grid */
  }
}

@media (min-width: 1024px) {
  /* Large screens (lg) */
  .main-nav {
    display: flex; /* Displays the main navigation */
  }
  .menu-btn {
    display: none; /* Hides the mobile menu button */
  }
  .features-grid {
    grid-template-columns: repeat(3, 1fr); /* Three columns for features */
    gap: 2.5rem;
  }
  .blog-grid {
    grid-template-columns: repeat(3, 1fr); /* Three columns for blog posts */
  }
}

/* Styles for quiz list pages (e.g., list-general.html) */
.containerquiz {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.quiz-list-container {
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 700px;
  margin-bottom: 20px;
}

.quiz-list-container h2 {
  color: #0056b3;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

.quiz-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quiz-list li a {
  display: block;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  margin-bottom: 10px;
  transition: background-color 0.3s, transform 0.3s;
  border-right: 4px solid #007bff;
}

.quiz-list li a:hover {
  background-color: #e9ecef;
  transform: translateX(-5px); /* Slight slide effect on hover */
}