/* ─── v1968 · RECOMMENDATION ENGINE / ALGORITHM CARD LAYOUT ─── */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #080c18;
    color: #c8d4e8;
    min-height: 100vh;
}

/* ─── ALGO HEADER ─── */
.algo-header {
    background: linear-gradient(160deg, #050810 0%, #0a1028 60%, #060a18 100%);
    padding: 54px 70px 46px;
    border-bottom: 1px solid #1a2040;
    position: relative;
    overflow: hidden;
}

/* Network node background */
.algo-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(80,120,255,0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(160,80,255,0.04) 0%, transparent 40%);
    pointer-events: none;
}

.algo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(80,120,255,0.12);
    border: 1px solid rgba(80,120,255,0.3);
    color: #5078ff;
    font-size: 0.68em;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 3px;
    margin-bottom: 18px;
}

h1 {
    font-size: 2.2em;
    color: #ffffff;
    max-width: 820px;
    line-height: 1.18;
    margin-bottom: 18px;
    font-weight: 700;
    position: relative;
}

.algo-lead {
    font-size: 1.04em;
    color: #304060;
    max-width: 720px;
    line-height: 1.85;
    position: relative;
}

a { color: #5078ff; font-weight: 700; text-decoration: none; border-bottom: 1px solid #5078ff; }
a:hover { color: #90a8ff; }

/* ─── CONTENT AREA ─── */
.content-wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 44px 70px 70px;
}

/* ─── ALGORITHM SECTION HEADER ─── */
.algo-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
    margin-top: 10px;
}

.ash-node {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #5078ff;
    box-shadow: 0 0 8px rgba(80,120,255,0.6);
    flex-shrink: 0;
}

.ash-text {
    font-size: 0.67em;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #304060;
}

.ash-line { flex: 1; height: 1px; background: rgba(26,32,64,0.8); }

/* ─── RECOMMENDATION ENGINE CARDS ─── */
.rec-engine {
    background: #0a1028;
    border: 1px solid #1a2040;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
}

.re-header {
    background: #080c18;
    border-bottom: 1px solid #1a2040;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reh-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.68em;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #304060;
}

.reh-node {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.node-blue   { background: #5078ff; box-shadow: 0 0 6px rgba(80,120,255,0.6); }
.node-purple { background: #a050ff; box-shadow: 0 0 6px rgba(160,80,255,0.6); }
.node-teal   { background: #20c8b0; box-shadow: 0 0 6px rgba(32,200,176,0.6); }
.node-orange { background: #ff8020; box-shadow: 0 0 6px rgba(255,128,32,0.6); }

.reh-badge {
    font-size: 0.7em;
    padding: 3px 12px;
    border-radius: 3px;
    font-weight: 700;
}

.badge-algo   { background: rgba(80,120,255,0.15);  color: #5078ff; }
.badge-match  { background: rgba(32,200,176,0.15);  color: #20c8b0; }
.badge-new    { background: rgba(160,80,255,0.15);  color: #a050ff; }
.badge-trend  { background: rgba(255,128,32,0.15);  color: #ff8020; }

.re-body {
    padding: 24px 24px 20px;
}

.re-body h2 {
    font-size: 1.2em;
    color: #d8e8ff;
    margin-bottom: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.re-body h3 {
    font-size: 0.82em;
    color: #5078ff;
    margin: 17px 0 7px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.re-body p {
    font-size: 0.94em;
    line-height: 1.87;
    color: #404868;
    margin-bottom: 10px;
}

.re-body p:last-child { margin-bottom: 0; }

/* ─── SIGNAL STRENGTH / MATCH % BARS ─── */
.match-grid { margin: 14px 0; }

.match-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.mr-label {
    font-size: 0.8em;
    color: #5060a0;
    min-width: 140px;
}

.mr-bar-track {
    flex: 1;
    height: 6px;
    background: #1a2040;
    border-radius: 3px;
    overflow: hidden;
}

.mr-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.fill-blue   { background: linear-gradient(to right, #5078ff, #90a8ff); }
.fill-purple { background: linear-gradient(to right, #a050ff, #d090ff); }
.fill-teal   { background: linear-gradient(to right, #20c8b0, #60e8d8); }
.fill-orange { background: linear-gradient(to right, #ff8020, #ffb060); }

.mr-pct {
    font-size: 0.78em;
    color: #c8d4e8;
    font-weight: 700;
    min-width: 38px;
    text-align: right;
}

/* ─── RECOMMENDATION FLOW CARDS ─── */
.flow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 14px 0;
}

.flow-card {
    background: #080c18;
    border: 1px solid #1a2040;
    border-radius: 8px;
    padding: 14px 16px;
}

.fc-signal {
    font-size: 0.6em;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #304060;
    margin-bottom: 5px;
}

.fc-title {
    font-size: 0.88em;
    font-weight: 700;
    color: #c8d4e8;
    margin-bottom: 4px;
}

.fc-match {
    font-size: 0.72em;
    color: #20c8b0;
    font-weight: 700;
}

/* ─── CONNECTION NODES VISUAL ─── */
.node-connection {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin: 10px 0;
    overflow-x: auto;
}

.nc-item {
    background: #0a1028;
    border: 1px solid #1a2040;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.76em;
    color: #5060a0;
    white-space: nowrap;
    flex-shrink: 0;
}

.nc-arrow {
    color: #1a2040;
    font-size: 0.8em;
    flex-shrink: 0;
}

.nc-item.active {
    border-color: #5078ff;
    color: #5078ff;
    background: rgba(80,120,255,0.08);
}

/* ─── TWO-COL ─── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

/* ─── LIST ─── */
ul { list-style: none; margin: 8px 0; }

li {
    padding: 7px 0 7px 20px;
    position: relative;
    font-size: 0.92em;
    color: #404868;
    border-bottom: 1px solid rgba(26,32,64,0.7);
}

li:last-child { border-bottom: none; }

li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #5078ff;
    top: 7px;
    font-size: 0.9em;
}

/* ─── TAG CHIPS ─── */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

.chip {
    background: #0a1028;
    border: 1px solid #1a2040;
    border-radius: 3px;
    padding: 4px 12px;
    font-size: 0.75em;
    color: #304060;
}

footer {
    text-align: center;
    padding: 28px;
    color: #1a2040;
    font-size: 0.82em;
    border-top: 1px solid #1a2040;
}

@media (max-width: 768px) {
    .algo-header, .content-wrap { padding-left: 24px; padding-right: 24px; }
    h1 { font-size: 1.75em; }
    .flow-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
}
