:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f9f6;
  --text-primary: #333333;
  --text-secondary: #666666;
  --loan-guide-bg: #ffffff;
  --loan-guide-text: #333333;
  --loan-guide-secondary: #666666;
}

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --loan-guide-bg: #2d2d2d;
  --loan-guide-text: #ffffff;
  --loan-guide-secondary: #cccccc;
}

/* Update your existing loan guide styles */
.loan-guide-section {
  text-align: center;
  margin-top: 50px;
  background: var(--loan-guide-bg) !important; /* Force override */
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  color: var(--loan-guide-text) !important; /* Force text color */
  transition: all 0.3s ease;
}

/* Ensure all text in loan guide section uses proper colors */
.loan-guide-section h1,
.loan-guide-section h2,
.loan-guide-section h3 {
  color: var(--loan-guide-text) !important;
  margin-bottom: 1rem;
}

.loan-guide-section p {
  color: var(--loan-guide-secondary) !important;
  margin-bottom: 1rem;
}

/* Fix the header text in loan guide */
.container header h1 {
  color: var(--loan-guide-text) !important;
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.container header p {
  color: var(--loan-guide-secondary) !important;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Update loan cards to work with dark mode */
.loan-card {
  background: var(--bg-primary);
  border: 1px solid rgba(76, 175, 80, 0.2);
  color: var(--text-primary);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.loan-card span {
  display: block;
  padding: 15px;
  font-weight: 600;
  background: rgba(76, 175, 80, 0.1);
  color: var(--text-primary) !important;
  border-top: 1px solid rgba(76, 175, 80, 0.2);
}

.loan-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.4);
}

/* Language select styling for dark mode */
select.language-select {
  padding: 8px 12px;
  border-radius: 5px;
  margin-left: 10px;
  border: 2px solid rgba(76, 175, 80, 0.3);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.3s ease;
}

select.language-select:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Dark mode specific overrides */
[data-theme="dark"] .loan-guide-section {
  background: #2d2d2d !important;
  border: 1px solid #404040;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .loan-card {
  background: #3d3d3d;
  border-color: #505050;
}

[data-theme="dark"] .loan-card span {
  background: rgba(76, 175, 80, 0.2);
  color: #ffffff !important;
  border-top-color: #505050;
}

[data-theme="dark"] select.language-select {
  background: #3d3d3d;
  border-color: #505050;
  color: #ffffff;
}

[data-theme="dark"] select.language-select option {
  background: #3d3d3d;
  color: #ffffff;
}

/* Ensure button text is always visible */
.btn-green {
  display: inline-block;
  background: linear-gradient(135deg, #2e7d32, #4caf50);
  color: #fff !important;
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.btn-green:hover {
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
  color: #fff !important;
}

/* Additional container styling for better dark mode support */
.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

[data-theme="dark"] .container {
  background: #1f1f1f;
  border: 1px solid #404040;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Import theme system */
@import url('theme.css');

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  background-color: var(--bg-secondary, #f0f4f7);
  color: var(--text-primary, #333);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  scroll-padding-top: 140px;
}



.header-navbar-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: white; /* match your site */
  transition: transform 0.3s ease-in-out;
}

/* Header Styles */
header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1001;
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
  overflow: hidden;
  padding-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

header h2 {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 500;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  flex: 1;
  text-align: center;
}

.header-buttons {
  display: flex;
  gap: 1rem;
  z-index: 3;
  align-items: center;
}

.calendar-button,
.logout-button,
.feedback-button,
.theme-toggle {
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(196, 19, 19, 0.15);
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.calendar-button {
  background: linear-gradient(135deg, #a4e857ff, #9ccc65);
  color: white;
}

.calendar-button:hover {
  background: linear-gradient(135deg, #6ec820ff, #7cb342);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(139, 195, 74, 0.4);
}

.calendar-icon {
  font-size: 1rem;
}

.logout-button {
  background: linear-gradient(135deg, #ef5350, #f44336);
  color: white;
}

.logout-button:hover {
  background: linear-gradient(135deg, #d32f2f, #c62828);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.feedback-button {
  background: linear-gradient(135deg, #fff59d, #ffeb3b);
  color: #333;
}

.feedback-button:hover {
  background: linear-gradient(135deg, #fff176, #fdd835);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 235, 59, 0.4);
}

/* Navigation Styles */
nav {
  position: sticky;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(209, 143, 143, 0.432);
  padding: 1.5rem 0;
  

}

.navbar {
  position: sticky;
  top: 70px; /* height of header */
  z-index: 1000;
  background: white; /* match your design */
  transition: top 0.3s ease-in-out;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0 1rem;
}

nav a {
  text-decoration: none;
  color: #2e7d32;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.3s ease;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.2);
  font-size: 0.9rem;
}

nav a:hover {
  
  color: #ffffff;
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
}

.brand h1 {
  margin: 0;
  font-size: 2.5rem;
  color: #fff;
}

.site-logo {
  height: 50px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  margin-right: 15px;
}

/* Main Content */
main {
  flex: 1;
  padding: 2rem;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  margin-top: 2rem;
}

.section-title h2 {
  font-size: 2rem;
  color: #1b5e20;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.section-title p {
  color: #666;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Grid Container */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.grid-item {
  display: block;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(200, 230, 201, 0.5);
  border-radius: 15px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  backdrop-filter: blur(5px);
}

.grid-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(76, 175, 80, 0.05),
      rgba(102, 187, 106, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.grid-item:hover p {
  color: #e8f5e9; /* light green instead of ivory */
}

.grid-item:hover h3 {
  color: #ffffff; /* white is fine for heading */
}
.grid-item:hover::before {
  opacity: 0.15; /* slightly more visible */
  background: linear-gradient(135deg, rgba(76,175,80,0.1), rgba(102,187,106,0.1));
}

.grid-item:hover::before {
  opacity: 1;
  z-index: 1;
}

.grid-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 30px rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.3);
}
.grid-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(76, 175, 80, 0.05),
      rgba(102, 187, 106, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1; 
}
.grid-item-content {
  padding: 1.5rem;
  position: relative;
  z-index: 2;
  transition: color 0.3s ease;
}

.grid-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
  background: linear-gradient(135deg, #f0f9f0, #e8f5e8);
}

.grid-item:hover img {
  transform: scale(1.05);
}
.grid-item:hover{
  /* .arrow-icon{
    color:--var(--secondary-green);
  } */
  /* .feature-badge{
    background: white;
    color: #4caf50;
  } */
  h3{
    color:--var(--text-primary);
  }
  p{
    color:--var(--text-secondary);
  }
}

.grid-item h3 {
  color: #1b5e20;
  margin: 1rem 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.grid-item p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.grid-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(200, 230, 201, 0.3);
}

.feature-badge {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.arrow-icon {
  color: #4caf50;
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.grid-item:hover .arrow-icon {
  color: white;
}
.grid-item-content h3,
.grid-item-content p,
.grid-item-content .feature-badge,
.grid-item-content .arrow-icon {
  transition: color 0.3s ease, background 0.3s ease;
}



/* Footer */
footer {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
  text-align: center;
  padding: 1rem;
  padding-bottom: 0.2rem;
  margin-top: auto;
}

footer h3 {
  font-size: 22px;
  margin-bottom: 1rem;
  font-weight: 600;
}

footer p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  margin-bottom: 2px;
}

footer a {
  display: inline-block;
  margin: 0 15px;
  font-size: 1 rem;
  color: rgba(255, 255, 255, 0.8);
  transition:all 0.5s;
  padding: 2px;
  border-radius: 10px;
  /* background: rgba(255, 255, 255, 0.1); */
  /* width: 50px;
  height: 50px; */
  line-height: 30px;
}

footer a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px) scale(1.07);
  /* box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3); */
}

/* Ripple Animation */
@keyframes ripple {
  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* Loading animation for images */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: calc(200px + 100%) 0;
  }

}

.social-media a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    padding: 0;
    transform: none;
}

.social-media a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.social-media a:hover::before {
    left: 100%;
}

.social-media a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    opacity: 1;
    text-decoration: none;
    padding-left: 0;
}

/* Enhanced Copyright Section */
.site-footer > p {
    position: relative;
    z-index: 2;
    margin: 2rem auto 0 auto;
    opacity: 1;
    text-align: center;
    padding: 2rem 2rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.95);
    max-width: 1200px;
    width: 100%;
    display: block;
}

.site-footer > p::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #81c784, transparent);
    transform: translateX(-50%);
}

/* Responsive Design */
@media (max-width: 968px) {
    .site-footer .footer-inner {
        grid-template-columns: 1fr 1fr;
        text-align: center;
        gap: 2.5rem;
    }
    
    .footer-brand {
        grid-column: 1 / -1;
        text-align: center;
        margin-bottom: 1rem;
    }

    .social-media {
        justify-content: center;
    }

    .site-footer h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .site-footer .footer-inner {
        padding: 2.5rem 1.5rem 1rem;
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .site-footer h3 {
        font-size: 1.8rem;
    }

    .site-footer h4 {
        font-size: 1.2rem;
    }

    .site-footer h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .site-footer a:hover {
        transform: translateY(-1px);
    }

    .site-footer > p {
        padding: 2rem 1.5rem 1.5rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .site-footer .footer-inner {
        padding: 2rem 1rem 1rem;
        gap: 1.5rem;
    }

    .site-footer h3 {
        font-size: 1.6rem;
    }

    .social-media a {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .site-footer > p {
        font-size: 0.9rem;
        padding: 1.5rem 1rem 1rem;
        
    }
}

    /* Floating Chatbot Button */
#chatbotBtn {
  position: fixed;
  bottom: 100px; /* 20px above scroll-to-top button */
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #4caf50; /* greenish theme */
  color: #fff;
  font-size: 28px;
  text-align: center;
  line-height: 60px;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  z-index: 1100; /* above scroll-to-top button */
}

#chatbotBtn:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
  background-color: #43a047; /* slightly darker green on hover */
}

/* Mobile responsiveness: hide on very small screens */
@media (max-width: 400px) {
  #chatbotBtn {
    display: none;
  }
}
@media (max-width: 768px) {
  .logout-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .logout-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
  }
}
@media (max-width: 768px) {
  header {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .brand {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
  }

  .header-buttons {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .calendar-button,
  .logout-button,
  .feedback-button {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    min-width: 80px;
    text-align: center;
  }

  .theme-toggle {
    padding: 0.6rem;
    min-width: 60px;
  }

  /* Ensure logout button is always visible */
  .logout-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
}
nav a {
    padding: 0.8rem 1rem;
    text-align: center;
    font-size: 0.9rem;
  }

@media (max-width: 480px) {
  header {
    padding: 0.8rem;
  }

  .brand h2 {
    font-size: 1.5rem;
  }

  .header-buttons {
    gap: 0.3rem;
  }

  .calendar-button,
  .logout-button,
  .feedback-button {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    min-width: 70px;
  }

  .theme-toggle {
    padding: 0.5rem;
    min-width: 50px;
  }

  /* Extra small screens - stack buttons if needed */
  .header-buttons {
    flex-direction: row;
    justify-content: space-around;
  }

  nav ul {
    gap: 0.6rem;
  }

  nav a {
    padding: 0.7rem;
    font-size: 0.85rem;
  }
}

    /* Scroll Button */
.scroll-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-green);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--shadow-medium);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.scroll-btn.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--shadow-heavy);
}
