/* Responsive Typography */
:root {
  /* Base font sizes */
  --font-size-xs: clamp(0.75rem, 1.8vw, 0.875rem);
  --font-size-sm: clamp(0.875rem, 2vw, 1rem);
  --font-size-base: clamp(1rem, 2.5vw, 1.125rem);
  --font-size-md: clamp(1.125rem, 3vw, 1.25rem);

  /* Heading sizes - responsive (reduced) */
  --font-size-h6: clamp(1rem, 2.5vw, 1.125rem);
  --font-size-h5: clamp(1.125rem, 3vw, 1.25rem);
  --font-size-h4: clamp(1.25rem, 3.5vw, 1.5rem);
  --font-size-h3: clamp(1.5rem, 4vw, 1.875rem);
  --font-size-h2: clamp(0.9375rem, 2.5vw, 1.125rem);
  --font-size-h1: clamp(1.5rem, 4vw, 2rem);

  /* Line heights */
  --line-height-base: 1.6;
  --line-height-heading: 1.2;
}

/* Container width - changed to 80% */
.container {
  max-width: 95% !important;
}

/* Ensure container-fluid also follows the 80% width */
.container-fluid {
  max-width: 95% !important;
}

/* Responsive adjustments for container on smaller screens */
@media (max-width: 768px) {

  .container,
  .container-fluid {
    max-width: 95% !important;
  }
}

@media (max-width: 576px) {

  .container,
  .container-fluid {
    max-width: 100% !important;
  }
}

/* Apply base font size */
body {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
}

/* Headings */
h1,
.h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-heading);
  margin-bottom: 1rem;
}

h2,
.h2 {
  font-size: var(--font-size-h2);
  line-height: var(--line-height-heading);
  margin-bottom: 0.875rem;
}

h3,
.h3 {
  font-size: var(--font-size-h3);
  line-height: var(--line-height-heading);
  margin-bottom: 0.75rem;
}

h4,
.h4 {
  font-size: var(--font-size-h4);
  line-height: var(--line-height-heading);
  margin-bottom: 0.625rem;
}

h5,
.h5 {
  font-size: var(--font-size-h5);
  line-height: var(--line-height-heading);
  margin-bottom: 0.5rem;
}

h6,
.h6 {
  font-size: var(--font-size-h6);
  line-height: var(--line-height-heading);
  margin-bottom: 0.5rem;
}

/* Paragraphs */
p {
  margin-bottom: 1rem;
}

/* Lead paragraph */
.lead {
  font-size: var(--font-size-md);
  font-weight: 400;
  line-height: 1.5;
}

/* Small text */
small,
.small {
  font-size: var(--font-size-sm);
}

/* Extra small text */
.xsmall {
  font-size: var(--font-size-xs);
}

/* Responsive adjustments for larger screens */
@media (min-width: 1200px) {
  :root {
    --font-size-xs: 0.875rem;
    --font-size-sm: 1rem;
    --font-size-base: 1.125rem;
    --font-size-md: 1.25rem;
    --font-size-h6: 1.25rem;
    --font-size-h5: 1.5rem;
    --font-size-h4: 1.875rem;
    --font-size-h3: 2.25rem;
    --font-size-h2: 1.5rem;
    --font-size-h1: 2.5rem;
  }
}

/* Logo styles */
.logo-text {
  font-size: 2rem;
  font-weight: 700;
  text-decoration: none !important;
}

.logo-calculator {
  color: #343a40;
  /* Darker grey */
}

.logo-byte {
  color: #0d6efd;
  /* Bootstrap primary blue */
}

.logo-text:hover .logo-calculator,
.logo-text:hover .logo-byte {
  opacity: 0.8;
}

/* Calculator page styles */
.calculator-content {
  line-height: 1.8;
  /* Increased line height */
}

.calculator-content h2 {
  font-size: var(--font-size-h2) !important;
  font-weight: 700;
  color: #212529;
  margin-top: 2rem;
  /* Added top spacing */
  margin-bottom: 1.5rem;
  /* Increased bottom spacing */
}

