/* DETECT - Production Version Styles */

:root {
    --bg-dark: #000000;
    --accent-red: #e94560;
    --accent-green: #2ecc71;
    --accent-blue: #00adb5;
    --text-primary: #ffffff;
}

* {
    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;
}

/* Entry Splash Screen */
.entry-splash {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    width: 100dvw;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.entry-content {
    text-align: center;
    animation: fadeIn 0.8s ease-in;
}

.entry-content h1 {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 8px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.entry-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
    letter-spacing: 2px;
}

.enter-btn {
    padding: 18px 50px;
    font-size: 1.1rem;
    font-weight: 700;
    border: 3px solid var(--accent-blue);
    border-radius: 50px;
    background: transparent;
    color: var(--accent-blue);
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.enter-btn:hover {
    background: var(--accent-blue);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 173, 181, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    width: 100vw;
    width: 100dvw;
}

/* 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: contain; /* Changed from cover to show full video */
    /* 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 and performance */
    transform: translateZ(0);
    will-change: auto; /* Changed from transform for better performance */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* No-Zone Overlay - Removed (detection triggers on any person) */

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

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

.loading-content {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 173, 181, 0.2);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#loading-text {
    font-size: 1.2rem;
    color: var(--text-primary);
}

/* Alert Overlay - Static */
.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 Buttons - Below Video */
.controls-overlay {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    padding-bottom: max(15px, env(safe-area-inset-bottom, 0px));
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Better touch targets for mobile */
    min-height: 44px;
    min-width: 44px;
    transition: all 0.2s ease;
}

.control-btn span:first-child {
    font-size: 20px;
}

.control-btn span:last-child {
    font-size: 12px;
    font-weight: 500;
}

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

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

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

.control-btn.danger {
    background: var(--accent-red);
    color: white;
}

.control-btn.danger:hover:not(:disabled) {
    background: #d13a52;
}

.control-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

/* Fullscreen adjustments */
#app:fullscreen,
#app:-webkit-full-screen,
#app:-moz-full-screen {
    flex-direction: row;
}

#app:fullscreen .video-container,
#app:-webkit-full-screen .video-container,
#app:-moz-full-screen .video-container {
    width: 100%;
    height: 100%;
}

#app:fullscreen .controls-overlay,
#app:-webkit-full-screen .controls-overlay,
#app:-moz-full-screen .controls-overlay {
    flex-direction: column;
    padding: 15px 8px;
    padding-right: max(8px, env(safe-area-inset-right, 0px));
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    border-top: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    width: auto;
    gap: 10px;
}

#app:fullscreen .control-btn,
#app:-webkit-full-screen .control-btn,
#app:-moz-full-screen .control-btn {
    width: 60px;
    padding: 10px 8px;
    min-width: 60px;
}

#app:fullscreen .control-btn span:first-child,
#app:-webkit-full-screen .control-btn span:first-child,
#app:-moz-full-screen .control-btn span:first-child {
    font-size: 24px;
}

#app:fullscreen .control-btn span:last-child,
#app:-webkit-full-screen .control-btn span:last-child,
#app:-moz-full-screen .control-btn span:last-child {
    font-size: 10px;
}

/* 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);
    }

    .control-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .alert-content {
        padding: 20px 30px;
    }

    .alert-icon {
        font-size: 3rem;
    }

    .alert-content p {
        font-size: 1.4rem;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .control-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .controls-overlay {
        gap: 10px;
        padding: 12px 15px;
    }

    .alert-content {
        padding: 20px 30px;
        max-width: 90%;
    }

    .spinner {
        width: 50px;
        height: 50px;
    }

    #loading-text {
        font-size: 1rem;
    }
}

/* Very Small Screens */
@media (max-width: 480px) {
    .controls-overlay {
        gap: 8px;
        padding: 10px;
    }

    .control-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .control-btn.primary {
        padding: 12px 20px;
    }

    .alert-content {
        padding: 15px 20px;
    }

    .alert-icon {
        font-size: 2.5rem;
    }

    .alert-content p {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
}
