/* Calculator styles: age */

/* Inputs: The Timeline */
/* Match .vareoncalc-panel-input: card already provides --sc-card-padding */
.vareoncalc-age-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
}

.age-section {
  gap: 12px;
}

.age-section .age-date-row {
  margin-bottom: 0;
}

.age-target-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.age-target-group .age-section--target {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.age-target-group .age-section--presets {
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.age-section--presets .age-presets {
  margin-bottom: 0;
}

.age-section--presets .age-presets-label {
  display: none;
}

.age-timeline-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
  margin-bottom: 4px;
}

.age-timeline-header .timeline-icon {
  font-size: 24px;
}

.age-timeline-header .timeline-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--sc-card-text, #111827);
}

/* Date row: Date + Time side by side */
.age-date-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.age-date-row .vareoncalc-field {
  flex: 1;
  min-width: 0;
}

/* Time field: narrower than date field */
.age-date-row .vareoncalc-field--time {
  flex: 0 0 120px;
  min-width: 100px;
}

/* Optional label styling */
.age-optional {
  font-weight: 400;
  font-size: 11px;
  color: var(--sc-muted-text, #9ca3af);
}

.age-date-arrow {
  flex-shrink: 0;
  padding-bottom: 14px;
  font-size: 18px;
  font-weight: 600;
  color: var(--sc-muted-text, #6b7280);
}

/* Preset buttons: clean grid layout */
.age-presets {
  display: block;
  margin-bottom: 12px;
}

.age-presets-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--sc-muted-text, #9ca3af);
  margin-bottom: 8px;
}

.age-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.age-preset-btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--sc-input-bg, #f9fafb);
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 8px;
  color: var(--sc-card-text, #374151);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.age-preset-btn:hover {
  background: var(--sc-card-bg, #ffffff);
  border-color: var(--vareoncalc-accent, #3b82f6);
  color: var(--vareoncalc-accent, #3b82f6);
}

.vareoncalc-age-timeline .vareoncalc-btn {
  width: 100%;
}

/* Right Panel: Life Stats */
.vareoncalc-age-lifestats {
  display: flex;
  flex-direction: column;
  background: var(--sc-input-bg, #f9fafb);
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  min-height: 320px;
}

.vareoncalc-age-lifestats--placeholder {
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--sc-muted-text, #6b7280);
  padding: var(--sc-card-padding);
}

.vareoncalc-age-lifestats--placeholder .placeholder-icon {
  font-size: 52px;
  opacity: 0.4;
  margin-bottom: 12px;
}

.vareoncalc-age-lifestats--placeholder .placeholder-text {
  font-size: 14px;
  opacity: 0.7;
}

/* No blind footer handle — drop reserved bottom padding on results */
.vareoncalc-two-step--blind[data-step="results"] .vareoncalc-two-step__results:has(.vareoncalc-age-lifestats) {
  padding-bottom: 0;
}

/* Headline: theme surface */
.lifestats-headline {
  padding: var(--sc-card-padding);
  text-align: center;
  background: var(--sc-card-bg, #ffffff);
  border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
}

.lifestats-years {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  color: var(--sc-card-text, #111827);
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

.lifestats-years-label {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sc-muted-text, #6b7280);
  margin-top: 2px;
}

/* Ring inside hero */
.lifestats-ring-wrap {
  display: flex;
  justify-content: center;
  margin: 18px auto 8px;
}

.lifestats-ring {
  position: relative;
  width: 130px;
  height: 130px;
}

.lifestats-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.lifestats-ring__track {
  fill: none;
  stroke: color-mix(in srgb, var(--sc-card-border, #e5e7eb) 88%, var(--sc-card-text, #111827) 12%);
  stroke-width: 8;
}

.lifestats-ring__progress {
  fill: none;
  stroke: var(--sc-accent, #2563eb);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.lifestats-ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.lifestats-ring__line {
  font-size: 14px;
  font-weight: 600;
  color: var(--sc-card-text, #374151);
  line-height: 1.4;
}

.lifestats-ring__line .subage-value {
  font-weight: 700;
}

.lifestats-since {
  font-size: 13px;
  font-weight: 500;
  color: var(--sc-muted-text, #6b7280);
  margin-top: 10px;
}

.lifestats-since strong {
  color: var(--sc-card-text, #111827);
  font-weight: 700;
}

/* Stats Grid: 2x2 individual cards */
.lifestats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: var(--sc-card-padding);
  background: transparent;
}

.lifestats-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sc-card-padding);
  background: var(--sc-card-bg, #ffffff);
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 12px;
  text-align: center;
  transition: border-color 0.15s ease;
}

.lifestats-stat:hover {
  border-color: color-mix(in srgb, var(--sc-accent, #2563eb) 30%, var(--sc-card-border, #e5e7eb) 70%);
}

.stat-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--sc-input-bg, #f9fafb);
  border: 1px solid var(--sc-card-border, #e5e7eb);
  color: var(--sc-card-text, #374151);
  margin-bottom: 8px;
}

.lifestats-stat .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--sc-card-text, #111827);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.lifestats-stat .stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sc-muted-text, #6b7280);
  margin-top: 4px;
}

/* Milestone card */
.age-milestone-card {
  margin: 0 var(--sc-card-padding);
  padding: var(--sc-card-padding);
  background: color-mix(in srgb, var(--sc-accent, #2563eb) 6%, var(--sc-card-bg, #ffffff) 94%);
  border: 1px solid color-mix(in srgb, var(--sc-accent, #2563eb) 14%, var(--sc-card-border, #e5e7eb) 86%);
  border-radius: 12px;
}

.age-milestone-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.age-milestone-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sc-muted-text, #6b7280);
}

.age-milestone-content {
  margin-top: 4px;
  font-size: 13px;
  color: var(--sc-card-text, #374151);
  line-height: 1.4;
}

.age-milestone-content strong {
  font-weight: 700;
  color: var(--sc-card-text, #111827);
}

.milestone-highlight {
  color: var(--sc-accent, #2563eb) !important;
  font-weight: 800 !important;
}

.age-milestone-date {
  font-weight: 600;
}

.age-milestone-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.milestone-progress-container {
  flex: 1;
  min-width: 0;
}

.milestone-progress-track {
  height: 6px;
  background: var(--sc-card-border, #e5e7eb);
  border-radius: 999px;
  overflow: hidden;
}

.milestone-progress-fill {
  height: 100%;
  background: var(--sc-accent, #2563eb);
  border-radius: 999px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.age-milestone-trophy {
  font-size: 22px;
  flex-shrink: 0;
}

/* Celebration: Next Birthday */
.lifestats-celebration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: var(--sc-card-padding) var(--sc-card-padding) 0;
  padding: var(--sc-card-padding);
  background: var(--sc-card-bg, #ffffff);
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 12px;
  color: var(--sc-card-text, #374151);
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
}

.lifestats-celebration .celebration-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.lifestats-celebration .celebration-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.lifestats-celebration .age-next-bday-label {
  line-height: 1.25;
  font-size: 14px;
  font-weight: 500;
  color: var(--sc-card-text, #374151);
}

.lifestats-celebration .age-next-bday-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
  margin: 4px 0;
}

.age-next-bday-number {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  color: var(--sc-card-text, #111827);
  font-variant-numeric: tabular-nums;
}

.age-next-bday-unit {
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sc-muted-text, #6b7280);
}

.age-next-bday-dayname {
  font-size: 14px;
  font-weight: 600;
  color: var(--sc-muted-text, #6b7280);
}

/* Birthday: "today" state */
.lifestats-celebration--today {
  background: color-mix(in srgb, var(--sc-accent, #2563eb) 8%, var(--sc-card-bg, #ffffff) 92%);
  border-color: var(--sc-card-border, #e5e7eb);
  color: var(--sc-card-text, #111827);
}

/* Back to inputs */
.age-back-wrap {
  margin-top: 8px;
}

.age-back-handle {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-top: 1px dashed var(--sc-card-border, #e5e7eb);
  background: var(--sc-card-bg, #ffffff);
  color: var(--sc-muted-text, #6b7280);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.age-back-handle:hover,
.age-back-handle:focus-visible {
  color: var(--sc-accent, #3b82f6);
  background: var(--sc-input-bg, #f9fafb);
}

.age-back-handle svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.age-back-handle:hover svg,
.age-back-handle:focus-visible svg {
  transform: translateY(-2px);
}


/* Dark Theme: Age Calculator */
.vareoncalc-root[data-theme="dark"] .vareoncalc-age-lifestats,
.vareoncalc-root.theme-dark .vareoncalc-age-lifestats {
  background: var(--sc-input-bg, #1f2937);
}

.vareoncalc-root[data-theme="dark"] .lifestats-headline,
.vareoncalc-root.theme-dark .lifestats-headline {
  background: var(--sc-card-bg, #111827);
  border-bottom-color: var(--sc-card-border, #374151);
}

.vareoncalc-root[data-theme="dark"] .lifestats-stat,
.vareoncalc-root.theme-dark .lifestats-stat {
  background: var(--sc-card-bg, #111827);
  border-color: var(--sc-card-border, #374151);
}

.vareoncalc-root[data-theme="dark"] .age-milestone-card,
.vareoncalc-root.theme-dark .age-milestone-card {
  background: color-mix(in srgb, var(--sc-accent, #3b82f6) 8%, var(--sc-card-bg, #111827) 92%);
  border-color: color-mix(in srgb, var(--sc-accent, #3b82f6) 18%, var(--sc-card-border, #374151) 82%);
}

.vareoncalc-root[data-theme="dark"] .lifestats-celebration,
.vareoncalc-root.theme-dark .lifestats-celebration {
  background: var(--sc-card-bg, #111827);
  border-color: var(--sc-card-border, #374151);
  color: var(--sc-card-text, #e5e7eb);
}

.vareoncalc-root[data-theme="dark"] .lifestats-celebration--today,
.vareoncalc-root.theme-dark .lifestats-celebration--today {
  background: color-mix(in srgb, var(--sc-accent, #3b82f6) 10%, var(--sc-card-bg, #111827) 90%);
  border-color: var(--sc-card-border, #374151);
  color: var(--sc-card-text, #e5e7eb);
}

.vareoncalc-root[data-theme="dark"] .age-preset-btn,
.vareoncalc-root.theme-dark .age-preset-btn {
  background: var(--sc-input-bg, #1f2937);
  border-color: var(--sc-card-border, #374151);
  color: var(--sc-card-text, #e5e7eb);
}

.vareoncalc-root[data-theme="dark"] .age-preset-btn:hover,
.vareoncalc-root.theme-dark .age-preset-btn:hover {
  background: var(--sc-card-bg, #111827);
}

/* Responsive */
@media (max-width: 720px) {
  .vareoncalc-age-lifestats {
    min-height: auto;
  }

  .lifestats-years {
    font-size: 48px;
  }

  .lifestats-stat .stat-value {
    font-size: 20px;
  }

  .age-next-bday-number {
    font-size: 40px;
  }
}

@media (max-width: 480px) {
  .age-date-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .age-date-row .vareoncalc-field {
    flex: 1 1 calc(60% - 5px);
    min-width: 0;
  }

  .age-date-row .vareoncalc-field--time {
    flex: 1 1 calc(40% - 5px);
    min-width: 90px;
  }

  .age-date-arrow {
    display: none;
  }

  .age-presets-grid {
    grid-template-columns: 1fr;
  }

  .lifestats-years {
    font-size: 42px;
  }

  .lifestats-ring {
    width: 110px;
    height: 110px;
  }

  .stat-icon-wrap {
    display: none;
  }

  .lifestats-stat .stat-value {
    font-size: 16px;
  }

  .lifestats-stat {
    padding: max(10px, calc(var(--sc-card-padding) * 0.875)) max(6px, calc(var(--sc-card-padding) * 0.5));
  }

  .lifestats-grid {
    gap: 8px;
  }

  .age-milestone-card {
    margin-top: 0;
  }

  .lifestats-celebration {
    margin-top: 8px;
  }

  .age-next-bday-number {
    font-size: 36px;
  }
}

@media (max-width: 410px) {
  .age-timeline-header {
    align-items: flex-start;
  }

  .age-date-row {
    flex-direction: column;
    align-items: stretch;
  }

  .age-date-row .vareoncalc-field--time {
    flex: 1 1 auto;
    min-width: 0;
  }

  .age-presets-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lifestats-years {
    font-size: 40px;
  }

  .lifestats-grid {
    gap: 6px;
    padding: var(--sc-card-padding);
  }

  .lifestats-stat .stat-value {
    font-size: 14px;
  }

  .lifestats-stat .stat-label {
    font-size: 9px;
  }

  .age-milestone-card {
    margin: 0 var(--sc-card-padding);
  }

  .lifestats-celebration {
    margin: 6px var(--sc-card-padding) 0;
  }

  .age-next-bday-number {
    font-size: 32px;
  }
}

@media (max-width: 360px) {
  .age-presets-grid {
    grid-template-columns: 1fr;
  }

  .lifestats-years {
    font-size: 36px;
  }
}

@container vareoncalc (max-width: 410px) {
  .age-timeline-header {
    align-items: flex-start;
  }

  .age-date-row {
    flex-direction: column;
    align-items: stretch;
  }

  .age-date-row .vareoncalc-field--time {
    flex: 1 1 auto;
    min-width: 0;
  }

  .age-presets-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lifestats-years {
    font-size: 40px;
  }

  .stat-icon-wrap {
    display: none;
  }

  .lifestats-grid {
    gap: 6px;
    padding: var(--sc-card-padding);
  }

  .lifestats-stat .stat-value {
    font-size: 14px;
  }

  .lifestats-stat .stat-label {
    font-size: 9px;
  }

  .age-milestone-card {
    margin: 0 var(--sc-card-padding);
  }

  .lifestats-celebration {
    margin: 6px var(--sc-card-padding) 0;
  }

  .age-next-bday-number {
    font-size: 32px;
  }
}

@container vareoncalc (max-width: 360px) {
  .age-presets-grid {
    grid-template-columns: 1fr;
  }

  .lifestats-years {
    font-size: 36px;
  }
}
