/* 
 * SYSTEM CORE: NAWARAJ v1.0
 * High-Tech Brutalism Design System
 */

:root {
    /* Palette */
    --color-void: #0a0a0c;
    --color-void-deep: #050506;
    --color-text: #e0e0e0;
    --color-text-dim: #888899;
    --color-cyan: #00f3ff;
    --color-cyan-dim: rgba(0, 243, 255, 0.3);
    --color-magenta: #ff00ff;
    --color-magenta-dim: rgba(255, 0, 255, 0.3);
    --color-panel: #111116;
    --color-border: #22222a;

    /* Metrics */
    --grid-unit: 8px;
    --border-width: 1px;
    --border-radius-sm: 2px;
    --border-radius-lg: 4px;

    /* Typography */
    --font-mono: 'Courier Prime', 'Roboto Mono', monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Effects */
    --glow-cyan: 0 0 10px var(--color-cyan-dim);
    --glow-magenta: 0 0 10px var(--color-magenta-dim);
    --scanline-speed: 8s;
}

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

html,
body {
    height: 100%;
    width: 100%;
    background-color: var(--color-void);
    color: var(--color-text);
    font-family: var(--font-sans);
    overflow-x: hidden;
    /* Allow vertical scrolling */
}

a {
    color: var(--color-cyan);
    text-decoration: none;
    transition: all 0.2s ease;
}

/* ... existing code ... */

/* Layout Structure */
.system-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background:
        linear-gradient(rgba(10, 10, 12, 0.9), rgba(10, 10, 12, 0.9)),
        repeating-linear-gradient(0deg, transparent, transparent 1px, #1a1a20 1px, #1a1a20 2px) 0 0 / 100% 4px;
    background-attachment: fixed;
    /* Keep background static while scrolling */
    animation: scanline var(--scanline-speed) linear infinite;
}

@keyframes scanline {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}

/* Components: Panels */
.panel {
    background-color: var(--color-panel);
    border: var(--border-width) solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-cyan);
    opacity: 0.5;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--grid-unit);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: var(--border-width) solid var(--color-border);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

/* Header */
.system-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    border-bottom: var(--border-width) solid var(--color-border);
    background: var(--color-void-deep);
    z-index: 10;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.brand span {
    color: var(--color-cyan);
}

.nav-link {
    margin-left: 2rem;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-link.active,
.nav-link:hover {
    opacity: 1;
    color: var(--color-cyan);
    border-bottom: 2px solid var(--color-cyan);
}

/* Main Viewport */
.viewport {
    flex: 1;
    position: relative;
    padding: calc(var(--grid-unit) * 2);
    /* Removed overflow-y: auto to use window scroll */
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: calc(var(--grid-unit) * 2);
    height: 100%;
    min-height: 600px;
    /* Ensure minimum height on large screens */
}

.widget {
    grid-column: span 4;
    grid-row: span 3;
}

.widget-large {
    grid-column: span 8;
    grid-row: span 4;
}

/* Identity / Avatar Specifics */
.avatar-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.avatar-container {
    width: 400px;
    height: 500px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.avatar-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    pointer-events: none;
    will-change: transform;
}

/* Timeline */
.timeline {
    padding: var(--grid-unit);
}

.timeline-item {
    border-left: 2px solid var(--color-border);
    padding-left: calc(var(--grid-unit) * 2);
    margin-bottom: calc(var(--grid-unit) * 3);
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    width: 8px;
    height: 8px;
    background: var(--color-void);
    border: 2px solid var(--color-cyan);
    border-radius: 50%;
}

/* Footer / Status Bar */
.system-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 calc(var(--grid-unit) * 3);
    border-top: var(--border-width) solid var(--color-border);
    background: var(--color-void-deep);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-dim);
}

/* Utilities */
.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.hidden {
    display: none;
}

/* ... existing code ... */