/* Footer styles */
footer {
  border-top: 1px solid #dee2e6;
}

footer h6 {
  color: #495057;
  font-size: 0.9rem;
}

footer ul li {
  margin-bottom: 0.5rem;
}

footer a:hover {
  color: #198754 !important;
  transition: color 0.3s ease;
}

footer svg:hover {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

/* Wide container adjustments */
.container-fluid {
  padding-left: 2rem;
  padding-right: 2rem;
}

@media (max-width: 768px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Mobile card adjustments */
  .category-card .icon-circle {
    width: 50px;
    height: 50px;
  }

  .calculator-card .calc-icon-wrapper {
    width: 40px;
    height: 40px;
  }

  .subcategory-card .mini-icon-circle {
    width: 35px;
    height: 35px;
  }

  /* Reduce hover effects on mobile */
  .hover-lift:hover {
    transform: translateY(-4px) scale(1.01);
  }
}

/* Enhanced Card Hover Effects */
.hover-lift {
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.hover-lift:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 1rem 2rem rgba(13, 110, 253, 0.15) !important;
}

/* Category Card Styles */
.category-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid rgba(13, 110, 253, 0.1) !important;
  border-radius: 16px !important;
  position: relative;
  overflow: hidden;
}

.category-card .blue-accent-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0d6efd, #6610f2);
}

.category-card .icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(13, 110, 253, 0.2);
}

.category-card .card-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-card:hover .card-gradient {
  opacity: 1;
}

.category-card:hover .icon-circle {
  background: rgba(13, 110, 253, 0.15) !important;
  transform: scale(1.1);
  transition: all 0.3s ease;
}

/* Subcategory Card Styles */
.subcategory-card {
  background: #ffffff;
  border: 1px solid rgba(13, 110, 253, 0.08) !important;
  border-radius: 12px !important;
  position: relative;
  overflow: hidden;
}

.subcategory-card .blue-border-left {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #0d6efd, #6610f2);
}

.subcategory-card .mini-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(13, 110, 253, 0.2);
}

.subcategory-card .hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.02), rgba(102, 16, 242, 0.02));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.subcategory-card:hover .hover-overlay {
  opacity: 1;
}

.subcategory-card:hover .mini-icon-circle {
  background: rgba(13, 110, 253, 0.2) !important;
  transform: scale(1.1);
  transition: all 0.3s ease;
}

/* Calculator Card Styles */
.calculator-card {
  background: #ffffff;
  border: 1px solid rgba(13, 110, 253, 0.12) !important;
  border-radius: 14px !important;
  position: relative;
  overflow: hidden;
}

.calculator-card .blue-accent-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 30px 30px 0;
  border-color: transparent rgba(13, 110, 253, 0.1) transparent transparent;
}

.calculator-card .calc-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0d6efd, #6610f2) !important;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.calculator-card .calc-bg-animation {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(13, 110, 253, 0.03), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.calculator-card:hover .calc-bg-animation {
  opacity: 1;
}

.calculator-card:hover .calc-icon-wrapper {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
  transition: all 0.3s ease;
}

.calculator-card:hover .blue-accent-corner {
  border-color: transparent rgba(13, 110, 253, 0.2) transparent transparent;
  transition: border-color 0.3s ease;
}

