/**
 * deal-timeline.css — Deal Timeline Strip
 * Batch 36: Close Date, Hold Period, Exit Date, Days to Close, Break-Even
 *
 * Zero hardcoded colors — all values reference CSS variables from base.css / theme-light.css.
 */

/* ============================================================
   STRIP CONTAINER
   ============================================================ */
#lf-deal-timeline {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 64px;
    height: 64px;
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    margin: 6px 0;
    box-sizing: border-box;
}

/* Hidden in landing state */
body.lf-state-landing #lf-deal-timeline {
    display: none !important;
}

/* ============================================================
   TIMELINE FIELD CELLS
   ============================================================ */
.dt-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
    padding: 8px 16px;
    position: relative;
    gap: 2px;
}

/* Vertical dividers between cells */
.dt-field + .dt-field::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 1px;
    background: var(--glass-border);
}

/* ============================================================
   FIELD LABEL (top, muted uppercase)
   ============================================================ */
.dt-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

/* ============================================================
   FIELD VALUE (bottom, navy / primary)
   ============================================================ */
.dt-value {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: var(--weight-medium);
    color: var(--text-primary);
    white-space: nowrap;
    line-height: 1.2;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Read-only value style (calculated) */
.dt-value--readonly {
    color: var(--text-secondary);
    font-weight: var(--weight-regular);
}

/* ============================================================
   NATIVE INPUTS (date + number)
   ============================================================ */
.dt-input {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: var(--weight-medium);
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    outline: none;
    padding: 0;
    margin: 0;
    width: 100%;
    cursor: pointer;
    line-height: 1.2;
    /* Inherit text color from parent */
    -webkit-appearance: none;
    appearance: none;
}

.dt-input::-webkit-inner-spin-button,
.dt-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Date input calendar icon color */
.dt-input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.4;
    cursor: pointer;
    filter: invert(0.6);
}

/* Hover: show underline affordance */
.dt-field:not(.dt-field--readonly):hover .dt-input {
    border-bottom-color: var(--glass-border-hover);
}

/* Focus: cyan underline */
.dt-input:focus {
    border-bottom-color: var(--cyan-500);
    cursor: text;
}

/* Hold period: inline number + unit */
.dt-hold-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.dt-hold-unit {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.dt-input--hold {
    width: 3.5rem;
    min-width: 2.5rem;
    flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE — mobile: 2 per row, stack
   ============================================================ */
@media (max-width: 640px) {
    #lf-deal-timeline {
        flex-wrap: wrap;
        height: auto;
        min-height: auto;
        padding: 8px 0;
    }

    .dt-field {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 8px 14px;
    }

    /* Reset dividers on mobile */
    .dt-field + .dt-field::before {
        display: none;
    }

    /* Re-apply dividers only for 2nd item in each "pair row" */
    .dt-field:nth-child(2n)::before,
    .dt-field:nth-child(4)::before {
        display: block;
    }

    /* Last item (5th) — full width on mobile */
    .dt-field:last-child {
        flex: 0 0 100%;
        max-width: 100%;
        border-top: 1px solid var(--glass-border);
    }

    .dt-field:last-child::before {
        display: none;
    }
}
