/* ========================================
   Tab Button Styles
   ======================================== */
.tab-btn {
  background-color: #f5f5f5;
  color: #525252;
}
.tab-btn:hover {
  background-color: #e5e5e5;
  color: #171717;
}
.tab-btn.active {
  background-color: #2563eb;
  color: white;
}

/* ========================================
   Bottom Navigation Styles (Mobile)
   ======================================== */
.mpg-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: white;
  border-top: 1px solid #f5f5f5;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 50;
  transition: transform 0.3s ease;
}

/* Hide on desktop */
@media (min-width: 768px) {
  .mpg-bottom-nav {
    display: none;
  }
}

/* On desktop (lg+), show guide tab content normally within two-column layout */
@media (min-width: 1024px) {
  /* Hide the mobile calculator tab on desktop */
  #calculator-tab {
    display: none !important;
  }

  /* Guide tab content inside desktop column should be visible */
  .desktop-guide-column .mobile-tab-content {
    display: block !important;
  }
}

.mpg-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #a3a3a3;
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mpg-bottom-nav-item.active {
  color: #2563eb;
}

.mpg-bottom-nav-item.active .nav-icon-bg {
  background-color: #eff6ff;
}

.nav-icon-bg {
  width: 64px;
  height: 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.mpg-bottom-nav-item i {
  font-size: 24px;
}

.mpg-bottom-nav-item span {
  font-size: 12px;
  font-weight: 500;
}

/* ========================================
   Tab Content
   ======================================== */
.mobile-tab-content {
  display: none;
}

.mobile-tab-content.active {
  display: block;
}

/* Add padding bottom on mobile to prevent content being hidden by nav */
@media (max-width: 767px) {
  body {
    padding-bottom: 64px;
  }

  /* Hide site-wide footer on mobile - custom bottom nav replaces it */
  #mw-footer {
    display: none;
  }
}

/* ========================================
   Background Styling
   ======================================== */
body {
  background-color: #fafafa; /* bg-neutral-50 */
}

/* Mobile keeps blue gradient */
@media (max-width: 767px) {
  body {
    background: linear-gradient(180deg, #EFF6FF 0%, #EFF6FF 60%, #FFFFFF 100%);
  }
}

/* ========================================
   Smooth Tab Transitions
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Horizontal Scroll Tab Strip (Mobile)
   ======================================== */
@media (max-width: 1023px) {
  .tab-strip {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .tab-strip::-webkit-scrollbar {
    display: none;
  }
  .tab-strip .tab-btn {
    flex-shrink: 0;
    scroll-snap-align: start;
    white-space: nowrap;
  }
}

/* Direction-aware slide + result slide-up animations now in tools.css */

/* ========================================
   Desktop Layout
   ======================================== */
@media (min-width: 1024px) {
  .desktop-calculator-fullwidth {
    margin-bottom: 2rem;
  }

  /* Guide content takes full width on desktop (no results column needed) */
  .desktop-two-col {
    display: block;
  }

  .desktop-guide-column {
    min-width: 0;
  }
}

/* ========================================
   Featured Card Styling
   ======================================== */
.featured-card {
  position: relative;
}

.featured-card::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  width: calc(100% - 16px);
  height: 100%;
  background-color: rgba(16, 185, 129, 0.08);
  border-radius: 1rem;
  transform: rotate(0.5deg);
  z-index: -1;
}

/* ========================================
   Info Card Grid for Desktop
   ======================================== */
@media (min-width: 1024px) {
  .info-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

/* Compact info card styling */
.info-card-compact {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.info-card-compact .card-content {
  flex: 1;
}

/* ========================================
   Sidebar Styles (Guides page pattern)
   ======================================== */

/* Sidebar mobile collapse */
#mpg-sidebar-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#mpg-sidebar-content.expanded {
  max-height: 800px;
}

@media (min-width: 1024px) {
  #mpg-sidebar-content {
    max-height: none;
    overflow: visible;
  }
}

/* Sticky sidebar on desktop */
@media (min-width: 1024px) {
  .mpg-sidebar {
    position: sticky;
    top: 6rem;
    align-self: start;
  }
}

/* Jump button active state */
.jump-btn.active {
  box-shadow: 0 0 0 2px rgb(59 130 246 / 0.3);
}

/* ========================================
   Mobile Adjustments
   ======================================== */
@media (max-width: 640px) {
  .hero-title {
    font-size: 28px !important;
  }
}

/* Desktop dashboard — minimal CSS only for what Tailwind can't do */
.gauge-arc-fill { transition: stroke-dashoffset 0.1s linear; }
#gauge-grad-start, #gauge-grad-mid, #gauge-grad-end { transition: stop-color 0.5s ease; }
@keyframes gaugePulse { 0% { opacity: 1; } 30% { opacity: 0.5; } 100% { opacity: 1; } }
.gauge-text-pulse { animation: gaugePulse 0.35s ease-out; }
.db-bar-fill { transition: width 0.8s cubic-bezier(0.22,1,0.36,1); }
.bento-num::-webkit-outer-spin-button,
.bento-num::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.bento-num { -moz-appearance: textfield; appearance: textfield; }
@keyframes dbFadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
.db-fade { opacity:0; }
.db-fade.visible { animation: dbFadeUp 0.5s ease-out forwards; }
.db-fade.d1 { animation-delay:.1s; }
.db-fade.d2 { animation-delay:.2s; }
.db-fade.d3 { animation-delay:.3s; }
.cc-winner-cell { background: rgba(16,185,129,0.06); box-shadow: inset 0 0 0 1px rgba(16,185,129,0.15); border-radius: 0.5rem; }
.cc-bar-fill { transition: width 0.8s cubic-bezier(0.22,1,0.36,1); }

/* Compare: winner trophy pulse */
.winner-pulse { animation: pulse-ring 2s ease-out infinite; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.3); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
/* Compare: butterfly bar animation */
.metric-bar { transition: width 1s cubic-bezier(0.22,1,0.36,1); }

/* Bento card focus-within ring */
#desktop-bento-grid .bg-white:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* Tab keyboard focus outline */
.tab-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
