/* =========================================================
   CalculatorFox Calculator Overrides
   Restores exact look of original inline calculator styling
   ========================================================= */

/* === Align top of sidebar (aside) with main calculator card === */
.wrap {
  align-items: flex-start; /* ensure columns align at the top */
}

/* Remove unintended extra top margin on sidebar ads */
.wrap > aside {
  margin-top: 0;
  padding-top: 0;
}

/* Adjust top spacing consistency */
.wrap > aside .ad-space:first-of-type {
  margin-top: 0 !important; /* ensures top ad aligns perfectly with card top */
}

/* Panels and info sections — restore deeper shadow */
.panel,
.info-section,
.related-box {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1) !important;
  background: var(--panel) !important;
  border-radius: var(--radius) !important;
  padding: 30px !important;
}

/* Paragraph text and lists — return to darker, higher-contrast color */
.info-section p,
.info-section ul,
.related-box p,
.related-box ul {
  color: #111827 !important;
}

/* Restore previous button and KPI "lift" intensity */
.btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
}
.kpi:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-3px) !important;
}

/* Ensure headings inside calculator match original sizes */
h2 {
  font-size: 26px !important;
  margin-bottom: 12px !important;
}
h3 {
  font-size: 20px !important;
  margin-top: 30px !important;
}

/* Ad spaces stay compact like before */
.ad-space {
  height: 250px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f1f5f9 !important;
  color: var(--muted) !important;
  font-size: 14px !important;
}

/* Footer spacing and color as originally defined */
footer {
  text-align: center !important;
  color: var(--muted) !important;
  font-size: 14px !important;
  margin-top: 40px !important;
  padding: 20px 0 !important;
  border-top: 1px solid #e2e8f0 !important;
}

/* Restore vertical spacing between ad spaces and other elements */
.ad-space {
  margin-top: 20px !important;
  margin-bottom: 20px !important;
}

/* Ensure consistent spacing between stacked ad sections */
aside .ad-space + .ad-space {
  margin-top: 25px !important;
}

/* Add gentle spacing between last ad and related box */
aside .ad-space:last-of-type {
  margin-bottom: 25px !important;
}

/* Tighten spacing above the Related Calculators heading */
.related-box h3 {
  margin-top: 6px !important;
  margin-bottom: 10px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding-bottom: 8px !important;
}

/* Add spacing between main calculator panel and the about/info section */
.panel + .info-section {
  margin-top: 30px !important;
}

/* === Match dropdown style to input fields === */
.dropdown-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  margin-bottom: 16px; /* same spacing as input fields */
}

.dropdown-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.dropdown-wrapper select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.dropdown-wrapper select:hover {
  border-color: var(--accent-light);
}

.dropdown-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  stroke: var(--accent);
  transition: stroke 0.2s ease;
}

.dropdown-wrapper select:hover + .dropdown-icon {
  stroke: var(--accent-light);
}

/* --- Mobile Layout Adjustments --- */
@media (max-width: 768px) {
  .wrap {
    display: flex;
    flex-direction: column;
  }

  /* Ensure the first ad space appears above main content */
  aside .ad-space:first-of-type {
    order: -1;
    margin-bottom: 1rem;
  }

  /* Optional: make ads full width */
  aside .ad-space {
    width: 100%;
  }
}

/* =========================================================
   ✅ MOBILE-ONLY CENTERING FIX (new)
   Centers Ads + Related Calculators on phones
   ========================================================= */
@media (max-width: 768px) {
  .wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .wrap > aside,
  .ad-space,
  .related-box {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
