/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    background-color: #000;
    color: #0f0;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* CRT Effect */
.crt-effect {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(0, 16, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: 100;
    pointer-events: none;
}

.screen-flicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    animation: flicker 0.15s infinite alternate;
    z-index: 99;
    pointer-events: none;
    opacity: 0.05;
}

@keyframes flicker {
    0% { background: rgba(0, 255, 0, 0.03); }
    100% { background: rgba(0, 0, 0, 0.1); }
}

/* Terminal Container */
.terminal-container {
    position: relative;
    width: 100%;
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #0f0;
    margin-bottom: 15px;
    background-color: rgba(0, 20, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.system-title {
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 0 5px #0f0;
}

.system-status {
    display: flex;
    gap: 20px;
}

.status-item {
    display: flex;
    gap: 5px;
}

.status-label {
    color: #0a0;
}

.status-value {
    color: #0f0;
    font-weight: bold;
}

.status-value.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { color: #0f0; }
    50% { color: #0a0; }
    100% { color: #0f0; }
}

/* Content Grid */
.content-grid {
    display: flex;
    flex: 1;
    gap: 15px;
    height: calc(100% - 100px);
}

.panel {
    border: 1px solid #0f0;
    background-color: rgba(0, 10, 0, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.left-panel {
    width: 25%;
}

.center-panel {
    width: 45%;
}

.right-panel {
    width: 30%;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    border-bottom: 1px solid #0f0;
    background-color: rgba(0, 20, 0, 0.2);
}

.panel-title {
    font-weight: bold;
    letter-spacing: 1px;
}

.panel-status {
    color: #0a0;
    font-size: 0.9rem;
}

/* Left Panel - Console Output */
.console-output {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #0f0;
}

.console-output::-webkit-scrollbar {
    width: 5px;
}

.console-output::-webkit-scrollbar-track {
    background: rgba(0, 10, 0, 0.1);
}

.console-output::-webkit-scrollbar-thumb {
    background: #0a0;
}

/* Center Panel - Command Line */
.command-line {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #0a0;
}

.prompt {
    margin-right: 10px;
    color: #0f0;
    font-weight: bold;
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #0f0;
    font-size: 1rem;
    outline: none;
    caret-color: #0f0;
}

.response-area {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.3;
}

.response-area::-webkit-scrollbar {
    width: 5px;
}

.response-area::-webkit-scrollbar-track {
    background: rgba(0, 10, 0, 0.1);
}

.response-area::-webkit-scrollbar-thumb {
    background: #0a0;
}

/* Right Panel - HUD Elements */
.hud-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(100px, auto);
    gap: 10px;
    padding: 10px;
    height: 100%;
    overflow-y: auto;
}

.hud-grid::-webkit-scrollbar {
    width: 5px;
}

.hud-grid::-webkit-scrollbar-track {
    background: rgba(0, 10, 0, 0.1);
}

.hud-grid::-webkit-scrollbar-thumb {
    background: #0a0;
}

.hud-element {
    border: 1px solid #0a0;
    background-color: rgba(0, 15, 0, 0.1);
    padding: 8px;
    position: relative;
    overflow: hidden;
}

.hud-element::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid #0f0;
    pointer-events: none;
    opacity: 0.3;
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #0f0;
}

.hud-status {
    color: #0a0;
    font-size: 0.7rem;
}

/* Radar */
.radar-container {
    grid-column: 1;
    grid-row: 1;
}

.radar {
    width: 100%;
    height: 120px;
    border-radius: 50%;
    border: 1px solid #0a0;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

.radar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.radar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.radar-sweep {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.1));
    transform-origin: left center;
    animation: sweep 4s linear infinite;
    border-radius: 100% 0 0 100%;
}

@keyframes sweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.radar-blip {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #0f0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 5px #0f0;
    animation: blip 2s infinite;
}

@keyframes blip {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.radar-info {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.7rem;
}

.radar-info span {
    color: #0f0;
    font-weight: bold;
}

/* Sonar */
.sonar-container {
    grid-column: 2;
    grid-row: 1;
}

.sonar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 1px solid #0a0;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

.sonar-ping {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background-color: #0f0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #0f0;
    animation: ping 3s infinite;
}

@keyframes ping {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(10); opacity: 0; }
}

.sonar-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 1px;
    background-color: rgba(0, 255, 0, 0.3);
    transform-origin: left center;
}

.sonar-info {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.7rem;
}

.sonar-info span {
    color: #0f0;
    font-weight: bold;
}

/* GPS */
.gps-container {
    grid-column: 1;
    grid-row: 2;
}

.gps-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gps-coords {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.8rem;
}

.gps-coords span {
    color: #0f0;
    font-weight: bold;
}

.gps-satellites {
    display: flex;
    justify-content: space-around;
    margin-top: 5px;
}

.satellite {
    width: 10px;
    height: 10px;
    background-color: #0a0;
    border-radius: 50%;
    position: relative;
    animation: satelliteFloat 3s infinite ease-in-out;
}

.satellite::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 15px;
    background-color: rgba(0, 255, 0, 0.3);
}

.sat1 { animation-delay: 0s; }
.sat2 { animation-delay: 0.5s; }
.sat3 { animation-delay: 1s; }
.sat4 { animation-delay: 1.5s; }
.sat5 { animation-delay: 2s; }
.sat6 { animation-delay: 2.5s; }

@keyframes satelliteFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.gps-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 5px;
    background: linear-gradient(90deg, #0f0, #0a0);
    margin-bottom: 5px;
    animation: strengthPulse 3s infinite;
}

@keyframes strengthPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.strength-value {
    font-size: 0.7rem;
    text-align: right;
}

/* Network Status */
.network-container {
    grid-column: 2;
    grid-row: 2;
}

.network-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.network-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.8rem;
}

