/* =============================================================================
   ps_estimator.css
   Emergency Power Calculator -- page-specific styles
   Loaded via PAGE_CSS_LINK: ../css/ps_estimator.css
   Site-wide styles (fonts, header, footer, nav) come from dsp_site.css.
   ============================================================================= */

/* ── Page wrapper ──────────────────────────────────────────────────────────── */
/* Replaces the body-level flex centering used in the standalone prototype.     */
/* The site body is controlled by dsp_site.css; we center content here instead. */

.calc-page {
    max-width: 920px;
    margin: 32px auto;
    padding: 0 24px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Card container (the white table box) ──────────────────────────────────── */

.table-container {
    width: 850px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.table-container h2 {
    margin-top: 0;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
    font-size: 1.25rem;
}

.calc-subtitle {
    text-align: center;
    color: #5a7a96;
    font-size: 0.88rem;
    margin: -8px 0 20px;
    font-style: italic;
}

/* ── Table ─────────────────────────────────────────────────────────────────── */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    table-layout: fixed;
}

th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #dee2e6;
    color: #6c757d;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

th.r, td.r { text-align: right; }

td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
    overflow: hidden;
    vertical-align: middle;
}

/* Column widths */
.col-item     { width: 38%; }
.col-priority { width: 16%; }
.col-runw     { width: 12%; }
.col-wh       { width: 10%; }
.col-qty      { width: 10%; }
.col-use      { width: 14%; }

/* Group section headers */
.group-header {
    background-color: #e9ecef !important;
    font-weight: bold;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #495057;
}

/* Alternating row shading */
tbody tr:nth-child(odd)  { background-color: #ffffff; }
tbody tr:nth-child(even) { background-color: #f8f9fa; }

/* Priority highlight colors (applied when row is checked) */
.row-must    { background-color: #d1e7dd !important; color: #0f5132; }
.row-good    { background-color: #fff3cd !important; color: #664d03; }
.row-luxury  { background-color: #f8d7da !important; color: #842029; }

/* ── Form controls ─────────────────────────────────────────────────────────── */

input[type="checkbox"] { transform: scale(1.6); cursor: pointer; }

select,
input[type="text"],
input[type="number"] {
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    width: 90%;
}

/* ── Surge star (orange asterisk on motor/compressor items) ────────────────── */

.surge-star {
    color: #e07d1a;
    font-size: 0.78rem;
    vertical-align: super;
    cursor: help;
    margin-left: 2px;
    font-weight: bold;
}

/* ── Footnote below table ──────────────────────────────────────────────────── */

.footnote {
    font-size: 0.78rem;
    color: #6c757d;
    font-style: italic;
    padding: 8px 2px 2px;
    border-top: 1px solid #eee;
    margin: 0;
}

.footnote .fstar {
    color: #e07d1a;
    font-weight: bold;
    font-style: normal;
}

/* Remove spinner arrows from number inputs (useless for wattage entry) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ── Custom item entry row ─────────────────────────────────────────────────── */

.custom-entry-area { background-color: #fdfdfe; border-top: 3px solid #dee2e6; }
.custom-entry-area td { vertical-align: top; padding-top: 10px; }

.custom-note {
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 4px;
}

.motor-label {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    cursor: pointer;
}

.motor-label input[type="checkbox"] { transform: scale(1.2); }

.add-btn {
    cursor: pointer;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-weight: bold;
    width: 100%;
}

.add-btn:hover { background: #1a2c3d; }

/* ── Staircase summary bars ────────────────────────────────────────────────── */

.staircase-container {
    align-self: flex-start;
    margin-left: calc(50% - 425px);
    margin-top: 30px;
    width: 100%;
}

.step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 22px;
    font-weight: 600;
    border-radius: 6px 0 0 6px;
}

.step-label {
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.step-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.metric-line {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
}

.metric-val  { font-size: 1.15rem; font-weight: 700; }
.metric-unit { font-size: 0.7rem; font-weight: normal; opacity: 0.8; }

#step-must   { width: 340px; min-height: 72px; background-color: #198754; color: #fff; border-right: 18px solid #146c43; }
#step-good   { width: 510px; min-height: 82px; background-color: #ffc107; color: #333; border-right: 18px solid #e0a800; }
#step-luxury { width: 680px; min-height: 92px; background-color: #dc3545; color: #fff; border-right: 18px solid #b02a37; }

/* ── Motor surge warning callout ───────────────────────────────────────────── */

.surge-warning {
    align-self: flex-start;
    margin-left: calc(50% - 425px);
    margin-top: 16px;
    width: 676px;
    background: #fff5f5;
    border: 2px solid #dc3545;
    border-left: 6px solid #dc3545;
    border-radius: 6px;
    padding: 14px 18px;
    color: #5a1020;
    font-size: 0.88rem;
    line-height: 1.55;
}

.surge-warning h3 {
    margin: 0 0 9px 0;
    font-size: 0.97rem;
    color: #b02a37;
}

.surge-warning ul { margin: 8px 0 4px 0; padding-left: 18px; }
.surge-warning li { margin-bottom: 3px; }

/* Tier-colored values inside the surge warning */
.sv-must { color: #0f5132; font-weight: 700; }
.sv-good { color: #664d03; font-weight: 700; }
.sv-lux  { color: #b02a37; font-weight: 700; }
