:root {
    /* Tech Red Theme */
    --app-bg: #fdfbf7;
    --sidebar-bg: rgba(255, 248, 240, 0.95);
    --glass-border: rgba(139, 0, 0, 0.1);
    --text-primary: #2c2c2c;
    --text-secondary: #5a5a5a;
    --accent-red: #d63b1d;
    /* Signal Red */
    --accent-blue: #007aff;
    /* Data Blue */
    --accent-gold: #c5a059;
    /* Circuit Gold */
    --terminal-bg: #1e1e1e;
    --terminal-text: #00ff00;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);

    --font-family: "Noto Serif SC", "Outfit", serif;
    --font-mono: "JetBrains Mono", monospace;
    --font-title: "Ma Shan Zheng", cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--app-bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('https://images.unsplash.com/photo-1518770660439-4636190af475?q=80&w=2670&auto=format&fit=crop');
    /* Tech/Circuit abstract */
    background-size: cover;
    background-position: center;
}

.app-container {
    width: 90vw;
    height: 85vh;
    max-width: 1400px;
    background: rgba(255, 252, 245, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 380px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

h1 {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 400;
    color: var(--accent-red);
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: -5px;
    font-family: var(--font-mono);
}

.highlight {
    color: var(--text-primary);
}

.controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-grow: 1;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Scan Buttons */
.scan-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scan-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.scan-btn:hover {
    background: #fffdf5;
    border-color: var(--accent-blue);
    transform: translateX(4px);
}

.scan-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.scan-btn[data-scan="gap"].active {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.scan-btn[data-scan="devops"].active {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}

.scan-btn.active .btn-sub {
    color: rgba(255, 255, 255, 0.8);
}

.btn-icon {
    font-size: 1.4rem;
}

.btn-text {
    display: flex;
    flex-direction: column;
}

.btn-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Terminal */
.terminal-window {
    background: var(--terminal-bg);
    border-radius: 8px;
    padding: 12px;
    font-family: var(--font-mono);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 150px;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.terminal-dot {
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    animation: blink 2s infinite;
}

.terminal-title {
    font-size: 0.7rem;
    color: #888;
}

.terminal-content {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 0.75rem;
    color: var(--terminal-text);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-line {
    opacity: 0.9;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.status-item {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.status-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.status-val {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.highlight-blue {
    color: var(--accent-blue);
}

.highlight-red {
    color: var(--accent-red);
}

/* Footer */
.actions-footer {
    margin-top: auto;
}

.secondary-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
}

.secondary-btn:hover {
    background: #f5f5f5;
}

/* Main Stage */
.visualizer-stage {
    flex-grow: 1;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-pane {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.stage-header {
    text-align: center;
    margin-bottom: 1rem;
}

.stage-header h2 {
    font-size: 2rem;
    color: var(--accent-red);
    font-family: var(--font-title);
}

.stage-header p {
    font-size: 1rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    letter-spacing: 1px;
}

/* Circuit Board */
.circuit-board {
    flex-grow: 1;
    position: relative;
    background: #f0f4f8;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* SVG Overlay */
.circuit-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.connection-line {
    stroke: #d1d5db;
    stroke-width: 2;
    fill: none;
    transition: all 0.5s ease;
}

.connection-line.active-h {
    stroke: var(--accent-gold);
    stroke-width: 3;
    filter: drop-shadow(0 0 4px var(--accent-gold));
}

.connection-line.active-s {
    stroke: var(--accent-blue);
    stroke-width: 3;
    filter: drop-shadow(0 0 4px var(--accent-blue));
}

/* Nodes */
.nodes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.team-node {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.team-node:hover {
    transform: scale(1.1);
    z-index: 20;
}

.team-node.dev {
    border-radius: 8px;
}

/* Square for Devs */

/* Node States */
.team-node.highlight-blue {
    border-color: var(--accent-blue);
    background: #e6f0ff;
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.4);
}

.team-node.highlight-red {
    border-color: var(--accent-red);
    background: #ffe6e6;
    box-shadow: 0 0 15px rgba(214, 59, 29, 0.4);
    animation: pulse-red 1.5s infinite;
}

.team-node.highlight-gold {
    border-color: var(--accent-gold);
    background: #fff9e6;
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.4);
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(214, 59, 29, 0.4);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(214, 59, 29, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(214, 59, 29, 0);
    }
}

/* Terminals */
.terminal-node {
    position: absolute;
    padding: 8px 16px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
    z-index: 15;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hardware-term {
    bottom: 20px;
    left: 20px;
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.software-term {
    bottom: 20px;
    right: 20px;
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}