:root {
    --bg-dark: #07090f;
    --sidebar-bg: #0c111c;
    --panel-bg: #111827;
    --text-main: #a9b5c2;
    --text-bright: #e2e8f0;
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.4);
    --purple: #8b5cf6;
    --green: #10b981;
    --pink: #ec4899;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Exo 2', sans-serif;
    overflow-x: hidden;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--cyan);
    border-radius: 4px;
}

/* LAYOUT */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* SIDEBAR TERMINAL */
.side-terminal {
    width: 300px;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(6, 182, 212, 0.2);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.terminal-logo {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
    text-align: center;
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.05) 0%, transparent 100%);
}

.glitch-text {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px var(--cyan), 2px 2px 0px var(--pink);
    letter-spacing: 4px;
}

.sys-status {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--green);
    margin-top: 5px;
    text-transform: uppercase;
}

.nav-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.8rem;
    color: #475569;
    padding: 20px 20px 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.prime-nav {
    display: flex;
    flex-direction: column;
}

.prime-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-bright);
    text-decoration: none;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.prime-link .code {
    font-family: 'Fira Code', monospace;
    color: var(--cyan);
    margin-right: 10px;
    font-size: 0.75rem;
}

.prime-link:hover {
    background: rgba(6, 182, 212, 0.08);
    border-left-color: var(--cyan);
    color: #fff;
}

.sec-nav {
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.text-warn {
    color: var(--pink);
}

.text-crit {
    color: #f59e0b;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px;
}

.cloud-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 4px 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    text-decoration: none;
    border-radius: 2px;
    transition: all 0.2s;
}

.cloud-tag:hover {
    background: var(--cyan);
    color: #000;
    border-color: var(--cyan);
    box-shadow: 0 0 10px var(--cyan-glow);
}

.cloud-tag.hot:hover {
    background: var(--pink);
    border-color: var(--pink);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
}

.list-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-link {
    display: block;
    padding: 6px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    transition: color 0.2s;
}

.list-link:hover {
    color: #f59e0b;
}

/* MAIN AREA */
.main-core {
    flex: 1;
    padding: 40px;
    max-width: calc(100vw - 300px);
}

.section-title {
    font-family: 'Chakra Petch', sans-serif;
    color: #fff;
    font-size: 1.5rem;
    margin: 0 0 25px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: ">>";
    color: var(--cyan);
    margin-right: 15px;
    font-family: 'Fira Code', monospace;
}

/* DATA NODES (Toplist) */
.data-nodes-wrapper {
    margin-bottom: 60px;
}

.data-nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.data-node {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--node-color);
    padding: 20px;
    border-radius: 4px 4px 0 0;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
}

.data-node:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.node-id {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--node-color);
}

.node-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--node-color);
    box-shadow: 0 0 5px var(--node-color);
}

.node-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 20px;
}

.node-action {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #64748b;
    text-align: right;
    transition: color 0.2s;
}

.data-node:hover .node-action {
    color: var(--node-color);
}

/* SIMULATIONS (Games) */
.sim-grid-wrapper {
    margin-bottom: 60px;
}

.sim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.sim-card {
    background: var(--panel-bg);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(6, 182, 212, 0.1);
}

.sim-card:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px var(--cyan-glow);
    border-color: var(--cyan);
}

.sim-img-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.sim-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8) contrast(1.1);
    transition: filter 0.3s;
}

.sim-card:hover .sim-img-wrap img {
    filter: brightness(1) contrast(1.2);
}

.sim-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 182, 212, 0.8);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.sim-card:hover .sim-overlay {
    opacity: 1;
}

.sim-info {
    padding: 15px;
    background: var(--panel-bg);
    text-align: center;
}

.sim-info h3 {
    margin: 0;
    color: var(--text-bright);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* FOOTER */
.terminal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 40px;
}

.footer-modules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.module-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 15px;
}

.sys-tag {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.seo-terminal-block {
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--purple);
    padding: 15px 20px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 30px;
}

.seo-terminal-block strong {
    color: var(--text-bright);
}

.sys-copyright {
    text-align: center;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #475569;
}

.blinking-cursor {
    animation: blink 1s step-end infinite;
    color: var(--cyan);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .app-layout {
        flex-direction: column;
    }

    .side-terminal {
        width: 100%;
        height: auto;
        position: static;
        max-height: 400px;
        border-right: none;
        border-bottom: 1px solid rgba(6, 182, 212, 0.2);
    }

    .main-core {
        max-width: 100vw;
        padding: 20px;
    }

    .footer-modules {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .data-nodes-grid {
        grid-template-columns: 1fr;
    }

    .sim-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* VIEW.PHP SPECIFIC */
.view-app-header {
    background: var(--sidebar-bg);
    padding: 15px 30px;
    border-bottom: 1px solid var(--cyan);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sys-cmd-title {
    font-family: 'Fira Code', monospace;
    color: #fff;
    font-size: 1rem;
    margin: 0;
}

.sys-cmd-title .highlight {
    color: var(--cyan);
}

.btn-terminate {
    background: transparent;
    border: 1px solid var(--pink);
    color: var(--pink);
    padding: 6px 15px;
    font-family: 'Chakra Petch', sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-terminate:hover {
    background: var(--pink);
    color: #fff;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
}

.view-workspace {
    display: flex;
    gap: 20px;
    padding: 30px;
    justify-content: center;
    max-width: 1600px;
    margin: 0 auto;
}

.view-terminal-area {
    flex: 1;
    max-width: 1000px;
}

.cyber-iframe-container {
    background: #000;
    border: 1px solid var(--cyan);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
    position: relative;
    aspect-ratio: 16/9;
}

.view-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Cyber Loading */
.loader-screen {
    height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.prog-bar-container {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
    border-radius: 2px;
    overflow: hidden;
}

.prog-bar-fill {
    height: 100%;
    width: 0;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
    transition: width 3s linear;
}

.prog-text {
    font-family: 'Fira Code', monospace;
    color: var(--cyan);
    font-size: 0.9rem;
}

.route-btn {
    display: inline-block;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    padding: 12px 30px;
    font-family: 'Chakra Petch', sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 1rem;
    background: transparent;
    transition: all 0.2s;
    margin-top: 20px;
}

.route-btn:hover {
    background: var(--cyan);
    color: #000;
    box-shadow: 0 0 15px var(--cyan-glow);
}

.ad-module {
    width: 350px;
    height: 250px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    position: sticky;
    top: 20px;
}

@media (max-width: 1400px) {
    .view-workspace {
        flex-direction: column;
        align-items: center;
    }

    .ad-module {
        position: static;
    }

    .view-terminal-area {
        width: 100%;
        order: 1;
    }

    .ad-left {
        order: 2;
    }

    .ad-right {
        order: 3;
    }
}