/* Mobile menu overlay styles */
.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Dark mode background */
.dark {
  background-color: var(--color-background);
  background-image: linear-gradient(135deg,
    rgba(59, 130, 246, 0.02) 0%,
    rgba(167, 139, 250, 0.02) 100%);
}

.dark body {
  background-color: var(--color-background);
}

/* Card styling with gradients */
.card-gradient {
  background: var(--color-card);
  position: relative;
}

.dark .card-gradient {
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.95) 0%,
    rgba(26, 26, 26, 0.98) 100%);
  backdrop-filter: blur(10px);
}

/* Enhanced card styling for dark mode */
.dark .bg-gray-800\/50 {
  background: linear-gradient(135deg,
    rgba(31, 41, 55, 0.5) 0%,
    rgba(39, 49, 65, 0.5) 100%);
  backdrop-filter: blur(10px);
}

/* Gradient backgrounds for sections */
.section-gradient-light {
  background: linear-gradient(135deg,
    rgba(37, 99, 235, 0.02) 0%,
    rgba(139, 92, 246, 0.02) 100%);
}

.section-gradient-dark {
  background: linear-gradient(135deg,
    rgba(37, 99, 235, 0.05) 0%,
    rgba(139, 92, 246, 0.05) 100%);
}

.dark .section-gradient-light {
  background: linear-gradient(135deg,
    rgba(59, 130, 246, 0.08) 0%,
    rgba(167, 139, 250, 0.08) 100%);
}

.dark .section-gradient-dark {
  background: linear-gradient(135deg,
    rgba(59, 130, 246, 0.12) 0%,
    rgba(167, 139, 250, 0.12) 100%);
}

/* Enhanced section contrast for light mode */
/* Light mode: Add subtle borders and shadows to create visual separation between sections */
/* This mimics the strong contrast that dark mode already has between gray-900 and gray-950 */

/* Style for gray-50 sections in light mode - add subtle gradient overlay for depth */
main section.bg-gray-50 {
  background: linear-gradient(135deg,
    rgba(59, 130, 246, 0.035) 0%,
    rgba(139, 92, 246, 0.035) 100%),
    #f3f4f6; /* Use gray-100 base instead of gray-50 for stronger contrast */
}

/* In dark mode, use the original Tailwind color without any overlay */
.dark main section.bg-gray-50 {
  background: #111827; /* Tailwind gray-900 */
}

/* Style for white sections in light mode - add subtle inset border shadows */
main section.bg-white {
  position: relative;
}

main section.bg-white::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.06) 50%,
    transparent 100%);
}

main section.bg-white::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.06) 50%,
    transparent 100%);
}

/* Remove pseudo-elements in dark mode where contrast is already excellent */
.dark main section.bg-white::before,
.dark main section.bg-white::after {
  display: none;
}

/* Gradient backgrounds - enhanced */
.dark .bg-gradient-to-r.from-blue-50.to-purple-50 {
  background: linear-gradient(to right,
    rgba(59, 130, 246, 0.1) 0%,
    rgba(167, 139, 250, 0.1) 100%);
}

/* Button gradients */
.btn-gradient {
  background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
  color: white;
  transition: all var(--transition-base);
}

.btn-gradient:hover {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.dark .btn-gradient {
  background: linear-gradient(135deg, var(--chart-1) 0%, var(--chart-5) 100%);
}

.dark .btn-gradient:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
}

/* Select dropdown arrow styling */
.styled-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  appearance: none;
}


/* Card gradient enhancements */
.card {
  background: var(--color-card);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), #8b5cf6);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover::before {
  opacity: 1;
}

.dark .card {
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.98) 0%,
    rgba(26, 26, 26, 0.95) 100%);
}

.dark .card::before {
  background: linear-gradient(90deg, var(--chart-1), var(--chart-5));
}

/* Calculator header gradient */
.calculator-header h1 {
  background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Primary button - solid color, no gradient */
.btn-primary {
  background: var(--color-primary);
  border: none;
  position: relative;
  transition: all var(--transition-base);
}

.dark .btn-primary {
  background: var(--color-primary);
}

/* Result cards gradient accents */
.result-item {
  position: relative;
}

.result-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--color-primary) 50%,
    transparent 100%);
  opacity: 0.3;
}

.dark .result-item::after {
  background: linear-gradient(90deg,
    transparent 0%,
    var(--chart-1) 50%,
    transparent 100%);
}

/* Footer gradient enhancement */
footer {
  background: var(--color-muted);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--color-primary) 25%,
    #8b5cf6 50%,
    var(--color-primary) 75%,
    transparent 100%);
  opacity: 0.3;
}

.dark .footer {
  background: linear-gradient(180deg,
    rgba(26, 26, 26, 0.98) 0%,
    rgba(10, 10, 10, 1) 100%);
}

.dark .footer::before {
  background: linear-gradient(90deg,
    transparent 0%,
    var(--chart-1) 25%,
    var(--chart-5) 50%,
    var(--chart-1) 75%,
    transparent 100%);
  opacity: 0.5;
}

