/* ============================================================
   ProCalcTools — Premium Results Design System v1.0
   Applied globally to ALL calculator result sections
   ============================================================ */

/* ── KEYFRAME ANIMATIONS ── */
@keyframes resultSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes resultCountUp {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(21,87,160,.25); }
  70%  { box-shadow: 0 0 0 12px rgba(21,87,160,0); }
  100% { box-shadow: 0 0 0 0 rgba(21,87,160,0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ════════════════════════════════════════════════════
   CORE RESULTS BOX — Premium redesign
   Replaces .results-box across ALL tools
   ════════════════════════════════════════════════════ */
.results-box {
  background: #fff;
  border: 0;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(21,87,160,.14), 0 2px 8px rgba(0,0,0,.06);
  animation: resultSlideUp .4s cubic-bezier(.22,1,.36,1) both;
}

/* ── Top hero strip — main result number ── */
.results-box::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #1557a0 0%, #2d7dd2 50%, #f59e0b 100%);
}

/* ── Results header label ── */
.results-box h3 {
  background: linear-gradient(135deg, #0e3f78, #1557a0);
  color: #fff !important;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 14px 24px 12px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.results-box h3::before {
  content: '✦';
  font-size: .85rem;
  opacity: .7;
}

/* ── Result items container ── */
.results-box .result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
  animation: fadeIn .3s ease both;
}
.results-box .result-item:hover {
  background: #f8fafc;
}
.results-box .result-item:last-of-type {
  border-bottom: none;
}

/* ── HIGHLIGHT item — the primary result ── */
.results-box .result-item.highlight {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  padding: 22px 24px;
  border-bottom: 2px solid #bfdbfe;
  position: relative;
  overflow: hidden;
}
.results-box .result-item.highlight::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.4) 50%, transparent 100%);
  background-size: 400px 100%;
  animation: shimmer 2.5s ease-in-out infinite;
  pointer-events: none;
}
.results-box .result-item.highlight .label {
  font-size: .95rem;
  font-weight: 700;
  color: #1557a0;
  letter-spacing: -.01em;
}
.results-box .result-item.highlight .value {
  font-size: 2.4rem !important;
  font-weight: 800;
  color: #0e3f78;
  letter-spacing: -.04em;
  line-height: 1;
  animation: resultCountUp .5s cubic-bezier(.22,1,.36,1) both;
}

/* ── Normal result items ── */
.results-box .result-item .label {
  font-size: .88rem;
  color: #64748b;
  font-weight: 500;
}
.results-box .result-item .value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.015em;
}

/* ── Bottom padding area ── */
.results-box > *:last-child {
  margin-bottom: 0;
}

/* ── Copy button inside results ── */
.results-box .copy-btn {
  display: block;
  width: calc(100% - 48px);
  margin: 0 24px 20px;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: .82rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
  text-align: center;
}
.results-box .copy-btn:hover {
  background: #1557a0;
  color: #fff;
  border-color: #1557a0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(21,87,160,.25);
}

/* ── Small disclaimer inside results ── */
.results-box .disclaimer-small,
.results-box #pmi-note {
  padding: 0 24px 16px;
  font-size: .73rem;
  color: #94a3b8;
  font-style: italic;
  line-height: 1.55;
}

/* ── Amort toggle inside results ── */
.results-box .toggle-amort {
  display: block;
  width: calc(100% - 48px);
  margin: 4px 24px 8px;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: .82rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  transition: all .18s;
}
.results-box .toggle-amort:hover {
  border-color: #1557a0;
  color: #1557a0;
}

/* ── Pie chart inside results ── */
.results-box .pie-chart-container {
  padding: 16px 24px 4px;
  gap: 20px;
}
.results-box .pie-legend-item {
  font-size: .8rem;
  color: #374151;
}

/* ════════════════════════════════════════════════════
   RESULT STAT CARDS — colored metric display
   Used for: BMI, BMR, Age, Calories, etc.
   ════════════════════════════════════════════════════ */
