@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #6366f1;
  --secondary-color: #06b6d4;
  --accent-color: #f59e0b;
  --neutral-color: #64748b;
  --light-bg: #f8fafc;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --text-color: #333333;
  --text-muted: #64748b;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Add padding to prevent content from being covered by the fixed header */
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-color);
  line-height: 1.6;
  padding-top: 7rem; /* Account for navbar + ad banner */
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

a {
  text-decoration: none;
  color: var(--neutral-color);
}

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

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f1f5f9;
  padding: 10px 30px;
}

/* Ensure the header height is consistent */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  height: auto;
  min-height: 4rem;
  transition: background-color 0.3s ease;
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
}

.nav-link {
  color: var(--neutral-color);
  position: relative;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

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

.nav-link:hover::after {
  width: calc(100% - 2rem);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(to right, var(--light-bg), #fff);
}

/* Search Bar */
.search-bar {
  display: flex;
  justify-content: center;
  max-width: 600px;
  margin: 2rem auto;
}

.search-bar input {
  width: 100%;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 50px;
}

.search-bar .form-control {
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  border: 1px solid var(--border-color);
}

/* Featured Section */
.featured {
  text-align: center;
  padding: 20px;
  background-color: white;
  margin: 20px auto;
  width: 80%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.featured-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.calculator-preview {
  background: var(--light-bg);
  border-radius: 12px;
  min-height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

.btn-secondary {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

/* Categories */
.categories {
  width: 100%;
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 20px; /* Consistent spacing between cards */
}

.category-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.category-card h3 {
  background-color: #f8fafc;
  padding: 10px;
  border-radius: 8px 8px 0 0;
  margin: -10px -10px 10px -10px;
  text-align: center;
}

.category-card h5 {
  margin-bottom: 10px;
}

.category-icon {
  font-size: 2rem;
  color: var(--primary-color);
}

/* Popular Calculators */
.popular {
  width: 80%;
  margin: 20px auto;
}

.popular-card {
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.popular-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Category-Specific Colors */
.popular-card.financial .badge {
  background-color: var(--primary-color);
  color: white;
}

.popular-card.health .badge {
  background-color: var(--secondary-color);
  color: white;
}

.popular-card.utility .badge {
  background-color: var(--accent-color);
  color: white;
}

.popular-card.math .badge {
  background-color: #6366f1; /* Purple for math */
  color: white;
}

.popular-card.business .badge {
  background-color: #ef4444; /* Red for business */
  color: white;
}

.tag {
  display: inline-block;
  background-color: #f1f5f9;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 10px;
  color: #64748b;
  margin-top: 10px;
}

/* Ads */
.ads {
  display: flex;
  justify-content: space-between;
  margin: 20px auto;
  width: 80%;
}

.ad {
  width: 40px;
  height: 420px;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  text-align: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Updated Ad Placeholder */
.ad-placeholder {
  background-color: #f1f5f9;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.ad-top-banner {
  position: fixed;
  top: 4rem;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}

/* Footer */
.footer {
  text-align: center;
  background-color: #f1f5f9;
  padding: 10px 0;
  font-size: 10px;
}

footer {
  margin-top: 4rem;
  background: var(--neutral-color);
  font-size: 14px;
  color: white;
}

footer a {
  color: var(--accent-color);
}

footer a:hover {
  color: var(--primary-color);
}

/* Buttons */
.btn-link {
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.5rem 0;
  display: block;
  transition: color 0.2s;
}

.btn-link:hover {
  color: darken(var(--primary-color), 10%);
}

/* Utility Classes */
main {
  /*
  padding-top: 0.1rem;
  */
}

.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

.card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  background: white;
  transition: all 0.3s ease;
  margin-bottom: 2rem;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 16px var(--shadow-color);
}

.card-body {
  padding: 2rem;
  border-top: 3px solid var(--secondary-color);
  border-radius: 16px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

section {
  padding: 4rem 0;
}

.row {
  --bs-gutter-x: 2rem;
  --bs-gutter-y: 2rem;
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(var(--bs-gutter-x) * -.5);
  margin-left: calc(var(--bs-gutter-x) * -.5);
}

.row > * {
  padding-right: calc(var(--bs-gutter-x) * .5);
  padding-left: calc(var(--bs-gutter-x) * .5);
  margin-top: var(--bs-gutter-y);
}

.card img.card-img-top {
  border-radius: 16px 16px 0 0;
  padding: 1.5rem;
}

.result-box {
  background-color: white;
  border-radius: 16px;
  border-top: 3px solid var(--secondary-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  padding: 2rem;
  margin: 1.5rem 0;
}

.list-group-item:first-child {
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.list-group-item:last-child {
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.card.shadow-sm {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.card-body .btn-primary {
  margin-top: auto; /* Push the button to the bottom */
}

.card-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
  color: var(--neutral-color);
}

.list-unstyled li {
  margin-bottom: 0.5rem;
}

.list-unstyled a {
  color: #007bff;
  text-decoration: none;
}

.list-unstyled a:hover {
  text-decoration: underline;
}

.bg-light {
  background-color: #f8f9fa !important;
}

.bg-dark {
  background-color: #343a40 !important;
}

.text-white {
  color: #fff !important;
} /* Fixed missing closing brace */

/* Custom CSS for fixed card dimensions */
.fixed-card-height {
  height: 300px; /* Adjust the height as needed */
}

.fixed-card-width {
  width: 100%; /* Ensures cards take up the full column width */
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section {
    text-align: center;
  }
  
  .category-card {
    margin-bottom: 1rem;
  }
  
  .featured-card {
    padding: 1rem;
  }

  .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
  }
  
  .card-body {
    padding: 1.5rem;
  }
}

.container {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

main .container {
  display: block;
}

@media (min-width: 768px) {
  .container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* Mobile Sticky Footer Ad */
.mobile-footer-ad {
  display: none;
}

@media (max-width: 767px) {
  .mobile-footer-ad {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
    z-index: 999;
    min-height: 60px;
  }

  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
}

/* Smooth Hover Transitions */
.card, .btn, .nav-link {
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

