/* =============================================
   COMPONENTS.CSS — Tool cards, calculator widget
   ============================================= */

/* ---- Tool Cards ---- */
.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--color-primary);
}

/* Make anchor-based cards reset link defaults */
a.tool-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.tool-card__icon {
  font-size: 32px;
  line-height: 1;
}

.tool-card img {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
}

.tool-card__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.tool-card__desc {
  font-size: 14px;
  color: var(--color-text-muted);
  flex: 1;
  line-height: 1.55;
}

.tool-card__link {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  margin-top: auto;
}

/* CTA label on live tool cards */
.tool-card__cta {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 14px;
  margin-top: auto;
}

/* Coming soon: dim + disable hover */
.tool-card--coming-soon {
  opacity: 0.6;
  cursor: default;
}

.tool-card--coming-soon:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: var(--color-border);
}

/* ---- Tool Grid ---- */
.tools-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Calculator Widget ---- */
.calc-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Tabs ---- */
.calc-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: #F8FAFC;
}

.calc-tab {
  flex: 1;
  padding: 16px 12px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  display: block;
}

.calc-tab:hover {
  color: var(--color-text);
  background: #F1F5F9;
}

.calc-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: #FFFFFF;
}

/* ---- Tab Panels ---- */
.calc-panels {
  padding: 12px 14px;
  min-height: 320px;
}

.calc-panel {
  display: none;
}

.calc-panel--active {
  display: block;
}

/* ---- Form Rows ---- */
.calc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.calc-row--single {
  grid-template-columns: 1fr;
}

.calc-row--center {
  display: flex;
  justify-content: center;
}

/* On mobile collapse most rows to single column, EXCEPT distance rows */
@media (max-width: 480px) {
  .calc-row:not(.calc-row--distance) {
    grid-template-columns: 1fr;
  }
}

/* ---- Labels & Inputs ---- */
label {
  display: grid;
  gap: 4px;
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Event preset: wider select */
.calc-row--center label {
  width: 100%;
  max-width: 240px;
}

/* ---- Result ---- */
.calc-result {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border: 1px solid #86EFAC;
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
}

.calc-result__label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-result__value {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-primary);
  margin-top: 2px;
  line-height: 1.2;
}

/* ---- Action Buttons ---- */
.calc-actions {
  display: flex;
  gap: 8px;
  padding: 4px 14px 14px; /* align with calc-panels padding */
}

.btn-primary {
  flex: 1;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  flex: 1;
  background: transparent;
  color: var(--color-text-muted);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}

.btn-secondary:hover {
  border-color: var(--color-text-muted);
}

/* ---- Error ---- */
.calc-error {
  color: #DC2626;
  font-size: 14px;
  padding: 0 18px 12px;
  min-height: 0;
}

/* ---- SEO Block ---- */
.seo-block {
  max-width: 680px;
  margin: 48px auto;
  padding: 0 16px;
}

.seo-block h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text);
  margin-top: 48px;
  margin-bottom: 16px;
}

.seo-block h2:first-child {
  margin-top: 0;
}

.seo-block p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.seo-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin-bottom: 24px;
}

.seo-block th {
  background: #F8FAFC;
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--color-text);
}

.seo-block td {
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  color: var(--color-text-muted);
}

.seo-block tr:nth-child(even) td {
  background: #FAFAFA;
}

/* ---- Section Divider ---- */
.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 48px 0 32px;
}

/* ---- CM Performance Coaching CTA ---- */
.cta-coaching {
  max-width: 560px;
  margin: 24px auto 0;
  padding: 0 16px;
}

.cta-coaching__inner {
  background: #F0FDF4;
  border-left: 4px solid var(--color-primary);
  border-radius: 10px;
  padding: 20px 24px;
}