/* Background gradient for primary */
.bg-gradient-primary {
  background: linear-gradient(135deg, #0d6efd, #6610f2) !important;
}

/* Enhanced badge styles */
.badge.bg-primary.bg-opacity-20 {
  background: rgba(13, 110, 253, 0.1) !important;
  border: 1px solid rgba(13, 110, 253, 0.2);
  font-weight: 500;
}

/* Animation for card entrance */
@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-card,
.subcategory-card,
.calculator-card {
  animation: cardSlideUp 0.6s ease-out;
}

/* Staggered animation delay */
.category-card:nth-child(1) {
  animation-delay: 0.1s;
}

.category-card:nth-child(2) {
  animation-delay: 0.2s;
}

.category-card:nth-child(3) {
  animation-delay: 0.3s;
}

.category-card:nth-child(4) {
  animation-delay: 0.4s;
}

.category-card:nth-child(5) {
  animation-delay: 0.5s;
}

.category-card:nth-child(6) {
  animation-delay: 0.6s;
}

.category-card:nth-child(7) {
  animation-delay: 0.7s;
}

.category-card:nth-child(8) {
  animation-delay: 0.8s;
}

/* Pulse animation for calculator icons */
@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.calculator-card:hover .calc-icon-wrapper svg {
  animation: pulse 1.5s infinite;
}

/* Glow effect on hover */
.category-card:hover,
.subcategory-card:hover,
.calculator-card:hover {
  box-shadow: 0 1rem 2rem rgba(13, 110, 253, 0.15), 0 0 0 1px rgba(13, 110, 253, 0.1) !important;
}

/* Smooth transitions for all interactive elements */
.category-card *,
.subcategory-card *,
.calculator-card * {
  transition: all 0.3s ease;
}

/* Focus states for accessibility */
.category-card:focus-within,
.subcategory-card:focus-within,
.calculator-card:focus-within {
  outline: 2px solid rgba(13, 110, 253, 0.5);
  outline-offset: 2px;
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {

  .category-card,
  .subcategory-card,
  .calculator-card {
    background: #1a1a1a;
    border-color: rgba(13, 110, 253, 0.3) !important;
  }

  .category-card .card-title,
  .subcategory-card .card-title,
  .calculator-card .card-title {
    color: #ffffff !important;
  }
}

/* Related Calculator Links */
.hover-bg-light {
  transition: background-color 0.2s ease;
}

.hover-bg-light:hover {
  background-color: rgba(13, 110, 253, 0.05) !important;
  border-radius: 6px;
}

.hover-bg-light:hover svg {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

.hover-bg-light:hover span {
  color: #0d6efd !important;
  transition: color 0.2s ease;
}

/* Related Calculators Section - SEO Link Style */
.related-calculators-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 2rem;
  border-left: 3px solid #0d6efd;
}

.related-calc-list a {
  color: #0d6efd;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.related-calc-list a:hover {
  color: #0a58ca;
  text-decoration: underline;
}

/* Improve readability on mobile */
@media (max-width: 767.98px) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  h1,
  .h1 {
    letter-spacing: -0.02em;
  }

  p {
    letter-spacing: 0.01em;
  }
}

/* Simple blue button design for all cards */
.big-green-button {
  --background: #275efe;
  --shadow: rgba(10, 22, 50, .24);
  display: block !important;
  width: 100% !important;
  background: var(--background) !important;
  color: white !important;
  text-decoration: none !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 1.25rem 1rem !important;
  text-align: center !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px -1px var(--shadow) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  position: relative !important;
  overflow: hidden !important;
  min-height: 60px !important;
}

.big-green-button:hover {
  background: #1c4ed8 !important;
  color: white !important;
  text-decoration: none !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px -1px var(--shadow) !important;
}

.big-green-button:active {
  transform: scale(0.95) !important;
  box-shadow: 0 1px 4px -1px var(--shadow) !important;
}

.big-green-button:focus {
  outline: none !important;
  box-shadow: 0 2px 8px -1px var(--shadow), 0 0 0 3px rgba(39, 94, 254, 0.2) !important;
}

/* Responsive styles for blue buttons */
@media (max-width: 768px) {
  .big-green-button {
    padding: 1rem 0.75rem !important;
    font-size: 0.9rem !important;
    border-radius: 6px !important;
    min-height: 50px !important;
  }
}

@media (max-width: 480px) {
  .big-green-button {
    padding: 0.875rem 0.5rem !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    min-height: 45px !important;
  }
}

/* Navigation Search Trigger */
.nav-search-trigger {
  display: flex;
  align-items: center;
  width: 280px;
  max-width: 100%;
  height: 42px;
  padding: 0 1rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-search-trigger:hover,
.nav-search-trigger:focus {
  background: white;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
  transform: translateY(-1px);
}

.nav-search-trigger span.text-muted {
  font-size: 0.9rem;
}

.nav-search-trigger .badge {
  font-weight: 500;
  color: #adb5bd !important;
}

/* Mobile Adjustments for Nav Search */
@media (max-width: 991px) {
  .nav-search-trigger {
    width: 100%;
    margin-top: 1rem;
  }
}


/* Category card specific styles */
.category-button-card {
  --background: #0d6efd;
  --rectangle: #0b5ed7;
  --shadow: rgba(13, 110, 253, 0.24);
}

/* Subcategory card specific styles */
.subcategory-button-card {
  --background: #6610f2;
  --rectangle: #5a0fc8;
  --shadow: rgba(102, 16, 242, 0.24);
}

/* Calculator card specific styles */
.calculator-button-card {
  --background: #0dcaf0;
  --rectangle: #0aa2c0;
  --shadow: rgba(13, 202, 240, 0.24);
}

/* Icon styling for button cards */
.button-card .card-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  backdrop-filter: blur(10px);
}

.button-card .card-icon svg {
  color: var(--text);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Text styling */
.button-card .card-title {
  color: #212529;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.button-card .card-text {
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.4;
}

.button-card .badge {
  background: var(--background) !important;
  color: var(--text) !important;
  font-weight: 500;
}

/* Mac window header */
.mac-header {
  background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  min-height: 32px;
}

/* Mac window buttons */
.mac-buttons {
  min-width: 60px;
}

.mac-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
}

.mac-close {
  background: linear-gradient(145deg, #ff5f57 0%, #ff4136 100%);
}

.mac-minimize {
  background: linear-gradient(145deg, #ffbd2e 0%, #ff9500 100%);
}

.mac-maximize {
  background: linear-gradient(145deg, #28ca42 0%, #00b894 100%);
}

.mac-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mac-card:hover .mac-button::after {
  opacity: 1;
}

/* Mac title bar */
.mac-title {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Mac content area */
.mac-content {
  background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%);
  position: relative;
}

/* Mac icon styling */
.mac-icon .icon-wrapper {
  width: 48px;
  height: 48px;
  background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Mac stats styling */
.mac-stats .stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}

/* Mac shine effect */
.mac-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.4) 50%,
      transparent 100%);
  transition: left 0.6s ease;
  pointer-events: none;
}

.mac-card:hover .mac-shine {
  left: 100%;
}

/* Mac card text improvements */
.mac-card .card-title {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.mac-card .text-muted {
  color: #6c757d !important;
  line-height: 1.4;
}

/* Responsive adjustments for button cards */
@media (max-width: 768px) {
  .button-card {
    border-radius: 6px;
  }

  .button-card .card-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  .button-card .card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
  }

  .button-card .card-icon svg {
    width: 16px;
    height: 16px;
  }

  .button-card .card-title {
    font-size: 0.875rem;
  }

  .button-card .card-text {
    font-size: 0.75rem;
  }
}

/* Animation for button cards */
@keyframes buttonPulse {
  0% {
    box-shadow: 0 2px 8px -1px var(--shadow);
  }

  50% {
    box-shadow: 0 4px 16px -1px var(--shadow);
  }

  100% {
    box-shadow: 0 2px 8px -1px var(--shadow);
  }
}

.button-card:focus {
  animation: buttonPulse 0.6s ease-in-out;
  outline: none;
}

/* Popular calculator cards */
.popular-calc-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.popular-calc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.popular-calc-icon {
  width: 40px;
  height: 40px;
}

.popular-calc-card a {
  color: inherit;
  text-decoration: none;
}

.popular-calc-card a:hover {
  color: inherit;
  text-decoration: none;
}

/* Category page icon */
.category-icon-large {
  width: 80px;
  height: 80px;
}

/* List-style layouts for subcategories and calculators */
.subcategory-list,
.calculator-list {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.subcategory-list-item,
.calculator-list-item {
  border-bottom: 1px solid #f0f0f0;
}

.subcategory-list-item:last-child,
.calculator-list-item:last-child {
  border-bottom: none;
}

.subcategory-link,
.calculator-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.subcategory-link:hover,
.calculator-link:hover {
  background-color: #f8f9fa;
  color: inherit;
  text-decoration: none;
}

.subcategory-info,
.calculator-info {
  flex: 1;
  text-align: left;
}

.subcategory-title,
.calculator-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.subcategory-description,
.calculator-description {
  font-size: 0.9rem;
  color: #666;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.subcategory-count {
  font-size: 0.8rem;
  color: #275efe;
  font-weight: 500;
}

.calculator-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.calculator-tags .tag {
  background: #e3f2fd;
  color: #1976d2;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.subcategory-arrow,
.calculator-arrow {
  color: #275efe;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.subcategory-link:hover .subcategory-arrow,
.calculator-link:hover .calculator-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* Grid layouts for subcategories and calculators */
.subcategory-grid,
.calculator-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

/* 3-column layout for PC */
@media (min-width: 992px) {

  .subcategory-grid,
  .calculator-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* 2-column layout for tablets */
@media (min-width: 768px) and (max-width: 991px) {

  .subcategory-grid,
  .calculator-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

.subcategory-grid-item,
.calculator-grid-item {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.subcategory-grid-item:hover,
.calculator-grid-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.subcategory-card-link,
.calculator-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
  min-height: 80px;
}

.subcategory-card-link:hover,
.calculator-card-link:hover {
  color: inherit;
  text-decoration: none;
}

.subcategory-card-content,
.calculator-card-content {
  flex: 1;
  text-align: left;
}

.subcategory-card-title,
.calculator-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.subcategory-card-count {
  font-size: 0.8rem;
  color: #275efe;
  font-weight: 500;
}

.subcategory-card-arrow,
.calculator-card-arrow {
  color: #275efe;
  opacity: 0.7;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.subcategory-card-link:hover .subcategory-card-arrow,
.calculator-card-link:hover .calculator-card-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* Responsive adjustments for grid layouts */
@media (max-width: 767px) {

  .subcategory-card-link,
  .calculator-card-link {
    padding: 1rem;
    min-height: 70px;
  }

  .subcategory-card-title,
  .calculator-card-title {
    font-size: 0.9rem;
  }

  .subcategory-card-count {
    font-size: 0.75rem;
  }
}

/* Related Calculators Enhancements */
.related-calculators .related-calculator-item {
  transition: all 0.2s ease;
}

.related-calculators .related-calculator-item:hover {
  transform: translateX(2px);
}

.related-calculators .related-calculator-item a {
  transition: all 0.2s ease;
  border-radius: 6px;
}

.related-calculators .related-calculator-item:hover a {
  background-color: #f8f9fa;
}

.related-calculators .related-calculator-item:hover .text-muted {
  color: #0d6efd !important;
}

/* Pagination Styles */
.pagination-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}

.pagination-info {
  color: #6c757d;
  font-size: 0.875rem;
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-item {
  display: flex;
}

.pagination-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  min-width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background-color: #fff;
  color: #495057;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  justify-content: center;
  cursor: pointer;
}

.pagination-link:hover {
  background-color: #f8f9fa;
  border-color: #adb5bd;
  color: #212529;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-link:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
  z-index: 1;
}

.pagination-current {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
  font-weight: 600;
}

.pagination-current:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
  color: #fff;
  transform: none;
}

.pagination-disabled .pagination-link {
  background-color: #f8f9fa;
  border-color: #dee2e6;
  color: #adb5bd;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-ellipsis .pagination-link {
  border: none;
  background: none;
  color: #6c757d;
  cursor: default;
  pointer-events: none;
}

.pagination-prev,
.pagination-next {
  font-weight: 500;
}

.pagination-prev svg,
.pagination-next svg {
  width: 14px;
  height: 14px;
}

/* Responsive pagination */
@media (max-width: 768px) {
  .pagination-wrapper {
    gap: 0.75rem;
    margin: 1.5rem 0;
  }

  .pagination {
    gap: 0.125rem;
  }

  .pagination-link {
    padding: 0.375rem 0.5rem;
    min-width: 2.25rem;
    height: 2.25rem;
    font-size: 0.8125rem;
  }

  .pagination-prev .pagination-text,
  .pagination-next .pagination-text {
    display: none;
  }

  .pagination-prev,
  .pagination-next {
    padding: 0.375rem;
    min-width: 2.25rem;
  }
}

@media (max-width: 480px) {
  .pagination {
    gap: 0.0625rem;
  }

  .pagination-link {
    padding: 0.25rem 0.375rem;
    min-width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
    border-radius: 4px;
  }

  .pagination-prev,
  .pagination-next {
    padding: 0.25rem;
    min-width: 2rem;
  }

  .pagination-info {
    font-size: 0.8125rem;
  }
}

/* Smooth animations for related calculator arrows */
.related-calculators svg {
  transition: all 0.2s ease;
}

.related-calculators .related-calculator-item:hover svg {
  transform: translateX(3px);
}

/* Mobile paragraph layout for related calculators */
.related-calculators-mobile a {
  transition: all 0.2s ease;
  display: inline;
  padding: 2px 4px;
  border-radius: 4px;
}

.related-calculators-mobile a:hover {
  background-color: #e7f3ff;
  text-decoration: none !important;
}

/* Hover background utility */
.hover-bg-light:hover {
  background-color: #f8f9fa !important;
}

/* Breadcrumb Enhancements */
.breadcrumb {
  background-color: #f8f9fa !important;
  border: 1px solid #e9ecef;
  font-size: 0.875rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.breadcrumb-item+.breadcrumb-item::before {
  content: "›";
  color: #6c757d;
  font-weight: bold;
  font-size: 1rem;
}

.breadcrumb-item a {
  color: #0d6efd;
  transition: color 0.2s ease;
  font-weight: 500;
}

.breadcrumb-item a:hover {
  color: #0a58ca;
  text-decoration: underline !important;
}

.breadcrumb-item.active {
  color: #6c757d;
  font-weight: 600;
}

.breadcrumb-item svg {
  vertical-align: baseline;
  margin-bottom: 1px;
}

/* Responsive breadcrumb adjustments */
@media (max-width: 768px) {
  .breadcrumb {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }

  .breadcrumb-item svg {
    width: 12px;
    height: 12px;
  }
}

/* ========================================
   SEARCH STYLES - Pagefind Integration
   ======================================== */

/* Navbar Search Button */
.nav-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-search-btn:hover {
  background: #0d6efd;
  color: white;
  transform: scale(1.02);
}

.nav-search-btn svg {
  flex-shrink: 0;
}

/* Hero Search Container */
.hero-search-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding: 0 1rem;
}

.hero-search-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  border: 2px solid #e9ecef;
  border-radius: 16px;
  padding: 1.25rem 1.75rem;
  width: 100%;
  max-width: 700px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.hero-search-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.03), rgba(102, 16, 242, 0.03));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-search-wrapper:hover {
  border-color: #0d6efd;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(13, 110, 253, 0.15);
}

.hero-search-wrapper:hover::before {
  opacity: 1;
}

.hero-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.hero-search-icon svg {
  color: white;
}

.hero-search-placeholder {
  flex-grow: 1;
  font-size: 1.125rem;
  color: #6c757d;
  font-weight: 400;
  text-align: left;
}

.hero-search-shortcut {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hero-search-shortcut kbd {
  display: inline-block;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-family: inherit;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  color: #495057;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hero-search-shortcut span {
  color: #adb5bd;
  font-size: 0.75rem;
}

/* Search Modal Overlay */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200000;
  /* Extremely high z-index to ensure it covers everything including navbar */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.search-modal-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0 1rem;
  animation: searchModalSlideDown 0.2s ease-out;
}

@keyframes searchModalSlideDown {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.search-modal-input-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-modal-icon {
  color: #6c757d;
  flex-shrink: 0;
}

.search-modal-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1.125rem;
  color: #212529;
  outline: none;
}

.search-modal-input::placeholder {
  color: #adb5bd;
}

.search-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.search-modal-close:hover {
  background: #dee2e6;
  color: #dc3545;
}

.search-modal-close svg {
  color: #6c757d;
}

.search-modal-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

/* Search States */
.search-initial-state,
.search-loading,
.search-no-results,
.search-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: #6c757d;
}

.search-initial-state svg,
.search-no-results svg {
  margin-bottom: 1rem;
  color: #adb5bd;
}

.search-initial-state p,
.search-no-results p {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.search-no-results span {
  font-size: 0.875rem;
  color: #adb5bd;
}

/* Search Spinner */
.search-loading {
  padding: 2rem;
}

.search-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e9ecef;
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: searchSpin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes searchSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Search Results List */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.search-result-item:hover {
  background: #f8f9fa;
  border-color: #e9ecef;
  transform: translateX(4px);
}

.search-result-item:focus {
  outline: none;
  background: rgba(13, 110, 253, 0.05);
  border-color: #0d6efd;
}

.search-result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

.search-result-icon svg {
  color: white;
}

.search-result-content {
  flex-grow: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-excerpt {
  font-size: 0.875rem;
  color: #6c757d;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-excerpt mark {
  background: rgba(13, 110, 253, 0.15);
  color: #0d6efd;
  padding: 0 2px;
  border-radius: 2px;
}

.search-result-arrow {
  color: #adb5bd;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.search-result-item:hover .search-result-arrow {
  color: #0d6efd;
  transform: translateX(4px);
}

/* More Results */
.search-more-results {
  text-align: center;
  padding: 1rem;
  font-size: 0.875rem;
  color: #6c757d;
  border-top: 1px solid #e9ecef;
  margin-top: 0.5rem;
}

/* Search Modal Footer */
.search-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  font-size: 0.75rem;
  color: #6c757d;
}

.search-shortcuts {
  display: flex;
  gap: 1rem;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shortcut-item kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-family: inherit;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  color: #495057;
}

.search-powered {
  color: #adb5bd;
}

/* Responsive Search Styles */
@media (max-width: 768px) {
  .hero-search-wrapper {
    padding: 1rem 1.25rem;
    border-radius: 12px;
  }

  .hero-search-icon {
    width: 40px;
    height: 40px;
  }

  .hero-search-icon svg {
    width: 20px;
    height: 20px;
  }

  .hero-search-placeholder {
    font-size: 1rem;
  }

  .hero-search-shortcut {
    display: none;
  }

  .search-modal {
    padding: 0;
    align-items: flex-start;
  }

  .search-modal-container {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    max-width: 100%;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  .search-modal-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
  }

  .search-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
  }

  .search-modal-footer {
    padding: 0.75rem 1rem;
    background: white;
    border-top: 1px solid #e9ecef;
  }

  .search-shortcuts {
    display: none;
  }

  .search-powered {
    text-align: center;
    width: 100%;
  }

  .search-result-item {
    padding: 0.75rem;
  }

  .search-result-icon {
    width: 36px;
    height: 36px;
  }

  .search-result-title {
    font-size: 0.9rem;
  }

  .search-result-excerpt {
    font-size: 0.8rem;
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 480px) {
  .hero-search-wrapper {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
  }

  .hero-search-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .hero-search-placeholder {
    font-size: 0.9rem;
  }
}

/* ========================================
   HOMEPAGE LAYOUT STYLES
   ======================================== */

/* Homepage Hero */
.homepage-hero {
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
  padding: 2rem 0;
}

/* Large Hero Search */
.hero-search-large {
  padding: 1.5rem 2rem !important;
  border-radius: 20px !important;
  border-width: 2px !important;
  max-width: 100% !important;
}

.hero-search-large .hero-search-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.hero-search-large .hero-search-icon svg {
  width: 28px;
  height: 28px;
}

.hero-search-large .hero-search-placeholder {
  font-size: 1.25rem;
  font-weight: 500;
  color: #495057;
}

.hero-search-large:hover {
  box-shadow: 0 12px 40px rgba(13, 110, 253, 0.2);
}

/* Section Titles */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 0;
}

/* Categories Section */
.categories-section {
  background: #ffffff;
}

/* Popular Section */
.popular-section {
  background: #f8f9fa;
}

/* Popular Calculator Card Icon */
.popular-calc-icon {
  width: 44px;
  height: 44px;
}

/* Popular Calculator Card Hover */
.popular-calc-card {
  transition: all 0.3s ease;
}

.popular-calc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .homepage-hero {
    padding: 1.5rem 0;
  }

  .hero-search-large {
    padding: 1rem 1.25rem !important;
  }

  .hero-search-large .hero-search-icon {
    width: 44px;
    height: 44px;
  }

  .hero-search-large .hero-search-placeholder {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .hero-search-large {
    padding: 0.875rem 1rem !important;
  }

  .hero-search-large .hero-search-icon {
    width: 40px;
    height: 40px;
  }

  .hero-search-large .hero-search-placeholder {
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1rem;
  }
}

/* ========================================
   TRENDING SECTION STYLES
   ======================================== */

.trending-section {
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

/* Trending Header */
.trending-icon-wrapper {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.trending-icon-wrapper svg {
  color: white;
}

.trending-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Trending Card */
.trending-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.trending-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0d6efd, #6610f2);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.trending-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(13, 110, 253, 0.12);
  border-color: rgba(13, 110, 253, 0.15);
}

.trending-card:hover::before {
  opacity: 1;
}

/* Rank Badge */
.trending-rank {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

/* Special styling for top 3 */
.trending-card:nth-child(1) .trending-rank,
.trending-card:nth-child(2) .trending-rank,
.trending-card:nth-child(3) .trending-rank {
  background: linear-gradient(135deg, #0a58ca, #0d6efd);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

/* Trending Content */
.trending-content {
  flex-grow: 1;
  min-width: 0;
}

.trending-title {
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.375rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trending-excerpt {
  font-size: 0.8375rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trending-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trending-category {
  font-size: 0.75rem;
  color: #0d6efd;
  font-weight: 500;
  background: rgba(13, 110, 253, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
}

.trending-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f8f9fa;
  border-radius: 8px;
  color: #6c757d;
  transition: all 0.3s ease;
}

.trending-card:hover .trending-arrow {
  background: #0d6efd;
  color: white;
  transform: translateX(4px);
}

/* Responsive Trending */
@media (max-width: 768px) {
  .trending-icon-wrapper {
    width: 36px;
    height: 36px;
  }

  .trending-icon-wrapper svg {
    width: 16px;
    height: 16px;
  }

  .trending-badge {
    font-size: 0.65rem;
    padding: 4px 12px;
  }

  .trending-card {
    padding: 1rem;
    gap: 0.875rem;
  }

  .trending-rank {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .trending-title {
    font-size: 0.9rem;
  }

  .trending-excerpt {
    font-size: 0.8rem;
  }

  .trending-arrow {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .trending-card {
    padding: 0.875rem;
  }

  .trending-rank {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .trending-title {
    font-size: 0.85rem;
  }

  .trending-excerpt {
    display: none;
  }
}