/*
 * calculators.css — Shared Calculator Surface Styles
 * Created: Batch 08 — Calculator Integration
 *
 * Styles for all 8 inline calculator modules.
 * Applied inside .lf-strategy-surface containers.
 *
 * Depends on: css/base.css
 * Zero hardcoded colors — CSS vars only.
 */

/* ============================================================
   CALCULATOR SURFACE ROOT
   ============================================================ */
.lf-calc-surface {
    display: flex;
    flex-direction: column;
    gap: var(--space-inner-sm);
    width: 100%;
    animation: fadeIn 0.25s ease;
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.lf-calc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.lf-calc-header .eyebrow-badge {
    font-size: 9px;
    padding: 3px 10px;
}

.lf-calc-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    margin: 0;
    line-height: var(--leading-tight);
}

/* ============================================================
   INPUT FIELDS
   Dark glass inputs, cyan focus border
   ============================================================ */
.lf-calc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lf-calc-label {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
    text-transform: uppercase;
}

.lf-calc-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.lf-calc-input:focus {
    border-color: var(--cyan-500);
    box-shadow: 0 0 0 2px var(--cyan-alpha-20);
    background: var(--glass-bg-hover);
}

.lf-calc-input::placeholder {
    color: var(--text-dim);
}

.lf-calc-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Auto-filled from state indicator */
.lf-calc-input.lf-autofilled {
    border-color: var(--cyan-alpha-30);
    background: var(--cyan-alpha-10);
    color: var(--cyan-400);
}

/* Select */
.lf-calc-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-dark);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: border-color 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.lf-calc-select:focus {
    border-color: var(--cyan-500);
    box-shadow: 0 0 0 2px var(--cyan-alpha-20);
}

/* Input row (label + input side by side on wider layouts) */
.lf-calc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-inner-sm);
    align-items: end;
}

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

/* ============================================================
   SLIDER
   Cyan track, gold thumb
   ============================================================ */
.lf-calc-slider-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lf-calc-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lf-calc-slider-val {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--cyan-500);
}

.lf-calc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--surface-glass);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    transition: background 0.18s ease;
}

.lf-calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--gold-500);
    cursor: pointer;
    box-shadow: var(--glow-gold-sm);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.lf-calc-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--gold-500);
    cursor: pointer;
    border: none;
    box-shadow: var(--glow-gold-sm);
}

.lf-calc-slider:focus::-webkit-slider-thumb {
    box-shadow: var(--glow-gold-md);
    transform: scale(1.15);
}

/* Filled track (set via JS inline style --pct) */
.lf-calc-slider-track {
    position: relative;
    height: 4px;
    background: var(--surface-glass);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 4px 0;
}

.lf-calc-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--cyan-700), var(--cyan-500));
    border-radius: var(--radius-full);
    pointer-events: none;
    transition: width 0.12s ease;
}

/* ============================================================
   SECTION CARDS
   ============================================================ */
.lf-calc-card {
    padding: var(--space-inner-sm) var(--space-inner-md);
}

.lf-calc-card--compact {
    padding: var(--space-inner-xs) var(--space-inner-sm);
}

.lf-calc-card__title {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-widest);
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 0 0 10px;
}

/* ============================================================
   LINE ITEM ROWS (Rehab, SOW, Flip cost breakdown)
   ============================================================ */
.lf-calc-line-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lf-calc-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--glass-border);
}

.lf-calc-line:last-child {
    border-bottom: none;
}

.lf-calc-line__icon {
    color: var(--text-dim);
    font-size: var(--text-xs);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.lf-calc-line__label {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
}

.lf-calc-line__input {
    width: 110px;
    padding: 5px 10px;
    background: var(--surface-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-primary);
    text-align: right;
    outline: none;
    transition: border-color 0.15s ease;
    flex-shrink: 0;
}

.lf-calc-line__input:focus {
    border-color: var(--cyan-500);
    box-shadow: 0 0 0 2px var(--cyan-alpha-20);
}

.lf-calc-line__value {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    width: 90px;
    text-align: right;
    flex-shrink: 0;
}

/* ============================================================
   OUTPUT VALUE DISPLAY
   Large Orbitron values — cyan or gold
   ============================================================ */
.lf-calc-output {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lf-calc-output__label {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-widest);
    color: var(--text-dim);
    text-transform: uppercase;
}

.lf-calc-output__value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
    color: var(--cyan-500);
    text-shadow: var(--glow-cyan-sm);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.lf-calc-output__value--gold {
    color: var(--gold-500);
    text-shadow: var(--glow-gold-sm);
}

.lf-calc-output__value--positive {
    color: var(--color-positive);
    text-shadow: 0 0 8px var(--color-positive-bg);
}

.lf-calc-output__value--negative {
    color: var(--color-negative);
    text-shadow: 0 0 8px var(--color-negative-bg);
}

.lf-calc-output__sub {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Output grid — 2–3 outputs side by side */
.lf-calc-outputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--space-inner-sm);
}