/* Responsive */
@media (max-width: 900px) {
    .dashboard-grid {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .widget,
    .widget-large {
        width: 100%;
        min-height: auto;
        margin-bottom: 1rem;
    }

    .avatar-container {
        width: 100%;
        max-width: 400px;
        height: 50vh;
        min-height: 300px;
    }

    .identity-split {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .panel {
        overflow: visible;
        /* Let content expand container */
        height: auto;
    }
}

@media (max-width: 768px) {
    .system-header {
        padding: 0 var(--grid-unit);
        flex-wrap: wrap;
        height: auto;
        padding-bottom: 0.5rem;
    }

    .brand {
        padding: 0.5rem 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--color-border);
        margin-bottom: 0.5rem;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        width: 100%;
    }

    .nav-link {
        margin-left: 0;
        font-size: 0.8rem;
        padding-bottom: 0.2rem;
    }

    .viewport {
        padding: 1rem;
    }

    /* Stack identity sections */
    .identity-split {
        display: flex;
        flex-direction: column;
    }

    .avatar-stage {
        height: 40vh;
        min-height: 300px;
    }
}

/* Chatbot Module */
.chatbot-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 350px;
    background: var(--color-panel);
    border: var(--border-width) solid var(--color-cyan);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
    z-index: 1000;
    font-family: var(--font-mono);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.chatbot-container.minimized {
    transform: translateY(calc(100% - 40px));
}

.chatbot-header {
    background: var(--color-cyan-dim);
    padding: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--color-cyan);
}

.chatbot-header span {
    color: var(--color-cyan);
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.chatbot-messages {
    height: 300px;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.message {
    max-width: 85%;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.bot {
    align-self: flex-start;
    color: var(--color-cyan);
    border-left: 2px solid var(--color-cyan);
    background: rgba(0, 243, 255, 0.05);
}

.message.user {
    align-self: flex-end;
    color: var(--color-text);
    border-right: 2px solid var(--color-magenta);
    background: rgba(255, 0, 255, 0.05);
    text-align: right;
}

.chatbot-input-area {
    padding: 0.8rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 0.5rem;
    background: var(--color-void-deep);
}

.chatbot-input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.5rem;
    font-family: var(--font-mono);
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: var(--color-cyan);
}

.chatbot-send {
    background: var(--color-cyan-dim);
    border: 1px solid var(--color-cyan);
    color: var(--color-cyan);
    padding: 0 1rem;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: all 0.2s;
}

.chatbot-send:hover {
    background: var(--color-cyan);
    color: var(--color-void);
}

/* Diagnostics Module - Pro Layout */
.diagnostics-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    /* Asymmetric split */
    grid-template-rows: auto 1fr;
    gap: 1.5rem;
    height: 100%;
}

.diag-panel {
    background: rgba(17, 17, 22, 0.6);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

/* Visual Hierarchy Rules */
#panel-matrix {
    /* Primary focus */
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.05);
    filter: brightness(1);
}

#panel-lang {
    /* Secondary control panel */
    filter: brightness(0.9);
}

#panel-stack {
    /* Data layer */
    filter: brightness(0.85);
}

#panel-log {
    /* Activity log */
    filter: brightness(0.8);
    background: rgba(10, 10, 12, 0.8);
}

.diag-header {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-cyan);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

/* Scanline Overlay for Container */
.diagnostics-grid::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.1),
            rgba(0, 0, 0, 0.1) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 5;
    opacity: 0.3;
}



/* Language Engine */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    flex: 1;
}

.lang-node {
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-mono);
    font-weight: bold;
    color: var(--color-text);
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
}

.lang-node:hover {
    border-color: var(--color-cyan);
    color: var(--color-cyan);
    box-shadow: 0 0 15px var(--color-cyan-dim);
    background: rgba(0, 243, 255, 0.05);
}

.lang-node.pulse {
    animation: neonPulse 3s infinite alternate;
}

@keyframes neonPulse {
    0% {
        box-shadow: 0 0 5px rgba(0, 243, 255, 0.1);
        border-color: var(--color-border);
    }

    100% {
        box-shadow: 0 0 12px rgba(0, 243, 255, 0.3);
        border-color: rgba(0, 243, 255, 0.5);
    }
}


/* Framework Matrix */
.terminal-list {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-dim);
    list-style: none;
    line-height: 1.8;
}

.terminal-list li {
    display: flex;
    justify-content: space-between;
}

.status-active {
    color: var(--color-cyan);
}

.status-stable {
    color: #0f0;
}

.status-loaded {
    color: var(--color-magenta);
}

.cursor-blink::after {
    content: '_';
    animation: blink 1s infinite;
}


/* Intelligence Stack */
.stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-content: flex-start;
}

.tech-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    padding: 0.3rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-dim);
    transition: all 0.2s;
}

.tech-tag:hover {
    border-color: var(--color-cyan);
    color: var(--color-cyan);
    transform: translateY(-2px);
}

.tag-prefix {
    color: var(--color-magenta);
    margin-right: 4px;
    opacity: 0.8;
}


/* Responsive Diagnostics */
@media (max-width: 900px) {
    .diagnostics-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .diag-panel {
        min-height: 300px;
    }
}