/* DETECT - Development Version Styles */

:root {
    --bg-dark: #1a1a2e;
    --bg-panel: #16213e;
    --accent-red: #e94560;
    --accent-green: #2ecc71;
    --accent-blue: #00adb5;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    /* Mobile optimizations */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Video Container */
.video-container {
    position: relative;
    flex: 1;
    background: #000;
    overflow: hidden;
}

#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Mobile video optimizations */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Hardware acceleration for better mobile performance */
    transform: translateZ(0);
    will-change: transform;
}

/* No-Zone Overlay */
.no-zone-overlay {
    position: absolute;
    right: 0;
    top: 0;
    width: 35%;
    height: 100%;
    background: rgba(233, 69, 96, 0.3);
    border-left: 3px solid var(--accent-red);
    pointer-events: none;
    z-index: 5;
}

.no-zone-overlay.hidden {
    display: none;
}

/* Stats Overlay */
.stats-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(26, 26, 46, 0.9);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.stats-overlay div {
    margin-bottom: 4px;
}

.stats-overlay span {
    color: var(--accent-blue);
    font-weight: bold;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 173, 181, 0.9);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
}

.fullscreen-btn:hover {
    background: var(--accent-blue);
}

/* Alert Overlay - Static (no animations for performance) */
.alert-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(233, 69, 96, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}

.alert-overlay.hidden {
    display: none;
}

.alert-content {
    background: var(--accent-red);
    color: white;
    padding: 30px 50px;
    border-radius: 16px;
    text-align: center;
}

.alert-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
}

.alert-content p {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 0;
}

/* Control Panel */
.control-panel {
    background: var(--bg-panel);
    border-top: 2px solid var(--accent-blue);
    max-height: 50vh;
    overflow-y: auto;
    position: relative;
    z-index: 50;
}

.toggle-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-blue);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-align: left;
}

.toggle-btn:hover {
    background: #009aa1;
}

.controls-content {
    padding: 20px;
    max-height: calc(50vh - 50px);
    overflow-y: auto;
}

.control-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.control-section:last-child {
    border-bottom: none;
}

.control-section h3 {
    margin-bottom: 12px;
    color: var(--accent-blue);
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 12px;
    margin: 6px 0;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #009aa1;
}

.btn-secondary {
    background: #2c3e50;
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: #34495e;
}

.btn-success {
    background: var(--accent-green);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #27ae60;
}

/* Progress Bar */
.progress-container {
    margin: 12px 0;
    text-align: center;
}

.progress-container.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #2c3e50;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
}

#progress-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Form Elements */
label {
    display: block;
    margin: 12px 0 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #2c3e50;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    vertical-align: middle;
}

label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

#confidence-value,
#cooldown-value {
    color: var(--accent-blue);
    font-weight: bold;
}

.info-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 6px 0;
    line-height: 1.5;
}

/* Fullscreen Mode Adjustments */
.video-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
}

.video-container:-moz-full-screen {
    width: 100vw;
    height: 100vh;
}

.video-container:fullscreen {
    width: 100vw;
    height: 100vh;
}

/* Hide controls in fullscreen */
body:fullscreen .control-panel {
    display: none;
}

body:-webkit-full-screen .control-panel {
    display: none;
}

body:-moz-full-screen .control-panel {
    display: none;
}

/* Portrait Mode Adjustments */
@media (orientation: portrait) {
    .no-zone-overlay {
        width: 100%;
        height: 35%;
        top: auto;
        bottom: 0;
        border-left: none;
        border-top: 3px solid var(--accent-red);
    }
    
    .stats-overlay {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .fullscreen-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* Small screens */
@media (max-width: 768px) {
    .control-panel {
        max-height: 40vh;
    }
    
    .controls-content {
        padding: 15px;
    }
    
    .alert-content {
        padding: 20px 30px;
    }
    
    .alert-content p {
        font-size: 1.4rem;
    }
}

/* Scrollbar styling */
.control-panel::-webkit-scrollbar,
.controls-content::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track,
.controls-content::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.control-panel::-webkit-scrollbar-thumb,
.controls-content::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}