@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Wrapper ──────────────────────────────────────────── */
.sthe-calculator-wrapper {
    font-family: 'Inter', sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 1280px;
    margin: 0 auto;
}

/* ── Header ───────────────────────────────────────────── */
.sthe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}
.sthe-header h2 { color: #00d4aa; margin: 0; font-size: 1.4rem; }

/* ── Unit Toggle ──────────────────────────────────────── */
.sthe-unit-toggle { display: flex; gap: 1rem; }
.sthe-unit-toggle label {
    display: flex; align-items: center; gap: 6px;
    cursor: pointer; color: #94a3b8; font-size: 0.9rem;
}
.sthe-unit-toggle input[type=radio] { accent-color: #00d4aa; }

/* ── 3-column top grid: hot | canvas | cold ───────────── */
.sthe-top-grid {
    display: grid;
    grid-template-columns: 1fr 1.8fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ── Side panels (hot/cold) ───────────────────────────── */
.sthe-side-panel {
    background: rgba(30,41,59,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1rem;
}
.sthe-side-panel h3 {
    margin: 0 0 0.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #334155;
}
.sthe-side-panel.hot h3  { color: #ef4444; }
.sthe-side-panel.cold h3 { color: #3b82f6; }

/* ── Canvas container ─────────────────────────────────── */
.sthe-canvas-wrap {
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#sthe-canvas-container {
    flex: 1;
    min-height: 200px;
    position: relative;
}
#sthe-canvas-container canvas { display: block; }

.sthe-flow-selector {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sthe-flow-selector label { color: #94a3b8; font-size: 0.82rem; white-space: nowrap; }
.sthe-flow-selector select {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #fff !important;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
}

/* ── Design parameters row ────────────────────────────── */
.sthe-design-row {
    background: rgba(30,41,59,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}
.sthe-design-row h4 {
    margin: 0 0 0.8rem;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.5rem;
}
.sthe-param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
}
.sthe-param-grid.wide {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* ── Form groups ──────────────────────────────────────── */
.sthe-form-group { margin-bottom: 0; }
.sthe-form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.8rem;
    color: #cbd5e1;
}
.sthe-form-group input,
.sthe-form-group select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    box-sizing: border-box;
    height: 2.4rem;
    line-height: 1.4;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #ffffff !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}
.sthe-form-group input::placeholder { color: #64748b; }
.sthe-form-group input[type=number]::-webkit-inner-spin-button,
.sthe-form-group input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none; margin: 0;
}
.sthe-form-group select option { background: #1e293b; color: #ffffff; }
.sthe-form-group input:focus,
.sthe-form-group select:focus { outline: none; border-color: #00d4aa; }

/* ── Calculate button ─────────────────────────────────── */
.sthe-btn-row { margin-bottom: 1rem; }
.sthe-btn {
    background: linear-gradient(135deg, #00d4aa, #00a382);
    color: #fff;
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.sthe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,212,170,0.4);
}
.sthe-btn:disabled { background: #475569; cursor: not-allowed; transform: none; box-shadow: none; }

.sthe-spinner {
    display: none;
    width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Results panel ────────────────────────────────────── */
.sthe-results-panel {
    display: none;
    animation: slideUpFade 0.3s ease-out forwards;
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
}
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sthe-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
@media (max-width: 900px) { .sthe-results-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .sthe-results-grid { grid-template-columns: 1fr; } }

.sthe-result-section {
    background: rgba(15,23,42,0.5);
    border-radius: 8px;
    padding: 1rem;
}
.sthe-result-section h3 {
    margin-top: 0;
    color: #94a3b8;
    font-size: 0.9rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}
.sthe-result-item { margin-bottom: 0.6rem; }
.sthe-result-label { font-size: 0.78rem; color: #94a3b8; display: block; }
.sthe-result-value { font-size: 1.05rem; font-weight: 600; display: block; }
.sthe-val-green { color: #10b981; }
.sthe-val-amber { color: #f59e0b; }
.sthe-val-red   { color: #ef4444; }

/* ── Warnings ─────────────────────────────────────────── */
#sthe-warnings { margin-bottom: 0.75rem; }

/* ── CTA ──────────────────────────────────────────────── */
.sthe-cta-panel {
    background: linear-gradient(135deg, rgba(0,212,170,0.1), rgba(15,23,42,0.8));
    border: 1px solid #00d4aa;
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
    margin-bottom: 1rem;
}
.sthe-cta-panel h3 { color: #fff; margin-top: 0; font-size: 1.1rem; }
.sthe-cta-btn {
    display: inline-block;
    background: #00d4aa;
    color: #0f172a;
    padding: 0.65rem 1.4rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 0.75rem;
    transition: background 0.2s;
}
.sthe-cta-btn:hover { background: #00f0c0; }

/* ── Methodology ──────────────────────────────────────── */
.sthe-methodology { margin-top: 0.75rem; }
.sthe-methodology-btn {
    background: none; border: none;
    color: #00d4aa; cursor: pointer; font-size: 0.85rem; padding: 0;
}
.sthe-methodology-content {
    display: none; font-size: 0.83rem; color: #94a3b8;
    margin-top: 0.5rem; padding: 0.75rem;
    background: #1e293b; border-radius: 6px;
}
.sthe-disclaimer {
    font-size: 0.78rem; color: #64748b; text-align: center; margin-top: 0.75rem;
}
.sthe-disclaimer a { color: #00d4aa; text-decoration: none; }

/* ── TEMA note ────────────────────────────────────────── */
.sthe-tema-note {
    font-size: 0.75rem; color: #64748b;
    margin-top: 0.3rem; font-style: italic;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 860px) {
    .sthe-top-grid {
        grid-template-columns: 1fr 1fr;
    }
    .sthe-canvas-wrap {
        grid-column: 1 / -1;
        order: -1;
    }
}
@media (max-width: 560px) {
    .sthe-top-grid { grid-template-columns: 1fr; }
    .sthe-param-grid { grid-template-columns: 1fr 1fr; }
}
