/* ════════════════════════════════════════════════════════════
   time.css — styles for the Time / Idő simulator page
   Builds on top of style.css tokens. All custom properties
   (--bg-*, --text-*, --accent, --success, --border, etc.)
   are defined in style.css and available here.
   ════════════════════════════════════════════════════════════ */


/* ── HERO ─────────────────────────────────────────────────── */
.time-hero {
  padding: 96px 0 72px;
  text-align: center;
}

.time-hero__headline {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 16px 0 32px;
  white-space: pre-line;
}

.time-hero__body {
  max-width: 640px;
  margin: 0 auto 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.time-hero__body p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.time-hero__body p strong {
  color: var(--text-primary);
  font-weight: 600;
}


/* ── SIMULATOR SECTION ────────────────────────────────────── */
.time-simulator {
  padding: 0 0 96px;
}


/* ── CONTROLS BAR ─────────────────────────────────────────── */
.time-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 28px;
}

/* Time horizon buttons */
.horizon-group {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.horizon-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  transition: color var(--transition-fast), background var(--transition-fast);
}

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

.horizon-btn--active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.40);
}

/* Consistency slider group */
.consistency-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.consistency-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.consistency-label span:last-child {
  color: var(--accent);
  font-weight: 600;
}

input[type="range"].time-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

input[type="range"].time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

input[type="range"].time-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"].time-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* Scenario controls */
.scenario-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.btn--sm {
  font-size: 12px;
  padding: 8px 18px;
}

.btn--ghost {
  background: transparent;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
}
.btn--ghost:hover { color: var(--text-primary); border-color: var(--border-hover); }

.scen-a-notice {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  max-width: 220px;
  line-height: 1.4;
}


/* ── MAIN SIMULATOR LAYOUT ────────────────────────────────── */
.time-sim-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 900px) {
  .time-sim-layout {
    grid-template-columns: 1fr;
  }
}


/* ── HABITS PANEL ─────────────────────────────────────────── */
.habits-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.habits-group__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.habits-group__title--good { color: var(--success); }
.habits-group__title--bad  { color: var(--warning); }

.habits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Habit card */
.habit-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 11px 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition:
    border-color  var(--transition-fast),
    background    var(--transition-fast),
    transform     var(--transition-fast);
  width: 100%;
}

.habit-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.habit-card--good.habit-card--active {
  border-color: var(--success);
  background: var(--success-light);
}

.habit-card--bad.habit-card--active {
  border-color: var(--warning);
  background: rgba(251, 146, 60, 0.09);
}

.habit-card__icon {
  font-size: 18px;
  line-height: 1;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.habit-card--good .habit-card__icon { color: var(--success); }
.habit-card--bad  .habit-card__icon { color: var(--warning); }

.habit-card--good.habit-card--active .habit-card__icon { color: var(--success); }
.habit-card--bad.habit-card--active  .habit-card__icon { color: var(--warning); }

.habit-card__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.habit-card__sub {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.2;
}


/* ── CHART PANEL ──────────────────────────────────────────── */
.chart-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
}