/* Mobile-specific styles for legal links in side menu */
@media (max-width: 768px) {
  .mobile-menu-divider {
    height: 1px;
    background-color: rgb(229 231 235);
    margin: 0.5rem 1rem;
  }

  .dark .mobile-menu-divider {
    background-color: rgb(55 65 81);
  }

  .mobile-menu-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(107 114 128);
  }

  .dark .mobile-menu-section-title {
    color: rgb(156 163 175);
  }

  /* Hide currency selector on mobile */
  #currency-selector {
    display: none !important;
  }

  /* Currency selector in mobile menu */
  .mobile-menu-currency-selector {
    margin: 0.5rem 1rem;
  }

  /* Smaller calculator headings on mobile */
  .calculator-container h1,
  .calculator-header h1 {
    font-size: 1.25rem !important; /* 20px instead of 30px (text-3xl) */
  }

  .calculator-container h1 + p,
  .calculator-header p {
    font-size: 0.8125rem !important; /* 13px instead of 16px (text-base) */
  }
}

/* Interactive Button Styles */
.btn-interactive {
  background: white;
  border: 1px solid rgb(229 231 235);
  border-radius: 1rem;
  padding: 1.25rem;
  text-decoration: none;
  color: rgb(17 24 39);
  transition: all 0.2s ease-in-out;
  display: block;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.dark .btn-interactive {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(17, 24, 39, 0.98) 100%);
  border-color: rgb(55 65 81);
  color: rgb(249 250 251);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Hover state with elevated shadow */
.btn-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: var(--color-primary);
}

.dark .btn-interactive:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  border-color: rgb(96 165 250);
}

/* Active/pressed state */
.btn-interactive:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.dark .btn-interactive:active {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Color accent stripe on hover */
.btn-interactive::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), #8b5cf6);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.btn-interactive:hover::before {
  opacity: 1;
}

/* Color theme modifiers */
.btn-interactive.theme-blue:hover {
  border-color: rgb(59 130 246);
}

.btn-interactive.theme-green:hover {
  border-color: rgb(34 197 94);
}

.btn-interactive.theme-purple:hover {
  border-color: rgb(168 85 247);
}

.btn-interactive.theme-orange:hover {
  border-color: rgb(251 146 60);
}

.btn-interactive.theme-red:hover {
  border-color: rgb(239 68 68);
}

.dark .btn-interactive.theme-blue:hover {
  border-color: rgb(96 165 250);
}

.dark .btn-interactive.theme-green:hover {
  border-color: rgb(74 222 128);
}

.dark .btn-interactive.theme-purple:hover {
  border-color: rgb(196 181 253);
}

.dark .btn-interactive.theme-orange:hover {
  border-color: rgb(252 211 77);
}

.dark .btn-interactive.theme-red:hover {
  border-color: rgb(248 113 113);
}

/* Footer Disclaimer Styles */
.footer-disclaimer {
  background: var(--color-background);
  border-top: 1px solid var(--color-border);
  padding: 1rem 0;
  margin-top: auto;
}

.footer-disclaimer-content {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-disclaimer-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-muted-foreground);
  margin-top: 0.125rem;
}

.footer-disclaimer-text {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-muted-foreground);
}

/* Responsive adjustments for footer disclaimer */
@media (min-width: 640px) {
  .footer-disclaimer-content {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .footer-disclaimer-content {
    padding: 0 2rem;
  }
}

/* Homepage Calculator Card Animations (from dashboard) */
#calculators-grid > a {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  animation: slideUp 0.6s ease-out;
}

/* Top gradient bar that slides in on hover */
#calculators-grid > a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), #8b5cf6);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  border-radius: 0.75rem 0.75rem 0 0;
}

.dark #calculators-grid > a::before {
  background: linear-gradient(90deg, var(--chart-1), var(--chart-5));
}

#calculators-grid > a:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark #calculators-grid > a:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

#calculators-grid > a:hover::before {
  transform: translateX(0);
}

/* Slide up animation keyframes */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for calculator cards */
#calculators-grid > :nth-child(1) { animation-delay: 0ms; }
#calculators-grid > :nth-child(2) { animation-delay: 75ms; }
#calculators-grid > :nth-child(3) { animation-delay: 150ms; }
#calculators-grid > :nth-child(4) { animation-delay: 225ms; }
#calculators-grid > :nth-child(5) { animation-delay: 300ms; }
#calculators-grid > :nth-child(6) { animation-delay: 375ms; }

/* Smooth scroll behavior for anchor links */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Account for sticky header */
}

/* Resource Card Hover Effects (opposite of calculator cards) */
.resource-card {
  transition: all 0.3s ease;
}

.resource-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.2), 0 6px 8px -5px rgba(0, 0, 0, 0.1);
  border-color: rgb(59 130 246);
}

.dark .resource-card:hover {
  box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.6), 0 6px 8px -5px rgba(0, 0, 0, 0.4);
  border-color: rgb(96 165 250);
}