.lf-calc-output-cell {
    padding: var(--space-inner-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}

/* ============================================================
   FORMULA BREAKDOWN
   MAO formula line items
   ============================================================ */
.lf-calc-formula {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lf-calc-formula-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    border-bottom: 1px solid var(--glass-border);
    font-family: var(--font-body);
    font-size: var(--text-sm);
}

.lf-calc-formula-line:last-child {
    border-bottom: none;
}

.lf-calc-formula-line__op {
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    color: var(--text-dim);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.lf-calc-formula-line__label {
    flex: 1;
    color: var(--text-secondary);
}

.lf-calc-formula-line__value {
    font-family: var(--font-heading);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    text-align: right;
}

.lf-calc-formula-line--total {
    background: var(--cyan-alpha-10);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.lf-calc-formula-line--total .lf-calc-formula-line__label {
    font-weight: var(--weight-bold);
    color: var(--text-primary);
}

.lf-calc-formula-line--total .lf-calc-formula-line__value {
    color: var(--cyan-500);
    text-shadow: var(--glow-cyan-sm);
    font-size: var(--text-md);
}

/* ============================================================
   RUNNING TOTAL BAR
   Sticky bottom of calculator surface
   ============================================================ */
.lf-calc-total-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    background: var(--glass-dark-bg);
    border: 1px solid var(--glass-dark-border);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.lf-calc-total-bar__label {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-widest);
    color: var(--text-muted);
    text-transform: uppercase;
}

.lf-calc-total-bar__value {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    color: var(--cyan-500);
    text-shadow: var(--glow-cyan-sm);
    letter-spacing: var(--tracking-tight);
}

/* ============================================================
   COMP ROWS (ARV)
   ============================================================ */
.lf-comp-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--glass-border);
}

.lf-comp-row:last-child {
    border-bottom: none;
}

.lf-comp-row__num {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    color: var(--text-dim);
    width: 20px;
    flex-shrink: 0;
}

.lf-comp-remove {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    font-size: var(--text-xs);
    border-radius: var(--radius-xs);
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.lf-comp-remove:hover {
    color: var(--color-negative);
}

.lf-comp-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: none;
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.18s ease;
    width: 100%;
    justify-content: center;
    margin-top: 6px;
}

.lf-comp-add-btn:hover {
    border-color: var(--cyan-alpha-30);
    color: var(--cyan-500);
    background: var(--cyan-alpha-10);
}

/* ============================================================
   SOW — Scope of Work document surface
   ============================================================ */
.lf-sow-doc {
    display: flex;
    flex-direction: column;
    gap: var(--space-inner-sm);
}

.lf-sow-header {
    padding: var(--space-inner-sm) var(--space-inner-md);
    border-bottom: 2px solid var(--gold-alpha-30);
}

.lf-sow-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--gold-500);
    letter-spacing: var(--tracking-tight);
    margin: 0;
}

.lf-sow-meta {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 4px 0 0;
}

.lf-sow-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--glass-border);
}

.lf-sow-line__cat {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--text-secondary);
    width: 100px;
    flex-shrink: 0;
}

.lf-sow-line__desc {
    flex: 1;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.lf-sow-line__cost {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    text-align: right;
    width: 90px;
    flex-shrink: 0;
}

.lf-sow-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 10px 0 0;
    border-top: 1px solid var(--gold-alpha-30);
}

.lf-sow-total__label {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.lf-sow-total__value {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: var(--gold-500);
    text-shadow: var(--glow-gold-sm);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .lf-calc-row {
        grid-template-columns: 1fr;
    }

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

    .lf-calc-outputs-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lf-calc-output__value {
        font-size: var(--text-2xl);
    }
}