/* Life Index big number */
.life-index {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.life-index__main {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.life-index__score {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  transition: color var(--transition-base);
}

.life-index__score.score--thriving  { color: var(--success); }
.life-index__score.score--great     { color: #5EEAD4; }
.life-index__score.score--growing   { color: #7DD3FC; }
.life-index__score.score--neutral   { color: var(--text-secondary); }
.life-index__score.score--declining { color: var(--warning); }
.life-index__score.score--struggling{ color: #F87171; }

.life-index__slash {
  font-size: 1.1rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.life-index__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.life-index__hint {
  font-size: 11px;
  color: var(--text-tertiary);
  width: 100%;
  margin-top: 2px;
}

/* Chart canvas wrapper */
.time-chart-wrap {
  height: 260px;
  position: relative;
}

/* Crossover callout */
.time-crossover {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(62, 232, 181, 0.06);
  border: 1px solid rgba(62, 232, 181, 0.18);
  border-radius: var(--radius-lg);
  align-items: flex-start;
}

.time-crossover i {
  color: var(--success);
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.time-crossover p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Dimension bars */
.time-dims {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dim-row {
  display: grid;
  grid-template-columns: 64px 1fr 32px;
  align-items: center;
  gap: 10px;
}

.dim-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dim-track {
  height: 6px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.dim-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 260ms ease, background-color 260ms ease;
  background: var(--text-tertiary);
}

.dim-fill[data-above="true"]  { background: var(--success); }
.dim-fill[data-above="false"] { background: var(--warning); }

/* Domain-specific colors override the generic above/below rules */
.dim-fill[data-dim="health"][data-above="true"]  { background: #FB923C; }
.dim-fill[data-dim="health"][data-above="false"] { background: rgba(251, 146, 60, 0.35); }
.dim-fill[data-dim="wealth"][data-above="true"]  { background: #FBBF24; }
.dim-fill[data-dim="wealth"][data-above="false"] { background: rgba(251, 191, 36, 0.35); }
.dim-fill[data-dim="skill"][data-above="true"]   { background: #818CF8; }
.dim-fill[data-dim="skill"][data-above="false"]  { background: rgba(129, 140, 248, 0.35); }

.dim-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
}

/* ── ALT UNIVERSE COMPARISON ───────────────────────────────── */
.alt-universe {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 11px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  margin-top: 4px;
  width: 100%;   /* force onto its own line in the flex life-index container */
}

.alt-universe__label {
  color: var(--text-tertiary);
  font-weight: 500;
}

.alt-universe__score {
  color: var(--text-secondary);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
}

.alt-universe__delta {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.alt-delta--pos { background: rgba(62, 232, 181, 0.12); color: var(--success); }
.alt-delta--neg { background: rgba(239, 68, 68, 0.10);  color: #F87171; }


/* ── FINANCIAL IMPACT ──────────────────────────────────────── */
.financial-impact {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.financial-impact i {
  color: #FBBF24;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

#financialImpactText { font-weight: 500; }


/* ── LEVERAGE BLOCK ────────────────────────────────────────── */
.leverage-block { border-top: 1px solid var(--border); padding-top: 16px; }

.leverage-block__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.leverage-block__title i { font-size: 13px; color: var(--accent); }

.leverage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leverage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 2.5px solid transparent;
}

.leverage-item--add  { border-left-color: var(--success); }
.leverage-item--drop { border-left-color: var(--warning); }

.leverage-item__icon { font-size: 14px; flex-shrink: 0; }
.leverage-item--add  .leverage-item__icon { color: var(--success); }
.leverage-item--drop .leverage-item__icon { color: var(--warning); }

.leverage-item__label {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.leverage-item__action {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.leverage-item--add  .leverage-item__action { color: var(--success); }
.leverage-item--drop .leverage-item__action { color: var(--warning); }

.leverage-item__pts {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}


/* ── HABIT CARD INFO TOOLTIP ───────────────────────────────── */
.habit-card { position: relative; }

.habit-card__info {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  padding: 3px;
  border-radius: 50%;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.habit-card__info:hover,
.habit-card__info.is-open { color: var(--text-secondary); }

.habit-card__tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  right: -4px;
  width: 210px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 200;
  white-space: normal;
  text-align: left;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 400;
}

.habit-card__info:hover .habit-card__tooltip,
.habit-card__info.is-open .habit-card__tooltip {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Allow tooltips to overflow the grid/panel */
.habits-grid,
.habits-group,
.habits-panel { overflow: visible; }


/* Milestone section */
.milestone-section {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.milestone-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}

.milestone-tab {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.milestone-tab:hover { color: var(--text-primary); }

.milestone-tab--active {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border);
}

.milestone-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.milestone-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 8px 0;
}

.milestone-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 3px solid transparent;
}

.milestone-item--good { border-left-color: var(--success); }
.milestone-item--bad  { border-left-color: var(--warning); }

.milestone-item__icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.milestone-item--good .milestone-item__icon { color: var(--success); }
.milestone-item--bad  .milestone-item__icon { color: var(--warning); }

.milestone-item__body strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.milestone-item__body p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Chart legend */
.time-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.time-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.time-legend__dot {
  width: 20px;
  height: 2px;
  border-radius: 1px;
}

.time-legend__dot--health { background: #FB923C; }
.time-legend__dot--wealth { background: #FBBF24; }
.time-legend__dot--skill  { background: #818CF8; }
.time-legend__dot--scena  { background: #60A5FA; }
.time-legend__dot--base   { background: transparent; border-top: 1px dashed #58564F; height: 0; margin-top: 1px; }
