/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.owner-avatar {
  display: inline-flex;
  align-items: center;
  cursor: default;
}

.info-tooltip {
  display: inline-block;
  cursor: help;
  margin-left: 0.3em;
  color: #b5b5b5;
  font-size: 0.85em;
}

.info-tooltip:hover {
  color: #485fc7;
}

.app-tooltip {
  position: absolute;
  background: #363636;
  color: #fff;
  padding: 0.5em 0.75em;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: normal;
  line-height: 1.4;
  max-width: 300px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Cashflow Timeline — centered layout */
.cashflow-timeline {
  position: relative;
}

/* A timeline row holds the pills sub-row plus an optional balances strip.
   The backbone line runs through the pills sub-row only; the balances
   strip sits below each row and uses the full horizontal space so long
   account labels can never collide with the pills. */
.timeline-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.timeline-row-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  min-height: 60px;
}

/* Left column: incoming (right-aligned toward the center line) */
.timeline-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding-right: 1rem;
}

/* Right column: outgoing (left-aligned away from center line) */
.timeline-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-left: 1rem;
}

/* Center column: the vertical line + date node */
.timeline-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
}

/* The vertical line running through center */
.timeline-center::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #dbdbdb;
  transform: translateX(-50%);
}

/* First row: line starts at the node */
.timeline-row:first-child .timeline-center::before {
  top: 50%;
}

/* Last row: line ends at the node */
.timeline-row:last-child .timeline-center::before {
  bottom: 50%;
}

.timeline-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0;
}

.timeline-date {
  margin-bottom: 0.1rem;
}

/* Full-width strip under each day's pills row holding account balance
   tags. Wraps freely so multi-account scenarios don't push anything off
   screen. */
.timeline-balances {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.25rem 1rem 0.5rem;
}

/* Badges */
.timeline-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.timeline-left .timeline-badges {
  justify-content: flex-end;
}

.timeline-right .timeline-badges {
  justify-content: flex-start;
}

.timeline-badge {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: default;
  white-space: nowrap;
}

.timeline-badge.is-incoming {
  background: #effaf5;
  color: #257953;
  border: 1px solid #48c78e;
}

.timeline-badge.is-outgoing {
  background: #fef5f7;
  color: #cc0f35;
  border: 1px solid #f14668;
}

/* Scenario list cards: whole card acts as a link to the scenario page.
   A transparent stretched link covers the card; interactive children
   (checkbox, action buttons, delete form) sit above it so they remain
   clickable. Hover/focus outline gives visual affordance. */
.scenario-card {
  position: relative;
  transition: box-shadow 0.15s ease;
}

.scenario-card:hover,
.scenario-card:focus-within {
  box-shadow: 0 0 0 1px rgba(72, 95, 199, 0.25), 0 6px 20px rgba(72, 95, 199, 0.18);
}

.scenario-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.scenario-card .scenario-checkbox,
.scenario-card .level-right {
  position: relative;
  z-index: 2;
}

/* Allow page-header .level rows (title on the left, action buttons on the
   right) to wrap when the two sides together exceed the viewport width.
   Bulma already stacks .level on mobile (<769px); this covers the tablet
   and small-desktop range where the right group would otherwise clip. */
@media screen and (min-width: 769px) {
  .level {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }

  .level > .level-right {
    margin-top: 0;
  }
}

/* Bank-account nested fee-rule rows (Stimulus-generated). Narrow inputs
   keep the rule row compact; widths in em so zoom / font scaling works. */
.fee-rule-percent {
  width: 6em;
}

.fee-rule-fee {
  width: 7em;
}