.result-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding: 20px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.result-stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
  border: 1.5px solid #e2e8f0;
  transition: transform .18s, box-shadow .18s;
  animation: resultSlideUp .4s cubic-bezier(.22,1,.36,1) both;
}
.result-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.result-stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
  display: block;
  line-height: 1;
}
.result-stat-card .stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 4px;
  animation: resultCountUp .5s cubic-bezier(.22,1,.36,1) both;
}
.result-stat-card .stat-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #94a3b8;
}
/* Color variants */
.result-stat-card.blue   { border-color: #bfdbfe; background: linear-gradient(135deg,#eff6ff,#fff); }
.result-stat-card.blue .stat-value { color: #1557a0; }
.result-stat-card.green  { border-color: #bbf7d0; background: linear-gradient(135deg,#f0fdf4,#fff); }
.result-stat-card.green .stat-value { color: #15803d; }
.result-stat-card.amber  { border-color: #fde68a; background: linear-gradient(135deg,#fffbeb,#fff); }
.result-stat-card.amber .stat-value { color: #b45309; }
.result-stat-card.red    { border-color: #fecaca; background: linear-gradient(135deg,#fef2f2,#fff); }
.result-stat-card.red .stat-value { color: #dc2626; }
.result-stat-card.purple { border-color: #ddd6fe; background: linear-gradient(135deg,#f5f3ff,#fff); }
.result-stat-card.purple .stat-value { color: #7c3aed; }
.result-stat-card.teal   { border-color: #99f6e4; background: linear-gradient(135deg,#f0fdfa,#fff); }
.result-stat-card.teal .stat-value { color: #0d9488; }

/* ════════════════════════════════════════════════════
   RESULT BADGE ROW — inline colored status badge
   ════════════════════════════════════════════════════ */
.result-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid #f1f5f9;
}
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.result-badge.success { background: #dcfce7; color: #15803d; }
.result-badge.warning { background: #fef3c7; color: #92400e; }
.result-badge.danger  { background: #fee2e2; color: #991b1b; }
.result-badge.info    { background: #dbeafe; color: #1e40af; }
.result-badge.neutral { background: #f1f5f9; color: #475569; }

/* ════════════════════════════════════════════════════
   RESULT PROGRESS BAR — visual percentage indicator
   ════════════════════════════════════════════════════ */
.result-progress-wrap {
  padding: 0 24px 20px;
}
.result-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 500;
}
.result-progress-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.result-progress-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #1557a0, #2d7dd2);
  transition: width .8s cubic-bezier(.22,1,.36,1);
}
.result-progress-fill.green  { background: linear-gradient(90deg,#15803d,#22c55e); }
.result-progress-fill.amber  { background: linear-gradient(90deg,#b45309,#f59e0b); }
.result-progress-fill.red    { background: linear-gradient(90deg,#dc2626,#ef4444); }

/* ════════════════════════════════════════════════════
   AGE CALCULATOR — premium unique layout
   ════════════════════════════════════════════════════ */
.age-result-premium {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(21,87,160,.14);
  animation: resultSlideUp .4s cubic-bezier(.22,1,.36,1) both;
}
/* Rainbow top bar */
.age-result-premium::before {
  content: '';
  display: block;
  height: 5px;
  background: linear-gradient(90deg,
    #6366f1 0%,
    #8b5cf6 20%,
    #ec4899 40%,
    #f59e0b 60%,
    #22c55e 80%,
    #3b82f6 100%
  );
}

/* Big age display */
.age-hero-display {
  background: linear-gradient(135deg, #0e3f78 0%, #1557a0 60%, #2d7dd2 100%);
  color: #fff;
  padding: 28px 28px 24px;
  display: flex;
  align-items: flex-end;
  gap: 0;
  flex-wrap: wrap;
}
.age-big-num {
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.06em;
  color: #fff;
  animation: resultCountUp .6s cubic-bezier(.22,1,.36,1) both;
}
.age-unit {
  font-size: 1.2rem;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  margin-bottom: .6rem;
  margin-left: 8px;
  letter-spacing: -.01em;
}
.age-sub {
  width: 100%;
  font-size: .9rem;
  color: rgba(255,255,255,.7);
  margin-top: 8px;
  letter-spacing: -.01em;
}

/* Age stats grid */
.age-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid #e2e8f0;
}
.age-stat-cell {
  padding: 18px 16px;
  text-align: center;
  border-right: 1px solid #e2e8f0;
  transition: background .15s;
  animation: fadeIn .4s ease both;
}
.age-stat-cell:last-child { border-right: none; }
.age-stat-cell:hover { background: #f8fafc; }
.age-stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: #1557a0;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.age-stat-lbl {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin-top: 3px;
}

/* Fun facts rows */
.age-fact-list {
  padding: 4px 0 8px;
}
.age-fact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
  animation: fadeIn .3s ease both;
}
.age-fact-row:hover { background: #f8fafc; }
.age-fact-row:last-child { border-bottom: none; }
.age-fact-icon-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  color: #64748b;
  font-weight: 500;
}
.age-fact-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.age-fact-value {
  font-size: .95rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.01em;
}
/* Staggered animations */
.age-fact-row:nth-child(1) { animation-delay: .05s; }
.age-fact-row:nth-child(2) { animation-delay: .1s; }
.age-fact-row:nth-child(3) { animation-delay: .15s; }
.age-fact-row:nth-child(4) { animation-delay: .2s; }
.age-fact-row:nth-child(5) { animation-delay: .25s; }

/* Birthday countdown banner */
.age-bday-banner {
  margin: 0 20px 20px;
  background: linear-gradient(135deg, #fef9ec, #fffbeb);
  border: 1.5px solid #fde68a;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.age-bday-banner .bday-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  animation: pulse-ring 2s ease-out infinite;
  border-radius: 50%;
}
.age-bday-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #92400e;
  letter-spacing: -.02em;
}
.age-bday-text span {
  font-size: .8rem;
  color: #b45309;
}

/* Action buttons */
.age-result-actions {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px;
}
.age-action-btn {
  flex: 1;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .82rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.age-action-btn:hover {
  background: #1557a0;
  color: #fff;
  border-color: #1557a0;
  transform: translateY(-1px);
}

/* ════════════════════════════════════════════════════
   SLEEP CALCULATOR — premium time cards
   ════════════════════════════════════════════════════ */
.sleep-times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  padding: 16px 24px 20px;
}
.sleep-time-card {
  background: linear-gradient(135deg, #eff6ff, #fff);
  border: 1.5px solid #bfdbfe;
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .18s;
  animation: resultSlideUp .4s cubic-bezier(.22,1,.36,1) both;
}
.sleep-time-card:hover {
  background: linear-gradient(135deg,#1557a0,#2d7dd2);
  border-color: #1557a0;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(21,87,160,.25);
}
.sleep-time-card:hover .sleep-card-time { color: #fff; }
.sleep-time-card:hover .sleep-card-cycles { color: rgba(255,255,255,.7); }
.sleep-card-time {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: #1557a0;
  letter-spacing: -.02em;
  margin-bottom: 4px;
  transition: color .18s;
}
.sleep-card-cycles {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: color .18s;
}

/* ════════════════════════════════════════════════════
   BMI RESULT — visual gauge with color bar
   ════════════════════════════════════════════════════ */
.bmi-result-premium {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(21,87,160,.12);
  animation: resultSlideUp .4s cubic-bezier(.22,1,.36,1) both;
}
.bmi-big-number {
  background: linear-gradient(135deg, #0e3f78, #1557a0);
  padding: 24px 28px 20px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.bmi-value-large {
  font-size: 4.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -.06em;
  animation: resultCountUp .5s cubic-bezier(.22,1,.36,1) both;
}
.bmi-unit-label {
  font-size: 1rem;
  color: rgba(255,255,255,.6);
  font-weight: 500;
  margin-bottom: .5rem;
}
.bmi-category-badge {
  display: block;
  margin-top: 10px;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(255,255,255,.85);
}

/* ════════════════════════════════════════════════════
   CALORIE RESULT — macros display
   ════════════════════════════════════════════════════ */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 0;
  border-top: 1px solid #e2e8f0;
}
.macro-cell {
  padding: 16px 12px;
  text-align: center;
  border-right: 1px solid #e2e8f0;
  transition: background .15s;
}
.macro-cell:last-child { border-right: none; }
.macro-cell:hover { background: #f8fafc; }
.macro-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 3px;
}
.macro-label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #94a3b8;
}
.macro-cell.protein .macro-value { color: #dc2626; }
.macro-cell.carbs .macro-value   { color: #d97706; }
.macro-cell.fat .macro-value     { color: #16a34a; }

/* ════════════════════════════════════════════════════
   STAGGERED ANIMATION DELAYS for result items
   ════════════════════════════════════════════════════ */
.results-box .result-item:nth-child(1)  { animation-delay: .0s; }
.results-box .result-item:nth-child(2)  { animation-delay: .05s; }
.results-box .result-item:nth-child(3)  { animation-delay: .08s; }
.results-box .result-item:nth-child(4)  { animation-delay: .11s; }
.results-box .result-item:nth-child(5)  { animation-delay: .14s; }
.results-box .result-item:nth-child(6)  { animation-delay: .17s; }
.results-box .result-item:nth-child(7)  { animation-delay: .20s; }
.results-box .result-item:nth-child(8)  { animation-delay: .23s; }
.results-box .result-item:nth-child(9)  { animation-delay: .26s; }
.results-box .result-item:nth-child(10) { animation-delay: .29s; }

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
  .results-box, .result-stat-card, .age-result-premium,
  .bmi-result-premium, .sleep-time-card, .age-fact-row,
  .results-box .result-item { animation: none !important; transition: none !important; }
}

/* ── Mobile tweaks ── */
@media (max-width: 600px) {
  .results-box .result-item.highlight .value { font-size: 1.8rem !important; }
  .results-box .result-item { padding: 12px 18px; }
  .results-box h3 { padding: 12px 18px 10px; }
  .results-box .copy-btn { width: calc(100% - 36px); margin: 0 18px 16px; }
  .age-big-num { font-size: 3.8rem; }
  .age-stats-grid { grid-template-columns: repeat(3,1fr); }
  .age-fact-row { padding: 11px 18px; }
  .age-bday-banner { margin: 0 14px 16px; }
  .age-result-actions { padding: 0 14px 16px; }
  .result-stat-grid { padding: 14px 18px; }
  .sleep-times { padding: 14px 18px 18px; gap: 8px; }
  .bmi-big-number { padding: 20px 20px 16px; }
  .bmi-value-large { font-size: 3.5rem; }
  .macro-cell { padding: 13px 8px; }
  .macro-value { font-size: 1.1rem; }
  .age-stats-grid { grid-template-columns: repeat(3,1fr); }
  .age-stat-num { font-size: 1.25rem; }
  .pie-chart-container { padding: 14px 18px 4px; }
}
