:root {
    --bg-color: #060609;
    --card-bg: rgba(12, 10, 16, 0.88);
    --primary-color: #ff0055; /* Cyber Pink / Neon Red */
    --primary-glow: rgba(255, 0, 85, 0.55);
    --primary-dark: #80002a;
    --accent-pink: #ff007f;
    --accent-glow: rgba(255, 0, 127, 0.4);
    --text-color: #ffffff;
    --text-muted: #b0a8ba;
    --border-color: rgba(255, 0, 85, 0.35);
    --border-glow: rgba(255, 0, 85, 0.18);
    --error-color: #ff3344;
    --error-glow: rgba(255, 51, 68, 0.6);
    --success-color: #00ff88;
    --success-glow: rgba(0, 255, 136, 0.5);
}

/* Background Grid Setup */
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(rgba(255, 0, 85, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 85, 0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    color: var(--text-color);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
}

/* CRT Scanlines and vertical scrolling bar */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(20, 10, 15, 0) 50%,
        rgba(0, 0, 0, 0.28) 50%
    );
    background-size: 100% 4px;
    z-index: 100;
    pointer-events: none;
}

.scanbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 0, 85, 0.22);
    box-shadow: 0 0 12px rgba(255, 0, 85, 0.6);
    z-index: 101;
    pointer-events: none;
    animation: scan 6s linear infinite;
}

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

.glow-bg {
    position: absolute;
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(255, 0, 85, 0.09) 0%, rgba(0, 0, 0, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
}

/* HUD elements around the screen corners */
.hud-item {
    position: fixed;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72rem;
    color: rgba(255, 0, 85, 0.55);
    letter-spacing: 2px;
    pointer-events: none;
    z-index: 5;
    text-shadow: 0 0 8px rgba(255, 0, 85, 0.3);
    animation: hud-glow 4s ease-in-out infinite alternate;
}

@keyframes hud-glow {
    0% { opacity: 0.45; }
    100% { opacity: 0.9; }
}

.hud-top-left { top: 20px; left: 20px; }
.hud-top-right { top: 20px; right: 20px; }
.hud-bottom-left { bottom: 20px; left: 20px; }
.hud-bottom-right { bottom: 20px; right: 20px; }

/* Fullscreen Intrusion Boot Overlay */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #060609;
    background-image: 
        linear-gradient(rgba(255, 0, 85, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 85, 0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1), transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.intro-overlay.fade-out {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.intro-panel {
    background: rgba(12, 10, 16, 0.95);
    border: 1px solid var(--border-color);
    padding: 40px;
    width: 90%;
    max-width: 480px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 35px rgba(255, 0, 85, 0.25);
}

.intro-panel::before, .intro-panel::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid var(--primary-color);
    pointer-events: none;
}
.intro-panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.intro-panel::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.intro-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.55rem;
    color: var(--primary-color);
    margin-top: 0;
    letter-spacing: 2px;
    text-shadow: 0 0 12px var(--primary-glow);
    animation: text-flicker 3s infinite;
}

@keyframes text-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
    52% { opacity: 0.6; }
    54% { opacity: 0.95; }
}

.intro-hint {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.intro-console {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 0, 85, 0.3);
    padding: 20px;
    height: 160px;
    text-align: left;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.88rem;
    color: var(--primary-color);
    overflow-y: auto;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.intro-line {
    margin-bottom: 6px;
}

.intro-btn {
    margin-top: 10px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 30px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 0 12px var(--border-glow);
    transition: all 0.25s ease;
}

.intro-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 0 22px var(--primary-glow);
}

/* App Main Container */
.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1150px;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-prefix {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.logo {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: 3px;
    color: var(--primary-color);
    text-shadow: 0 0 14px var(--primary-glow);
}

.badge {
    font-family: 'Share Tech Mono', monospace;
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 4px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 0 8px var(--border-glow);
}

/* Cyber Device Selector Cards */
.device-select-container {
    margin-bottom: 20px;
    text-align: left;
}

.device-select-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.device-select-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    box-shadow: 0 0 6px var(--primary-glow);
}

.device-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.device-card {
    background: rgba(18, 14, 22, 0.9);
    border: 1px solid rgba(255, 0, 85, 0.25);
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--border-glow);
    transform: translateY(-2px);
}

