/*
============================================================================
PROJECT: 8086 MICROPROCESSOR SIMULATOR - STYLESHEET
============================================================================
AUTHOR:      Amey Thakur
GITHUB:      https://github.com/Amey-Thakur/8086-ASSEMBLY-LANGUAGE-PROGRAMS
PROFILE:     https://github.com/Amey-Thakur
LICENSE:     MIT License
CREATED:     2021

DESCRIPTION:
Main stylesheet defining the visual language of the simulator.
Implements a modern, dark-themed UI with glassmorphism effects, 
responsive flexbox layouts, and hardware-accelerated animations 
to visualize the internal state of the 8086 microprocessor.
============================================================================
*/

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-editor: #1e1e1e;
    --border: #30363d;
    --text: #c9d1d9;
    --text-dim: #8b949e;
    --accent: #58a6ff;
    --success: #3fb950;
    --error: #f85149;
    --warning: #d29922;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-editor: #ffffff;
    --border: #d0d7de;
    --text: #1f2328;
    --text-dim: #656d76;
    --accent: #0969da;
    --success: #1a7f37;
    --error: #cf222e;
    --warning: #9a6700;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

body {
    background: var(--bg-primary);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #1c2128 100%);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    font-size: 28px;
    line-height: 1;
    color: var(--accent);
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header h1 {
    font-size: 19px;
    font-weight: 700;
    color: #58a6ff;
    letter-spacing: -0.3px;
    animation: title-glow 3s ease-in-out infinite alternate;
}

@keyframes title-glow {
    from {
        text-shadow: 0 0 2px rgba(88, 166, 255, 0.2);
    }

    to {
        text-shadow: 0 0 8px rgba(88, 166, 255, 0.5);
    }
}

.header .subtitle {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 400;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

.btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #eeb62f 0%, #d29922 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(210, 153, 34, 0.4);
    font-weight: 600;
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(210, 153, 34, 0.5);
    border-color: transparent;
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #21262d;
    border-color: var(--accent);
}

.btn-run {
    background: linear-gradient(135deg, var(--success) 0%, #2ea043 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(63, 185, 80, 0.3);
}

.btn-run:hover {
    box-shadow: 0 6px 16px rgba(63, 185, 80, 0.5);
    border-color: transparent;
}

.btn-step {
    background: linear-gradient(135deg, #a371f7 0%, #8957e5 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(137, 87, 229, 0.3);
}

.btn-step:hover {
    box-shadow: 0 6px 16px rgba(137, 87, 229, 0.5);
    border-color: transparent;
}

.btn-danger {
    background: linear-gradient(135deg, var(--error) 0%, #da3633 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(248, 81, 73, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 16px rgba(248, 81, 73, 0.5);
    border-color: transparent;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-dim);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--bg-primary);
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
    transform: rotate(15deg);
}

[data-theme="light"] .btn-secondary:hover {
    background: #e6e9ec;
}

/* Preserve colored button backgrounds in light theme */
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-run,
[data-theme="light"] .btn-step,
[data-theme="light"] .btn-danger {
    color: #fff;
}

[data-theme="light"] .btn-primary:hover,
[data-theme="light"] .btn-run:hover,
[data-theme="light"] .btn-step:hover,
[data-theme="light"] .btn-danger:hover {
    filter: brightness(1.05);
}

[data-theme="light"] .header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #eaeef2 100%);
}

[data-theme="light"] .header h1 {
    color: #1f2328;
}

.main {
    display: flex;
    height: calc(100vh - 90px);
}

.footer {
    height: 30px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-dim);
}

.footer a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 4px;
}

.footer a:hover {
    color: var(--accent);
}

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 15px;
}

