/* Main styles for 3D Gestures application */
body {
    margin: 0;
    padding: 0;
    background: #000;
    font-family: Arial, sans-serif;
    overflow: hidden;
    touch-action: none; /* Prevents browser handling of gestures */
}

/* Prevent text selection on mobile */
* {
    -webkit-user-select: none;
    user-select: none;
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.9; /* Temporarily increased for debugging */
    filter: brightness(0.6) contrast(0.8);
}

#handCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

#controls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 4;
    background: rgba(0,0,0,0.5); /* More transparent background */
    color: white;
    padding: 15px;
    padding-top: 35px; /* Space for the toggle button */
    border-radius: 10px;
    font-size: 12px;
    max-width: 300px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#controls.hidden {
    transform: translateX(-100%);
    opacity: 0;
}

/* Toggle button styles */
#menu-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.6);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border: none;
    outline: none;
    transition: transform 0.3s ease;
}

#menu-toggle.open {
    left: calc(20px + 15px);
}

#menu-toggle .bar {
    width: 18px;
    height: 2px;
    background: white;
    position: relative;
    transition: all 0.3s ease;
}

#menu-toggle .bar:before,
#menu-toggle .bar:after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

#menu-toggle .bar:before {
    transform: translateY(-5px);
}

#menu-toggle .bar:after {
    transform: translateY(5px);
}

#menu-toggle.active .bar {
    background: transparent;
}

#menu-toggle.active .bar:before {
    transform: rotate(45deg);
}

#menu-toggle.active .bar:after {
    transform: rotate(-45deg);
}

/* Mobile specific styles */
@media (max-width: 768px) {
    #controls {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 10px;
        padding-top: 30px; /* Space for toggle button */
        font-size: 11px;
        max-width: none;
    }
    
    #controls h3 {
        margin-top: 0;
        margin-bottom: 5px;
        font-size: 14px;
    }
    
    #controls p {
        margin: 5px 0;
    }
    
    #menu-toggle {
        top: 10px;
        left: 10px;
        width: 40px; /* Slightly larger for easier tapping */
        height: 40px;
    }
    
    #menu-toggle.open {
        left: 10px;
    }
}

.gesture-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 4;
    background: rgba(0,0,0,0.8);
    color: #00ff00;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .gesture-indicator {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        text-align: center;
        padding: 8px;
    }
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    z-index: 5;
}
