/* ============================================================
   SIMULATOR VIEW — Glassmorphism Dark Theme
   ============================================================ */

/* ── View visibility ── */
.view-hidden {
    display: none !important;
}

/* ── Nav tabs ── */
.nav-tabs {
    display: flex;
    gap: 4px;
    align-items: center;
    margin: 0 16px;
}

.nav-tab {
    background: transparent;
    border: 1px solid transparent;
    color: #8b949e;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.nav-tab:hover {
    color: #e6edf3;
    background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
    color: #58a6ff;
    border-color: #58a6ff;
    background: rgba(88, 166, 255, 0.08);
}

/* ── Simulator container ── */
#view-simulator {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sim-header {
    margin-bottom: 24px;
}

.sim-header h2 {
    font-size: 1.4em;
    font-weight: 700;
    color: #e6edf3;
    margin: 0 0 4px;
}

.sim-header p {
    font-size: 0.85em;
    color: #8b949e;
    margin: 0;
}

/* ── Glass card ── */
.sim-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

/* ── Inputs ── */
.sim-field {
    margin-bottom: 16px;
}

.sim-field label {
    display: block;
    font-size: 0.78em;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.sim-field input,
.sim-field select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #e6edf3;
    font-size: 0.95em;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.sim-field input:focus,
.sim-field select:focus {
    border-color: #58a6ff;
}

.sim-field select option {
    background: #161b22;
}

.sim-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .sim-row {
        grid-template-columns: 1fr;
    }
}

/* ── Results ── */
.sim-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .sim-results {
        grid-template-columns: 1fr;
    }
}

.sim-result-box {
    background: rgba(88, 166, 255, 0.06);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.sim-result-box.total-box {
    background: rgba(163, 113, 247, 0.06);
    border-color: rgba(163, 113, 247, 0.2);
}

.sim-result-label {
    font-size: 0.72em;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.sim-result-value {
    font-size: 1.6em;
    font-weight: 700;
    color: #58a6ff;
    line-height: 1.1;
}

.total-box .sim-result-value {
    color: #a371f7;
}

/* ── Risk/Semaphore ── */
.sim-risk-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.sim-risk-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.sim-risk-title {
    font-size: 0.78em;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sim-risk-pct {
    font-size: 1.3em;
    font-weight: 700;
    color: #e6edf3;
}

.sim-risk-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sim-risk-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease, background 0.4s ease;
    width: 0%;
    background: #3fb950;
}

.sim-risk-bar-fill.risk-yellow {
    background: #d29922;
}

.sim-risk-bar-fill.risk-red {
    background: #f85149;
}

.sim-risk-legend {
    display: flex;
    gap: 12px;
    font-size: 0.72em;
    color: #8b949e;
    margin-top: 4px;
}

.sim-risk-legend span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sim-risk-legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.sim-risk-alert {
    display: none;
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 8px;
    color: #f85149;
    font-size: 0.83em;
    font-weight: 500;
}

.sim-risk-alert.visible {
    display: block;
}

.sim-income-note {
    font-size: 0.75em;
    color: #484f58;
    text-align: center;
    margin-top: 12px;
}