.device-card.active {
    border-color: var(--primary-color);
    background: rgba(255, 0, 85, 0.12);
    box-shadow: 0 0 20px var(--primary-glow);
}

.device-card.active::after {
    content: 'SELECTED';
    position: absolute;
    top: 6px;
    right: 10px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.device-icon {
    font-size: 1.8rem;
}

.device-info h4 {
    margin: 0 0 3px 0;
    font-size: 1.05rem;
    letter-spacing: 1px;
    color: #ffffff;
}

.device-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'Share Tech Mono', monospace;
}

/* Cyber Installer Card */
.card {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 28px 36px;
    box-shadow: 
        0 0 30px rgba(255, 0, 85, 0.15), 
        inset 0 0 15px rgba(255, 0, 85, 0.05);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card::before, .card::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--primary-color);
    pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.card::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.ascii-logo {
    font-family: 'Share Tech Mono', monospace;
    color: var(--primary-color);
    font-size: 0.82rem;
    line-height: 1.25;
    margin: 5px 0 15px 0;
    text-align: center;
    white-space: pre;
    display: inline-block;
    filter: drop-shadow(0 0 6px var(--primary-glow));
    animation: text-flicker 5s infinite;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-top: 0;
    margin-bottom: 6px;
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 1rem;
    letter-spacing: 1px;
    line-height: 1.4;
}

/* Status Banner */
.status-banner {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 0, 85, 0.06);
    border: 1px solid rgba(255, 0, 85, 0.2);
    padding: 8px 16px;
    margin-bottom: 20px;
}

.status-indicator {
    width: 9px;
    height: 9px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 10px var(--primary-glow);
}

.status-indicator.warning {
    background-color: #ffb300;
    box-shadow: 0 0 10px rgba(255, 179, 0, 0.6);
}

.status-indicator.error {
    background-color: var(--error-color);
    box-shadow: 0 0 10px var(--error-glow);
}

.status-indicator.flashing {
    animation: status-blink 0.5s infinite alternate;
}

@keyframes status-blink {
    0% { opacity: 0.2; }
    100% { opacity: 1; }
}

.status-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.82rem;
    color: var(--text-color);
    letter-spacing: 1px;
}

/* Info Box */
.info-box {
    background: rgba(18, 12, 20, 0.9);
    border: 1px solid rgba(255, 0, 85, 0.25);
    padding: 16px;
    text-align: left;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.info-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-glow);
}

.info-box ul {
    margin: 0;
    padding-left: 18px;
    color: #f0e6f5;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-box li::marker {
    color: var(--primary-color);
}

/* Connect & Flash Button wrapper */
.button-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-primary {
    background: var(--bg-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 14px 40px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 12px var(--border-glow);
}

.btn-primary:hover {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 0 24px var(--primary-glow);
    transform: scale(1.02);
}

.btn-primary:active {
    transform: scale(1.0);
}

.unsupported-msg {
    color: var(--error-color);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--error-glow);
}

/* Console Log Box */
.console-box {
    margin-top: 20px;
    border: 1px solid rgba(255, 0, 85, 0.25);
    background: rgba(8, 5, 10, 0.95);
    text-align: left;
}

.console-header {
    background: rgba(255, 0, 85, 0.1);
    padding: 6px 12px;
    border-bottom: 1px solid rgba(255, 0, 85, 0.2);
    display: flex;
    align-items: center;
}

.console-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    display: inline-block;
    margin-right: 10px;
    border-radius: 50%;
    box-shadow: 0 0 6px var(--primary-glow);
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.console-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.console-log {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--primary-color);
    padding: 15px;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

.console-line {
    margin-bottom: 6px;
    opacity: 0.9;
}

.console-line.error {
    color: var(--error-color);
    text-shadow: 0 0 6px var(--error-glow);
}

.console-line.success {
    color: var(--success-color);
    text-shadow: 0 0 6px var(--success-glow);
}

/* Custom scrollbars */
.console-log::-webkit-scrollbar, .intro-console::-webkit-scrollbar {
    width: 5px;
}
.console-log::-webkit-scrollbar-track, .intro-console::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}
.console-log::-webkit-scrollbar-thumb, .intro-console::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
}

footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-muted);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 1px;
}

/* Dashboard Layout for 2 Columns */
.dashboard-layout {
    display: flex;
    gap: 30px;
    margin-top: 10px;
    align-items: stretch;
    justify-content: center;
}