.cta-coaching__heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.cta-coaching__body {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.cta-coaching__btn {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  transition: background 0.15s;
}

.cta-coaching__btn:hover {
  background: var(--color-primary-hover);
}

/* ---- Accordion / Collapsible Sections ---- */
.accordion {
  margin-bottom: 4px;
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 14px 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: color 0.15s;
}

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

.accordion__trigger[aria-expanded="true"] {
  color: var(--color-primary);
}

.accordion__icon {
  font-size: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.accordion__trigger[aria-expanded="true"] .accordion__icon {
  transform: rotate(90deg);
}

.accordion__body {
  padding-bottom: 16px;
}

.accordion__body[hidden] {
  display: none;
}

/* ---- Related Tools ---- */
.related-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.related-tools a {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.related-tools a:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.1);
  color: var(--color-primary);
}

/* =============================================
   HOMEPAGE COMPONENTS
   ============================================= */

/* ---- Hero Inline Calculator ---- */
.hero-calc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-calc__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-calc__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.hero-calc__select,
.hero-calc__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hero-calc__select:focus,
.hero-calc__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.hero-calc__custom-inner {
  display: flex;
  gap: 8px;
}

.hero-calc__unit-select {
  width: auto;
  flex-shrink: 0;
}

.hero-calc__time {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-calc__time-input {
  flex: 1;
  text-align: center;
  min-width: 0;
  padding: 10px 6px;
}

/* Remove number spinners in hero calc */
.hero-calc__time-input::-webkit-inner-spin-button,
.hero-calc__time-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.hero-calc__time-input {
  -moz-appearance: textfield;
}

.hero-calc__colon {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.hero-calc__btn {
  width: 100%;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
}

.hero-calc__btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.hero-calc__btn:active {
  transform: translateY(0);
}

.hero-calc__result {
  display: flex;
  gap: 12px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 12px;
  padding: 16px;
}

.hero-calc__result-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-calc__result-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-calc__result-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
}

.hero-calc__error {
  font-size: 13px;
  color: #DC2626;
  font-weight: 500;
  min-height: 0;
}

/* ---- Badge: Coming Soon ---- */
.badge-soon {
  display: inline-block;
  background: var(--color-highlight);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  margin-top: auto;
  align-self: flex-start;
  text-transform: uppercase;
}

/* ---- Tool card with SVG icon ---- */
.tools-section .tool-card img {
  display: block;
  margin-bottom: 4px;
}

/* ---- Why Items ---- */
.why-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.why-item__icon {
  width: 44px;
  height: 44px;
  background: #F0FDF4;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.why-item__heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.why-item__desc {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ---- Featured List ---- */
.featured-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 560px;
}

.featured-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  font-size: 16px;
  padding: 14px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.featured-list li a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.1);
}

.featured-chevron {
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 12px;
}

/* ---- Coaching CTA (Homepage full-width — section element only) ---- */
section.cta-coaching {
  background: linear-gradient(135deg, #1F3A5F 0%, #2d4a6f 100%);
  padding: 80px 24px;
  text-align: center;
  max-width: none;
  margin: 0;
  position: relative;
  overflow: hidden;
}

section.cta-coaching::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 120%, rgba(22, 163, 74, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

section.cta-coaching > div {
  position: relative;
  z-index: 1;
}

section.cta-coaching h2 {
  color: white;
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 16px;
}

section.cta-coaching p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 18px;
  margin-bottom: 32px;
  line-height: 1.6;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.btn-coaching {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: 12px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.btn-coaching:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.4);
}

.btn-coaching:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  section.cta-coaching {
    padding: 48px 16px;
  }
}

/* ---- Tool Page CTA Card (light style) ---- */
.cta-tool-card {
  max-width: 560px;
  margin: 24px auto 0;
  padding: 24px 28px;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.cta-tool-card__heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: 1.35;
}

.cta-tool-card__body {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.cta-tool-card__btn {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 8px;
  transition: background 0.15s, transform 0.1s;
}

.cta-tool-card__btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* ---- Ad Placeholder ---- */
.ad-placeholder {
  max-width: 560px;
  margin: 28px auto 0;
  height: 90px;
  border: 1px dashed #CBD5E1;
  border-radius: 8px;
  background: #FAFAFA;
  /* Invisible to visitors — uncomment below to show label when activating ads */
  /* display: flex; align-items: center; justify-content: center;
     font-size: 12px; color: #CBD5E1; font-weight: 600; */
}

/* ---- Event Picker & Unit Toggle (distance input upgrade) ---- */
.distance-field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.event-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.event-btn {
  flex: 1;
  min-width: 56px;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.event-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.event-btn.active {
  background: #16A34A;
  border-color: #16A34A;
  color: white;
}

.distance-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.distance-input-row input {
  flex: 1;
  min-width: 0;
}

.unit-toggle {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.unit-btn {
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.unit-btn.active {
  background: #16A34A;
  border-color: #16A34A;
  color: white;
}

/* ---- Accordion Heading Wrapper ---- */
.accordion__heading {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

/* ---- Rich Footer ---- */
.rich-footer {
  background: #F1F5F9;
  border-top: 1px solid var(--color-border);
  padding-top: 48px;
}

.rich-footer__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 40px;
}

.rich-footer__heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}

.rich-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rich-footer__list a {
  text-decoration: none;
  font-size: 14px;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

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

.rich-footer__tagline {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.rich-footer__cta-link {
  display: inline-block;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  transition: color 0.15s;
}

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

.rich-footer__bottom {
  border-top: 1px solid var(--color-border);
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .rich-footer__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .rich-footer {
    padding-top: 36px;
  }
}
