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

@font-face {
    font-family: 'Digital-7';
    src: url('https://fonts.cdnfonts.com/css/digital-7-mono') format('woff2');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Courier New', monospace;
    background-color: #000;
    color: #0f0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Loading screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #0f0;
}

.loading-content {
    text-align: center;
    padding: 20px;
    border: 1px solid rgba(0, 255, 0, 0.5);
    background-color: rgba(0, 20, 0, 0.7);
    border-radius: 5px;
    max-width: 80%;
}

.loading-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 0, 0.3);
    border-top: 3px solid rgba(0, 255, 0, 0.8);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

#loading-status {
    margin-bottom: 20px;
}

.loading-instructions {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 20px;
    line-height: 1.5;
}

/* Video and canvas container */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1280px;
    max-height: 720px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

/* Video element */
#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1.1) contrast(1.1);
}

/* Canvas overlay */
#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* HUD overlay elements */
.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        transparent 60%,
        rgba(0, 20, 0, 0.15) 100%
    );
}

/* HUD frame */
.hud-frame {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(0, 255, 0, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.hud-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 255, 0, 0.8) 20%, 
        rgba(0, 255, 0, 0.8) 80%, 
        transparent 100%);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.8);
    animation: scan-line 3s linear infinite;
}

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

/* Enhanced HUD crosshair */
.hud-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(0, 255, 0, 0.7);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px rgba(0, 255, 0, 0.3); }
    50% { box-shadow: 0 0 15px rgba(0, 255, 0, 0.5); }
    100% { box-shadow: 0 0 5px rgba(0, 255, 0, 0.3); }
}

.hud-crosshair::before,
.hud-crosshair::after {
    content: '';
    position: absolute;
    background-color: rgba(0, 255, 0, 0.7);
}

.hud-crosshair::before {
    top: 50%;
    left: -15px;
    right: -15px;
    height: 1px;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
}

.hud-crosshair::after {
    left: 50%;
    top: -15px;
    bottom: -15px;
    width: 1px;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
}

/* Additional targeting elements */
.hud-crosshair::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px dashed rgba(0, 255, 0, 0.3);
    border-radius: 50%;
    animation: rotate 10s linear infinite;
}

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

/* Inner targeting reticle */
.hud-crosshair::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: transparent;
    border: 1px solid rgba(0, 255, 0, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
}

/* Enhanced HUD status display */
.hud-status {
    position: absolute;
    top: 20px;
    left: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: rgba(0, 255, 0, 0.8);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    background-color: rgba(0, 20, 0, 0.3);
    padding: 10px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    width: 200px;
}

#status-text {
    margin-bottom: 5px;
    font-weight: bold;
    letter-spacing: 1px;
}

#detection-count {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 5px;
}

#fps-counter {
    font-size: 12px;
    opacity: 0.9;
}

/* Enhanced HUD corners */
.hud-corners .corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: rgba(0, 255, 0, 0.8);
    border-style: solid;
    border-width: 0;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.corner.top-left {
    top: 20px;
    left: 20px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.corner.top-right {
    top: 20px;
    right: 20px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.corner.bottom-left {
    bottom: 20px;
    left: 20px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.corner.bottom-right {
    bottom: 20px;
    right: 20px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* Add horizon line */
.horizon-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgba(0, 255, 0, 0.5);
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
    z-index: 5;
}

/* Enhanced detection box styling */
.detection-box {
    position: absolute;
    border: 2px solid rgba(0, 255, 0, 0.8);
    background-color: rgba(0, 20, 0, 0.2);
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 2px 5px;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.4);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    border-radius: 2px;
}

.detection-box::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    width: 10px;
    height: 10px;
    border-top: 1px solid rgba(0, 255, 0, 0.8);
    border-left: 1px solid rgba(0, 255, 0, 0.8);
}

.detection-box::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.8);
    border-right: 1px solid rgba(0, 255, 0, 0.8);
}

/* Add HUD grid overlay */
.hud-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 255, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 0, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    opacity: 0.3;
}

/* Add system status indicators */
.system-status {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: rgba(0, 255, 0, 0.8);
    text-align: right;
    background-color: rgba(0, 20, 0, 0.3);
    padding: 10px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
}

/* Add scan effect */
.scan-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 255, 0, 0) 0%,
        rgba(0, 255, 0, 0.1) 50%,
        rgba(0, 255, 0, 0) 100%
    );
    animation: scan 3s linear infinite;
    pointer-events: none;
    z-index: 15;
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Add noise overlay for authentic look */
.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    pointer-events: none;
    z-index: 5;
}

/* Altitude indicator */
.altitude-indicator {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    height: 200px;
    width: 30px;
    background-color: rgba(0, 20, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
}

.altitude-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgba(0, 255, 0, 0.8);
    top: 50%;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.altitude-value {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(0, 255, 0, 0.8);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    white-space: nowrap;
}

/* Targeting info */
.targeting-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: rgba(0, 255, 0, 0.8);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    background-color: rgba(0, 20, 0, 0.3);
    padding: 10px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
}

#target-info {
    margin-bottom: 5px;
}

/* Warning message */
.hud-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: rgba(255, 0, 0, 0.8);
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hud-warning.active {
    opacity: 1;
    animation: blink 1s infinite;
}

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

/* Help panel */
.help-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 900;
    display: none;
    justify-content: center;
    align-items: center;
}

.help-panel.active {
    display: flex;
}

.help-content {
    max-width: 600px;
    padding: 20px;
    background-color: rgba(0, 20, 0, 0.7);
    border: 1px solid rgba(0, 255, 0, 0.5);
    border-radius: 5px;
    color: rgba(0, 255, 0, 0.8);
}

.help-content h2 {
    margin-bottom: 15px;
    text-align: center;
}

.help-content h3 {
    margin: 15px 0 10px;
}

.help-content ul {
    list-style-type: none;
    padding-left: 20px;
}

.help-content li {
    margin-bottom: 5px;
}

.help-content p {
    margin: 10px 0;
    line-height: 1.5;
}

/* Controls */
.controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 800;
}

.hud-button {
    background-color: rgba(0, 20, 0, 0.7);
    color: rgba(0, 255, 0, 0.8);
    border: 1px solid rgba(0, 255, 0, 0.5);
    padding: 8px 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-button:hover {
    background-color: rgba(0, 40, 0, 0.7);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Responsive design */
@media (max-width: 768px) {
    .hud-status, .system-status, .targeting-info {
        font-size: 10px;
        padding: 5px;
    }
    
    .hud-crosshair {
        width: 60px;
        height: 60px;
    }
    
    .altitude-indicator {
        height: 150px;
        width: 20px;
    }
    
    .controls {
        bottom: 10px;
    }
    
    .hud-button {
        padding: 5px 10px;
        font-size: 12px;
    }
}