.network-info span {
    color: #0f0;
    font-weight: bold;
}

.network-graph {
    height: 50px;
    border: 1px solid #0a0;
    position: relative;
    overflow: hidden;
}

.network-graph::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent, rgba(0, 255, 0, 0.05));
}

/* 3D Geometry Screen */
.geometry-container {
    grid-column: 1;
    grid-row: 3;
}

.geometry-canvas {
    width: 100%;
    height: 120px;
    background-color: rgba(0, 10, 0, 0.1);
}

/* NVR Monitors */
.nvr-container {
    grid-column: 2;
    grid-row: 3;
}

.nvr-monitors {
    display: flex;
    gap: 10px;
}

.nvr-monitor {
    flex: 1;
    height: 120px;
    position: relative;
    overflow: hidden;
    border: 1px solid #0a0;
}

.nvr-monitor video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(0, 16, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.3) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
}

.motion-alert {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 0, 0, 0.5);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 5px;
    animation: alertBlink 1s infinite;
}

@keyframes alertBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Radio Scanner */
.radio-container {
    grid-column: 1 / span 2;
    grid-row: 4;
}

.radio-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-frequency {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.radio-frequency span:last-child {
    color: #0f0;
    font-weight: bold;
}

.radio-visualizer {
    height: 40px;
    border: 1px solid #0a0;
    position: relative;
    overflow: hidden;
}

.radio-channels {
    display: flex;
    gap: 5px;
    height: 10px;
}

.channel {
    flex: 1;
    background-color: rgba(0, 255, 0, 0.1);
    border: 1px solid #0a0;
}

.channel.active {
    background-color: #0f0;
    box-shadow: 0 0 5px #0f0;
    animation: channelActive 0.5s infinite alternate;
}

@keyframes channelActive {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #0f0;
    margin-top: 15px;
    background-color: rgba(0, 20, 0, 0.2);
    font-size: 0.8rem;
}

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

/* Blinking Animation */
.blink {
    animation: blink 1s step-end infinite;
}

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

/* Particle Background */
.particle-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}