/* Nexus shell — gaming/futurista (PHP layout) */

:root {
    --nx-bg-deep: #0a0e1a;
    --nx-bg-panel: #12182b;
    --nx-bg-card: #1a2238;
    --nx-border: rgba(255, 255, 255, 0.08);
    --nx-cyan: #00f2ff;
    --nx-magenta: #e040fb;
    --nx-purple: #7c4dff;
    --nx-green: #00e676;
    --nx-red: #ff5252;
    --nx-gold: #ffd740;
    --nx-text: rgba(255, 255, 255, 0.92);
    --nx-text-muted: rgba(255, 255, 255, 0.55);
    --nx-sidebar-w: 0px;
    --nx-header-h: 56px;
    --nx-footer-h: 28px;
}

html.nx-shell {
    background-color: var(--nx-bg-deep) !important;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 77, 255, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(0, 242, 255, 0.06), transparent),
        linear-gradient(180deg, var(--nx-bg-deep) 0%, #0d1220 100%) !important;
}

html.nx-shell body {
    color: var(--nx-text);
}

/* Layout */
.nx-app {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

.nx-sidebar {
    display: none !important;
}

.nx-sidebar-brand {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--nx-purple), var(--nx-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    margin-bottom: 12px;
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.35);
}

.nx-sidebar-item {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nx-text-muted);
    text-decoration: none;
    font-size: 1.15rem;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
    position: relative;
}

.nx-sidebar-item:hover {
    color: var(--nx-cyan);
    background: rgba(0, 242, 255, 0.08);
}

.nx-sidebar-item.is-active {
    color: var(--nx-cyan);
    background: rgba(124, 77, 255, 0.2);
    box-shadow: inset 3px 0 0 var(--nx-cyan);
}

.nx-sidebar-item.is-active::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    box-shadow: 0 0 12px rgba(0, 242, 255, 0.25);
    pointer-events: none;
}

.nx-sidebar-spacer { flex: 1; }

.nx-sidebar-status {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nx-green);
    text-align: center;
    padding: 8px 4px;
    line-height: 1.3;
}

.nx-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.nx-header {
    height: var(--nx-header-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    background: rgba(18, 24, 43, 0.85);
    border-bottom: 1px solid var(--nx-border);
    backdrop-filter: blur(12px);
}

.nx-header-brand {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: linear-gradient(90deg, var(--nx-cyan), var(--nx-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nx-header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nx-header-link {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--nx-text-muted);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.nx-header-link:hover,
.nx-header-link.is-active {
    color: var(--nx-text);
    background: rgba(124, 77, 255, 0.15);
}

.nx-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nx-badge-online {
    font-size: 0.7rem;
    color: var(--nx-text-muted);
}

.nx-badge-online strong { color: var(--nx-green); }

.nx-badge-pro {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--nx-purple), var(--nx-magenta));
    color: #fff;
}

.nx-content {
    flex: 1;
    overflow: auto;
    position: relative;
}

/* Rodapé telemetria — barra única, metade da altura do header */
footer.nx-footer,
.nx-footer {
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: var(--nx-footer-h) !important;
    min-height: var(--nx-footer-h) !important;
    max-height: var(--nx-footer-h) !important;
    margin: 0;
    padding: 0 1rem !important;
    background: rgba(8, 12, 22, 0.98);
    border-top: 1px solid var(--nx-border);
    overflow: hidden;
}

.nx-footer-item {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
    flex: 1 1 0;
    white-space: nowrap;
    line-height: 1;
    height: 100%;
}

.nx-footer-label {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nx-text-muted);
    line-height: 1;
    flex-shrink: 0;
}

.nx-footer-label i {
    margin-right: 0.15rem;
    opacity: 0.65;
    font-size: 0.45rem;
}

.nx-footer-value {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--nx-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
}

.nx-footer-item--deriv {
    flex: 1.1 1 0;
}

.nx-footer-item--deriv .nx-footer-value {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nx-footer-item--deriv .nx-footer-value.is-online {
    color: var(--nx-green);
}

.nx-footer-item--deriv .nx-footer-value.is-offline {
    color: var(--nx-red);
}

.nx-footer-item--deriv .nx-live-dot.is-offline {
    background: var(--nx-red);
    box-shadow: none;
    animation: none;
}

/* Sparklines */
.nx-spark {
    width: 36px;
    height: 8px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    display: block;
}

.nx-spark-line {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nx-spark--cyan .nx-spark-line {
    stroke: var(--nx-cyan);
}

.nx-spark--green .nx-spark-line {
    stroke: var(--nx-green);
}

/* Barras de sinal — conexão */
.nx-signal-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 1px;
    height: 7px;
    flex-shrink: 0;
}

.nx-signal-bars i {
    display: block;
    width: 2px;
    border-radius: 1px;
    background: var(--nx-green);
}

/* Dot live */
.nx-live-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--nx-green);
    flex-shrink: 0;
    animation: none;
}

@keyframes nx-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

@media (max-width: 575.98px) {
    .nx-spark { width: 24px; }
}

/* Esconde navbar Flow quando shell Nexus ativo */
.nx-shell .flow-nav { display: none !important; }

/* header_site pode injetar nx-header/footer no body (fora de .nx-main) — mantém só o shell oficial */
html.nx-shell header.nx-header {
    display: none !important;
}

html.nx-shell .nx-main > header.nx-header {
    display: flex !important;
}

html.nx-shell footer.nx-footer,
html.nx-shell .nx-footer {
    display: none !important;
}

html.nx-shell .nx-main > footer.nx-footer,
html.nx-shell .nx-main > .nx-footer {
    display: flex !important;
}

@media (max-width: 991.98px) {
    .nx-header-nav { display: none; }

    html.nx-shell footer.nx-footer,
    html.nx-shell .nx-footer,
    html.nx-shell .nx-main > footer.nx-footer,
    html.nx-shell .nx-main > .nx-footer {
        display: none !important;
    }
}
