/* Balustrade Material Estimator */
.balustrade-estimator {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px;
    color: #333;
}

.balustrade-estimator h1 {
    font-size: 1.6rem;
    margin: 0 0 6px 0;
    color: #333;
}

.balustrade-estimator .intro {
    color: #666;
    font-size: 0.92rem;
    margin: 0 0 24px 0;
}

.balustrade-estimator form {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--brand-border-radius, 8px);
    padding: 28px 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.balustrade-estimator .input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.balustrade-estimator .input-row label {
    flex: 1;
    font-weight: 600;
    font-size: 0.88rem;
    color: #444;
}

.balustrade-estimator .input-row input,
.balustrade-estimator .input-row select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: var(--brand-border-radius, 6px);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #333;
}

.balustrade-estimator .input-row input:focus,
.balustrade-estimator .input-row select:focus {
    outline: none;
    border-color: var(--brand-primary, #4CAF50);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary, #4CAF50) 15%, transparent);
}

.balustrade-estimator .input-row.checkbox {
    justify-content: flex-start;
}

.balustrade-estimator button {
    width: 100%;
    background: var(--brand-primary, #4CAF50);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--brand-border-radius, 6px);
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.balustrade-estimator button:hover {
    background: var(--brand-primary-dark, #388E3C);
    transform: translateY(-1px);
}

/* Results Card */
.balustrade-estimator .results {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--brand-border-radius, 8px);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.balustrade-estimator .results h2 {
    color: var(--brand-primary, #4CAF50);
    margin: 0 0 12px 0;
    font-size: 1.15rem;
}

.hidden {
    display: none;
}

/* Diagram */
.diagram-container {
    display: block;
    margin-top: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--brand-border-radius, 8px);
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

#balustradeDiagram {
    width: 100%;
    max-width: 800px;
    height: auto;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: var(--brand-border-radius, 6px);
}

.diagram-note {
    font-size: 0.85rem;
    color: #888;
    margin-top: 10px;
}

/* ===== Dark Mode ===== */
body.dark-mode .balustrade-estimator { color: #e0e0e0; }
body.dark-mode .balustrade-estimator h1 { color: #f0f0f0; }
body.dark-mode .balustrade-estimator .intro { color: #aaa; }

body.dark-mode .balustrade-estimator form {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .balustrade-estimator .input-row label { color: #ccc; }

body.dark-mode .balustrade-estimator .input-row input,
body.dark-mode .balustrade-estimator .input-row select {
    background: #1e1e1e;
    border-color: #505050;
    color: #e0e0e0;
}

body.dark-mode .balustrade-estimator .results {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .diagram-container {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode #balustradeDiagram {
    background: #1e1e1e;
    border-color: #404040;
}

body.dark-mode .diagram-note { color: #888; }

/* ===== Theme overrides ===== */
body.theme-forest .balustrade-estimator form,
body.theme-forest .balustrade-estimator .results,
body.theme-forest .diagram-container { background: #243020; border-color: #3d5235; }
body.theme-forest .balustrade-estimator .input-row label { color: #b8d4a8; }
body.theme-forest .balustrade-estimator .input-row input,
body.theme-forest .balustrade-estimator .input-row select { background: #1a2418; border-color: #3d5235; color: #b8d4a8; }
body.theme-forest .balustrade-estimator h1 { color: #b8d4a8; }
body.theme-forest .balustrade-estimator .intro { color: #8aaa78; }
body.theme-forest #balustradeDiagram { background: #1a2418; border-color: #3d5235; }
body.theme-forest .diagram-note { color: #8aaa78; }

body.theme-ocean .balustrade-estimator form,
body.theme-ocean .balustrade-estimator .results,
body.theme-ocean .diagram-container { background: #1c2636; border-color: #2e4460; }
body.theme-ocean .balustrade-estimator .input-row label { color: #a0c4e8; }
body.theme-ocean .balustrade-estimator .input-row input,
body.theme-ocean .balustrade-estimator .input-row select { background: #141e2e; border-color: #2e4460; color: #a0c4e8; }
body.theme-ocean .balustrade-estimator h1 { color: #a0c4e8; }
body.theme-ocean .balustrade-estimator .intro { color: #7a9ab8; }
body.theme-ocean #balustradeDiagram { background: #141e2e; border-color: #2e4460; }
body.theme-ocean .diagram-note { color: #7a9ab8; }

body.theme-slate .balustrade-estimator form,
body.theme-slate .balustrade-estimator .results,
body.theme-slate .diagram-container { background: #faf7f2; border-color: #c8bfb0; }
body.theme-slate .balustrade-estimator .input-row label { color: #504840; }
body.theme-slate .balustrade-estimator .input-row input,
body.theme-slate .balustrade-estimator .input-row select { background: #f5f0e8; border-color: #c8bfb0; color: #504840; }
body.theme-slate .balustrade-estimator h1 { color: #504840; }
body.theme-slate .balustrade-estimator .intro { color: #8b7d6b; }
body.theme-slate #balustradeDiagram { background: #f5f0e8; border-color: #c8bfb0; }
body.theme-slate .diagram-note { color: #8b7d6b; }

body.theme-sunset .balustrade-estimator form,
body.theme-sunset .balustrade-estimator .results,
body.theme-sunset .diagram-container { background: #fff8f5; border-color: #e0bfb0; }
body.theme-sunset .balustrade-estimator .input-row label { color: #6b3f35; }
body.theme-sunset .balustrade-estimator .input-row input,
body.theme-sunset .balustrade-estimator .input-row select { background: #fdf5f0; border-color: #e0bfb0; color: #6b3f35; }
body.theme-sunset .balustrade-estimator h1 { color: #6b3f35; }
body.theme-sunset .balustrade-estimator .intro { color: #a06858; }
body.theme-sunset #balustradeDiagram { background: #fdf5f0; border-color: #e0bfb0; }
body.theme-sunset .diagram-note { color: #a06858; }