.sidebar h3 {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.category {
    margin-bottom: 15px;
}

.category-header {
    padding: 8px 10px;
    background: var(--bg-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header:hover {
    background: var(--border);
}

.category-items {
    display: none;
    padding: 5px 0 5px 15px;
}

.category.open .category-items {
    display: block;
}

.category.open .category-header::after {
    content: '▼';
}

.category-header::after {
    content: '▶';
    font-size: 10px;
}

.program-item {
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.program-item:hover {
    background: var(--border);
    color: var(--text);
}

.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-header {
    padding: 8px 15px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}

.editor-container {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg-editor);
}

.line-numbers {
    width: 40px;
    background: var(--bg-primary);
    color: var(--text-dim);
    text-align: right;
    padding: 15px 5px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    border-right: 1px solid var(--border);
    user-select: none;
    overflow: hidden;
}

.line-number {
    color: var(--text-dim);
}

.line-number.active {
    color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
}

#code-editor {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    color: var(--text);
    resize: none;
    line-height: 1.5;
    white-space: pre;
    overflow: auto;
    tab-size: 4;
}

#code-editor:focus {
    outline: none;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    height: 24px;
}

.right-panel {
    width: 350px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-section {
    border-bottom: 1px solid var(--border);
    padding: 15px;
}

.panel-section h4 {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.registers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.register {
    background: var(--bg-primary);
    padding: 8px;
    border-radius: 4px;
    text-align: center;
}

.register-name {
    font-size: 10px;
    color: var(--text-dim);
}

.register-value {
    font-size: 14px;
    font-family: monospace;
    color: var(--accent);
}

.flags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.flag {
    padding: 4px 10px;
    background: var(--bg-primary);
    border-radius: 4px;
    font-size: 11px;
}

.flag.set {
    background: var(--success);
    color: #fff;
}

.output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#output {
    flex: 1;
    background: var(--bg-primary);
    padding: 10px;
    font-family: monospace;
    font-size: 13px;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    min-height: 0;
    max-height: 100%;
}

.status {
    padding: 10px 15px;
    font-size: 12px;
    color: var(--text-dim);
}

.status.error {
    color: var(--error);
}

.status.success {
    color: var(--success);
}

/* SVG Icon Styles */
.icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
    flex-shrink: 0;
}

.icon-sm {
    width: 14px;
    height: 14px;
}

.icon-lg {
    width: 28px;
    height: 28px;
}

.icon-xl {
    width: 32px;
    height: 32px;
}

.header-logo .icon {
    width: 32px;
    height: 32px;
}

.btn .icon {
    margin-right: 2px;
}

h3 .icon,
h4 .icon {
    margin-right: 6px;
}

/* Lively Animations */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes slide {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(3px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes rotate-reset {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(-360deg);
    }
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-15deg);
    }

    75% {
        transform: rotate(15deg);
    }
}

/* Specific Button Hover Animations */
button[onclick="compileCode()"]:hover .icon {
    animation: spin 2s linear infinite;
}

button[onclick="runCode()"]:hover .icon {
    animation: pulse 1s ease infinite;
}

button[onclick="stepCode()"]:hover .icon {
    animation: slide 1s ease infinite;
}

button[onclick="resetEmulator()"]:hover .icon {
    animation: rotate-reset 0.8s ease;
}

a[href*="github"]:hover .icon {
    animation: wave 1s ease infinite;
}

/* Loading Screen */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

#loading-overlay.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.icon-xxl {
    width: 64px;
    height: 64px;
    color: var(--accent);
}

.pulse-icon {
    animation: pulse-slow 2s ease-in-out infinite;
}

