:root {
   --primary: #2E7D32;
   --accent: #F4A261;
   --bg-light: #F5F5F5;
   --text-dark: #333;
}

body.dark-mode {
   --bg-light: #121212;
   --text-dark: #EEE;
}

body {
   margin: 0;
   font-family: 'Merriweather', serif;
   background: var(--bg-light);
   color: var(--text-dark);
   line-height: 1.6;
}

.navbar {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 1rem;
   background: white;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
   position: sticky;
   top: 0;
   z-index: 100;
}

body.dark-mode .navbar {
   background: #1E1E1E;
}

.logo {
   font-family: 'Lato', sans-serif;
   font-size: 1.5rem;
   color: var(--primary);
}

.nav-links {
   display: flex;
   list-style: none;
   gap: 1rem;
}

.nav-links a {
   text-decoration: none;
   color: var(--text-dark);
   transition: color 0.3s;
}

.nav-links a:hover {
   color: var(--accent);
}

.search-bar {
   display: flex;
   align-items: center;
   background: #EEE;
   padding: 0.5rem;
   border-radius: 20px;
}

body.dark-mode .search-bar {
   background: #333;
}

.search-bar input {
   border: none;
   background: transparent;
   outline: none;
}

#theme-toggle {
   background: none;
   border: none;
   cursor: pointer;
   font-size: 1.2rem;
}

.hero {
   background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/libary.jpg');
   /* Replace with your image */
   background-size: cover;
   height: 60vh;
   display: flex;
   align-items: center;
   justify-content: center;
   text-align: center;
   color: white;
}

.hero-content h1 {
   font-family: 'Lato', sans-serif;
   font-size: 3rem;
}

.cta-btn {
   background: var(--primary);
   color: white;
   padding: 1rem 2rem;
   text-decoration: none;
   border-radius: 5px;
   transition: background 0.3s;
}

.cta-btn:hover {
   background: var(--accent);
}

.features {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
   gap: 2rem;
   padding: 2rem;
}

.feature-card {
   background: white;
   padding: 1rem;
   border-radius: 8px;
   box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
   transition: transform 0.2s;
}

body.dark-mode .feature-card {
   background: #1E1E1E;
}

.feature-card:hover {
   transform: scale(1.05);
}

.stats {
   display: flex;
   justify-content: center;
   gap: 2rem;
   padding: 2rem;
   text-align: center;
}

.stat-item h3 {
   font-size: 2.5rem;
   color: var(--primary);
}

.newsletter {
   text-align: center;
   padding: 2rem;
   background: var(--primary);
   color: white;
}

.newsletter form {
   display: flex;
   justify-content: center;
   gap: 1rem;
}

.newsletter input {
   padding: 0.5rem;
   border: none;
   border-radius: 5px;
}

.newsletter button {
   background: var(--accent);
   color: white;
   border: none;
   padding: 0.5rem 1rem;
   cursor: pointer;
   border-radius: 5px;
}

footer {
   text-align: center;
   padding: 1rem;
   background: var(--primary);
   color: white;
}

.back-to-top {
   position: fixed;
   bottom: 1rem;
   right: 1rem;
   background: var(--accent);
   color: white;
   padding: 0.5rem;
   border-radius: 50%;
   display: none;
}

@media (max-width: 768px) {
   .navbar {
      flex-wrap: wrap;
   }

   .nav-links {
      flex-direction: column;
      position: absolute;
      top: 100%;
      left: 0;
      width: 100%;
      background: white;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;
   }

   body.dark-mode .nav-links {
      background: #1E1E1E;
   }

   .nav-links.mobile-open {
      max-height: 300px;
      /* Adjust based on link count */
   }

   .nav-links li {
      padding: 1rem;
      border-bottom: 1px solid #EEE;
   }

   body.dark-mode .nav-links li {
      border-bottom-color: #333;
   }

   .search-bar {
      order: 3;
      width: 100%;
      margin-top: 1rem;
   }

   #theme-toggle {
      order: 2;
      margin-left: auto;
   }

   .mobile-menu-btn {
      background: none;
      border: none;
      font-size: 1.5rem;
      cursor: pointer;
      color: var(--primary);
      order: 1;
   }

   /* Stack other elements if needed */
   .hero-content h1 {
      font-size: 2rem;
   }

   .features {
      grid-template-columns: 1fr;
   }

   .stats {
      flex-direction: column;
      gap: 1rem;
   }

   .newsletter form {
      flex-direction: column;
      align-items: center;
   }

   .newsletter input {
      width: 100%;
      max-width: 300px;
   }
}