/* Explain: Styles for the PSX trading signal generator UI. */
/* PSX trading signal generator — layout, signal badges, score panels and chart. */

.psx-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 900px) {
    .psx-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
        align-items: start;
    }
}

.psx-hint { font-size: .92rem; margin: .35rem 0 1.15rem; }
.psx-generate { width: 100%; margin-top: .25rem; }

.psx-quick {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.15rem;
}

.psx-quick-label { font-size: .82rem; font-weight: 600; color: var(--text-muted); }

.psx-disclaimer {
    font-size: .78rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* ---------- Signal badges ---------- */
.psx-signal {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .38rem .9rem;
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.psx-signal small { font-size: .76rem; font-weight: 600; opacity: .85; }
.psx-strong-buy { background: #0b7a4b; }
.psx-buy { background: #1f8a5c; }
.psx-hold { background: #9a7200; }
.psx-sell { background: #c04a00; }
.psx-strong-sell { background: #b32a3c; }

/* ---------- Result panel ---------- */
.psx-result { min-height: 280px; }

.psx-empty { text-align: center; color: var(--text-muted); padding: 2.5rem 1rem; }
.psx-empty i { display: block; font-size: 2rem; color: var(--primary-color); margin-bottom: .75rem; }
.psx-empty p { font-size: .95rem; }

.psx-result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

.psx-result-sym {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: .03em;
    color: var(--primary-color);
}

.psx-result-name { font-size: 1.12rem; font-weight: 700; line-height: 1.35; }
.psx-result-sector { display: block; font-size: .82rem; color: var(--text-muted); margin-top: .2rem; }

.psx-score-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-bottom: 1.15rem; }

.psx-score {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: .8rem .4rem;
    text-align: center;
}

.psx-score-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-color);
    overflow-wrap: anywhere;
}

.psx-score-lbl { font-size: .74rem; color: var(--text-muted); }

.psx-levels,
.psx-horizons { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.15rem; }

.psx-level,
.psx-horizon {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .75rem;
    background: var(--surface-color);
    border-radius: 10px;
    font-size: .89rem;
}

.psx-level .k,
.psx-horizon .k { flex: 1 1 auto; color: var(--text-muted); text-align: left; }
.psx-level .v { font-weight: 700; text-align: right; }
.psx-level .v small { font-weight: 500; color: var(--text-muted); }
.psx-horizon .v { min-width: 96px; text-align: right; font-weight: 700; }
.psx-horizon .d { min-width: 72px; text-align: right; font-weight: 700; }

.psx-up { color: #0b7a4b; }
.psx-down { color: var(--danger-color); }

.psx-factors { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1.15rem; }

.psx-factor-top {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .25rem;
}

.psx-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.psx-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--brand-gradient); }

.psx-rationale { font-size: .93rem; line-height: 1.65; color: var(--text-muted); }

/* ---------- Prognosis chart ---------- */
.psx-chart-card { margin-top: .5rem; }
.psx-chart-head { text-align: center; margin-bottom: 1rem; }
.psx-chart-head p { font-size: .92rem; margin-top: .3rem; }

.psx-chart-holder { position: relative; height: 320px; }

.psx-chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    font-size: .95rem;
}

.psx-chart-empty[hidden] { display: none; }

/* ---------- Scanner table ---------- */
.psx-table { min-width: 640px; }
.psx-table th:nth-child(2),
.psx-table td:nth-child(2) { text-align: left; }
.psx-td-name { font-weight: 600; }

.psx-sym-link {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: var(--primary-color);
    cursor: pointer;
}

.psx-sym-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.psx-rating {
    display: inline-block;
    min-width: 34px;
    padding: .18rem .5rem;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-color);
    font-weight: 700;
    font-size: .82rem;
}

.psx-signal-cell { white-space: nowrap; }

.psx-table-note {
    font-size: .84rem;
    margin-top: 1.1rem;
    max-width: 72ch;
    margin-left: auto;
    margin-right: auto;
}

.psx-band-table td { font-weight: 600; }

@media (max-width: 640px) {
    .psx-horizon .v { min-width: 0; }
    .psx-horizon .d { min-width: 64px; }
    .psx-chart-holder { height: 260px; }
}