@keyframes pulse-slow {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.loading-text {
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: 10px;
}



/* Progress Bar */
.progress-container {
    width: 200px;
    height: 4px;
    background: #30363d;
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Intelligent Tooltip */
.tooltip {
    position: fixed;
    z-index: 10000;
    max-width: 320px;
    min-width: 260px;
    background: linear-gradient(145deg, rgba(22, 27, 34, 0.95) 0%, rgba(13, 17, 23, 0.98) 100%);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(88, 166, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    font-size: 12px;
    overflow: hidden;
}

.tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(88, 166, 255, 0.08);
    border-bottom: 1px solid var(--border);
}

.tooltip-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tooltip-value {
    font-family: 'Consolas', monospace;
    font-size: 13px;
    color: var(--text);
    background: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 4px;
}

.tooltip-section {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

.tooltip-section:last-child {
    border-bottom: none;
}

.tooltip-section-title {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tooltip-values {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tooltip-value-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tooltip-value-label {
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.tooltip-value-data {
    font-family: 'Consolas', monospace;
    font-size: 12px;
    color: var(--text);
}

.tooltip-context {
    color: var(--text);
    line-height: 1.5;
}

.tooltip-context ul {
    margin: 0;
    padding-left: 16px;
}

.tooltip-context li {
    margin-bottom: 4px;
}

.tooltip-context code {
    background: var(--bg-primary);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: var(--accent);
}

.tooltip-description {
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.5;
}

.tooltip-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.tooltip-status.set {
    background: rgba(63, 185, 80, 0.2);
    color: var(--success);
}

.tooltip-status.clear {
    background: rgba(139, 148, 158, 0.2);
    color: var(--text-dim);
}

/* Register hover effect - Solid Blue like Buttons */
.register {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.register:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.4);
}

.register:hover .register-name {
    color: #fff;
}

.register:hover .register-value {
    color: #fff;
}

/* Flag hover effect - Solid Blue like Buttons */
.flag {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.flag:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.4);
    color: #fff;
}

/* Light theme text adjustments */
[data-theme="light"] .register:hover .register-name,
[data-theme="light"] .register:hover .register-value,
[data-theme="light"] .flag:hover {
    color: #fff;
}

/* Scholarly Tooltip - Clean Design */
.tooltip {
    position: fixed;
    z-index: 10000;
    max-width: 300px;
    min-width: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(88, 166, 255, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all 0.15s ease;
    pointer-events: none;
    font-size: 12px;
    overflow: hidden;
}

.tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(88, 166, 255, 0.1);
    border-bottom: 1px solid var(--border);
}

.tooltip-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--accent);
}

.tooltip-value {
    font-family: 'Consolas', monospace;
    font-size: 12px;
    color: var(--text);
    background: var(--bg-primary);
    padding: 3px 6px;
    border-radius: 4px;
}

.tooltip-section {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.tooltip-section:last-child {
    border-bottom: none;
}

.tooltip-section-title {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.tooltip-section-title .icon {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

.tooltip-values {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tooltip-value-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.tooltip-value-label {
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tooltip-value-data {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: var(--text);
}

.tooltip-context {
    color: var(--text);
    line-height: 1.4;
    font-size: 11px;
}

.tooltip-context ul {
    margin: 0;
    padding-left: 14px;
}

.tooltip-context li {
    margin-bottom: 3px;
}

.tooltip-context code {
    background: var(--bg-primary);
    padding: 1px 3px;
    border-radius: 2px;
    font-family: 'Consolas', monospace;
    font-size: 10px;
    color: var(--accent);
}

.tooltip-description {
    color: var(--text-dim);
    font-size: 10px;
    line-height: 1.4;
    font-style: italic;
}

.tooltip-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tooltip-status.set {
    background: rgba(63, 185, 80, 0.2);
    color: var(--success);
}

.tooltip-status.clear {
    background: rgba(139, 148, 158, 0.15);
    color: var(--text-dim);
}

/* Debug Info Bar */
.debug-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.debug-bar.visible {
    transform: translateY(0);
}

.debug-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
}

.debug-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.debug-instruction {
    color: var(--accent);
    font-weight: 700;
}

.debug-explanation {
    color: var(--text);
    border-left: 1px solid var(--border);
    padding-left: 12px;
    margin-left: 4px;
}

[data-theme="light"] .debug-bar {
    background: rgba(255, 255, 255, 0.9);
    border-top-color: rgba(0, 0, 0, 0.1);
}


/* Footer Refinement */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    /* Proper spacing */
    padding: 16px;
    font-size: 13px;
    color: var(--text-dim);
    margin-top: auto;
    width: 100%;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(88, 166, 255, 0.05);
}

.footer-link:hover {
    background: rgba(88, 166, 255, 0.15);
    transform: translateY(-1px);
    text-shadow: 0 0 12px rgba(88, 166, 255, 0.4);
}

.footer-chip {
    width: 16px;
    height: 16px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-link:hover .footer-chip {
    transform: rotate(180deg) scale(1.1);
    filter: drop-shadow(0 0 4px var(--accent));
}

.copyright {
    opacity: 0.6;
    margin-left: 4px;
}

/* System Bus Animation */
.system-bus {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--accent) 50%,
            transparent 100%);
    background-size: 50% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.footer {
    position: relative;
    /* ensure footer has positioning context */
}

.system-bus.active {
    opacity: 0.8;
    animation: bus-transfer 1s infinite linear;
}

@keyframes bus-transfer {
    0% {
        background-position: -50% 0;
    }

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

.footer-chip.processing {
    animation: chip-pulse 0.2s ease infinite;
    color: var(--accent);
}

@keyframes chip-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ======================================== */
/* Low-Level Security: Protection Features   */
/* ======================================== */

/* Disable Text Selection Globally */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Enable Selection for Critical Content */
#code-editor,
#output,
input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
}