.matrix-card {
    flex: 1.3;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 
        0 0 30px rgba(255, 0, 85, 0.15), 
        inset 0 0 15px rgba(255, 0, 85, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
}

.matrix-card::before, .matrix-card::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--primary-color);
    pointer-events: none;
}
.matrix-card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.matrix-card::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.matrix-header {
    background: rgba(255, 0, 85, 0.1);
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 0, 85, 0.2);
    display: flex;
    align-items: center;
}

.matrix-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    display: inline-block;
    margin-right: 10px;
    border-radius: 50%;
    box-shadow: 0 0 6px var(--primary-glow);
    animation: blink 1.2s infinite;
}

.matrix-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--primary-color);
    letter-spacing: 1.5px;
    text-shadow: 0 0 6px var(--primary-glow);
}

.matrix-table-container {
    padding: 15px;
    overflow-y: auto;
    height: 380px;
}

.matrix-terminal {
    background: rgba(5, 3, 8, 0.95);
    border-top: 1px solid rgba(255, 0, 85, 0.25);
    padding: 15px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--primary-color);
    height: 190px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(255, 0, 85, 0.2);
    padding-bottom: 6px;
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.terminal-body {
    flex: 1;
    overflow-y: auto;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

.terminal-prompt {
    color: var(--accent-pink);
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background-color: var(--primary-color);
    animation: terminal-blink 1s infinite;
    vertical-align: middle;
    margin-left: 4px;
}

@keyframes terminal-blink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.matrix-table-container::-webkit-scrollbar {
    width: 6px;
}
.matrix-table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
.matrix-table-container::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.matrix-table th {
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 0, 85, 0.2);
    padding: 10px 8px;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.matrix-table td {
    padding: 9px 8px;
    border-bottom: 1px solid rgba(255, 0, 85, 0.08);
    color: #f0e6f5;
}

.matrix-table tbody tr {
    transition: background-color 0.2s ease;
}

.matrix-table tbody tr:hover {
    background: rgba(255, 0, 85, 0.06);
}

.status-yes {
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 6px rgba(255, 0, 85, 0.4);
}

.status-no {
    color: var(--error-color);
    font-weight: bold;
    text-shadow: 0 0 6px var(--error-glow);
}

.status-auto {
    color: #ffb300;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(255, 179, 0, 0.4);
}

.matrix-table td:nth-child(4) {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Glitch Hologram Logo Widget */
.glitch-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
    background: rgba(10, 6, 14, 0.6);
    border-top: 1px dashed rgba(255, 0, 85, 0.25);
    height: 95px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.glitch-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 12px var(--primary-glow);
    animation: logo-glitch 4.5s infinite ease-in-out;
}

@keyframes logo-glitch {
    0%, 82%, 88%, 93%, 97%, 100% {
        transform: translate(0) scale(1) skewX(0);
        filter: drop-shadow(0 0 8px rgba(255, 0, 85, 0.7));
        opacity: 0.95;
    }
    84% {
        transform: translate(-4px, 2px) skewX(12deg) scaleY(0.92);
        filter: drop-shadow(-4px 0 8px #ff007f) contrast(1.4) hue-rotate(-20deg);
        opacity: 0.8;
    }
    86% {
        transform: translate(4px, -2px) skewX(-12deg) scaleX(1.08);
        filter: drop-shadow(4px 0 8px #00ffff) brightness(1.3);
        opacity: 0.85;
    }
    90% {
        transform: translate(-2px, 3px) scale(0.95);
        filter: drop-shadow(0 0 10px rgba(255, 0, 85, 0.9));
        opacity: 0.9;
    }
    95% {
        transform: translate(3px, -1px) scale(1.06) skewX(5deg);
        filter: drop-shadow(0 0 6px #ff0055) hue-rotate(40deg);
        opacity: 0.75;
    }
}

/* Responsiveness */
@media (max-width: 920px) {
    .hud-item {
        display: none;
    }
    .dashboard-layout {
        flex-direction: column-reverse;
        gap: 25px;
    }
    .container {
        max-width: 600px;
        padding: 15px;
    }
    .card {
        padding: 25px 20px;
    }
    .device-grid {
        grid-template-columns: 1fr;
    }
    .matrix-card {
        flex: none;
        width: 100%;
    }
    .matrix-table-container {
        height: 360px;
    }
}
