:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --primary-color: #ff003c; /* Cyberpunk Red */
    --secondary-color: #fcee0a; /* Cyberpunk Yellow */
    --accent-color: #00f0ff; /* Cyberpunk Blue */
    --panel-bg: #111;
    --border-color: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glitch Effect & Scanlines */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 10;
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: rgba(0, 255, 0, 0.1);
    animation: scan 3s linear infinite;
    pointer-events: none;
    z-index: 11;
}

@keyframes scan {
    0% { top: -5px; }
    100% { top: 100%; }
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--primary-color);
    background: #000;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--text-color);
}

.glitch {
    position: relative;
    color: var(--text-color);
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--primary-color);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--accent-color);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 30px, 0); }
    20% { clip: rect(80px, 9999px, 100px, 0); }
    40% { clip: rect(10px, 9999px, 50px, 0); }
    60% { clip: rect(40px, 9999px, 60px, 0); }
    80% { clip: rect(20px, 9999px, 70px, 0); }
    100% { clip: rect(60px, 9999px, 90px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(60px, 9999px, 70px, 0); }
    20% { clip: rect(10px, 9999px, 20px, 0); }
    40% { clip: rect(30px, 9999px, 50px, 0); }
    60% { clip: rect(80px, 9999px, 90px, 0); }
    80% { clip: rect(50px, 9999px, 60px, 0); }
    100% { clip: rect(20px, 9999px, 30px, 0); }
}

.status-bar span {
    margin-left: 15px;
    font-size: 0.9rem;
}

.status.error { color: var(--primary-color); animation: blink 1s infinite; }
.status.warning { color: var(--secondary-color); }

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

/* Main Layout */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

.dashboard {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    flex: 1;
    min-width: 300px;
}

h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-transform: uppercase;
    font-size: 1.2rem;
}

/* Dependency Graph */
.graph-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.node {
    padding: 10px 20px;
    border: 1px solid #555;
    width: 80%;
    text-align: center;
    background: #222;
}

.node.infected {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 0, 60, 0.3);
}

.node.warning {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.node.safe {
    border-color: #0f0;
    color: #0f0;
}

.connector {
    width: 2px;
    height: 20px;
    background: #555;
}

.alert-box {
    margin-top: 20px;
    padding: 10px;
    background: rgba(255, 0, 60, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Pipeline Status */
.pipeline-steps {
    list-style: none;
}

.step {
    padding: 10px;
    border-bottom: 1px solid #222;
}

.step span {
    margin-right: 10px;
    font-weight: bold;
}

.step.success span { color: #0f0; }
.step.error span { color: var(--primary-color); }
.step.warning span { color: var(--secondary-color); }
.step.pending span { color: #777; }

.btn-danger {
    margin-top: 20px;
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.3s;
}

.btn-danger:hover {
    background: #d00030;
}

/* Logs */
.logs {
    flex: 1;
    background: #000;
    border: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    max-height: 300px;
}

.terminal {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

.terminal p { margin-bottom: 5px; }
.timestamp { color: #777; margin-right: 10px; }
.cmd { color: #fff; }
.warn { color: var(--secondary-color); font-weight: bold; }
.err { color: var(--primary-color); font-weight: bold; }
.info { color: var(--accent-color); }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.hidden { display: none; }

.modal-content {
    background: #111;
    border: 2px solid var(--primary-color);
    padding: 30px;
    width: 500px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 0 20px rgba(255, 0, 60, 0.5);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

.close-modal:hover { color: #fff; }

textarea {
    width: 100%;
    height: 150px;
    background: #000;
    border: 1px solid #333;
    color: #0f0;
    padding: 10px;
    margin: 20px 0;
    resize: none;
}

.btn-primary {
    width: 100%;
    padding: 10px;
    background: var(--accent-color);
    color: #000;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

.btn-primary:hover {
    background: #00c0cc;
}

#restore-result {
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
}
