/* ══════════════════════════════════════════════════════
   Sycoindex — Shared Styles
   Extracted from index.html (base shared CSS)
   ══════════════════════════════════════════════════════ */

/* ── RESET ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── CSS VARIABLES ── */
:root {
    --bg: #ffffff;
    --bg-elevated: #f5f5f5;
    --bg-surface: #ebebeb;
    --border: #d4d4d4;
    --border-subtle: #e5e5e5;
    --text: #111111;
    --text-secondary: #555555;
    --text-dim: #999999;
    --accent: #0055FF;
    --accent-dim: rgba(0, 85, 255, 0.08);
    --red: #dc2626;
    --orange: #d97706;
    --green: #16a34a;
    --mono: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --serif: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-weight: 400;
    font-size: 15px;
}

::selection {
    background: var(--accent);
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── NAV ── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wordmark { display: inline-block; }
.wordmark img { height: 44px; width: auto; vertical-align: middle; }

.nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
}

.nav-links a {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--bg-surface);
}

.nav-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: var(--accent);
    color: #fff;
    padding: 1px 5px;
    border-radius: 2px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.6;
}

/* ── HAMBURGER NAV ── */
.hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 22px;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--text);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1rem;
}

.mobile-menu a {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    display: block;
}

.mobile-menu a:hover { color: var(--accent); }
.mobile-menu.open { display: flex; }

/* ── DARK MODE TOGGLE ── */
.dark-toggle {
    font-family: var(--mono);
    font-size: 11px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.dark-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ── SECTION HEAD (shared) ── */
.section-head {
    font-family: var(--sans);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.section-head em {
    font-style: normal;
    color: var(--text);
}

/* ── RISK BADGES ── */
.risk-badge {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 2px;
    display: inline-block;
}

.risk-low {
    color: var(--green);
    background: rgba(50, 215, 75, 0.1);
    border: 1px solid rgba(50, 215, 75, 0.2);
}

.risk-med {
    color: var(--orange);
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.2);
}

.risk-high {
    color: var(--red);
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

/* ── DELTA / SPARKLINE ── */
.delta {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--text-dim); }
.delta.improved { color: var(--green); }

.sparkline { vertical-align: middle; }

/* ── COMMUNITY CTA ── */
.community-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.community-btn {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.65rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.community-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.community-btn.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.community-btn.primary:hover {
    background: #0044cc;
}

/* ── TABLE SEARCH / FILTER ── */
.table-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.table-filter input {
    font-family: var(--mono);
    font-size: 13px;
    padding: 0.5rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    outline: none;
    width: 260px;
    transition: border-color 0.15s;
}

.table-filter input::placeholder { color: var(--text-dim); }
.table-filter input:focus { border-color: var(--accent); }

.table-filter-count {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
}

/* ── SORTABLE TABLE HEADERS ── */
.board thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    position: relative;
}

.board thead th.sortable:hover {
    color: var(--accent);
}

.board thead th.sortable::after {
    content: '\21C5';
    margin-left: 4px;
    font-size: 9px;
    opacity: 0.4;
}

.board thead th.sortable.sort-asc::after {
    content: '\2191';
    opacity: 1;
    color: var(--accent);
}

.board thead th.sortable.sort-desc::after {
    content: '\2193';
    opacity: 1;
    color: var(--accent);
}

/* ── MOBILE TABLE OVERFLOW ── */
.table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

.table-scroll-wrap::-webkit-scrollbar { height: 4px; }
.table-scroll-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── DIMENSION TOOLTIP ── */
.dim-tip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--text-dim);
}

.dim-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 10;
}

.dim-tip:hover::after {
    opacity: 1;
}

/* ── CHART EXPORT ── */
.chart-export {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: none;
    border: 1px solid var(--border);
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    cursor: pointer;
    float: right;
    transition: all 0.15s;
}

.chart-export:hover { border-color: var(--accent); color: var(--accent); }

/* ── FOOTER ── */
footer {
    margin-top: 2rem;
}

.foot-directory {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.foot-col h4 {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 0.6rem;
}

.foot-col ul {
    list-style: none;
}

.foot-col li {
    margin-bottom: 0.3rem;
}

.foot-col a {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--text-secondary);
    transition: color 0.15s;
}

.foot-col a:hover { color: var(--text); }

.foot-disclaimer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
}

.foot-disclaimer p {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.6;
}

.foot-legal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.foot-copy {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--text-dim);
}

.foot-legal-links {
    display: flex;
    gap: 0;
    list-style: none;
}

.foot-legal-links li {
    display: flex;
    align-items: center;
}

.foot-legal-links li + li::before {
    content: '|';
    color: var(--border);
    font-size: 11px;
    margin: 0 0.75rem;
}

.foot-legal-links a {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--text-secondary);
    transition: color 0.15s;
}

.foot-legal-links a:hover { color: var(--text); }

/* ── DARK MODE ── */
body.dark {
    --bg: #0a0a0a;
    --bg-elevated: #161616;
    --bg-surface: #222222;
    --border: #333333;
    --border-subtle: #282828;
    --text: #e5e5e5;
    --text-secondary: #a0a0a0;
    --text-dim: #666666;
    --accent-dim: rgba(0, 85, 255, 0.15);
}

body.dark nav { background: rgba(10, 10, 10, 0.92); }
body.dark ::selection { background: var(--accent); }

/* ── RESPONSIVE: NAV ── */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-inner { padding: 0 1.5rem; }
    .hamburger { display: inline-flex; }
    .nav-links { display: none !important; }
    .table-filter input { width: 100%; }
}

/* ── RESPONSIVE: FOOTER ── */
@media (max-width: 768px) {
    .foot-directory {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .foot-directory {
        grid-template-columns: 1fr;
    }
}

/* ── ANIMATION: SLIDE UP ── */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
