:root {
    --vh: 1vh;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    position: fixed;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2em;
    z-index: 100;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

#loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-progress {
    width: 80%;
    max-width: 300px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    margin: 20px 0;
    border-radius: 2px;
    overflow: hidden;
}

#loading-progress-bar {
    height: 100%;
    width: 0%;
    background: #fff;
    transition: width 0.3s ease;
}

#instructions {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    background: rgba(0,0,0,0.7);
    padding: 15px;
    box-sizing: border-box;
    z-index: 50;
    font-size: 0.9em;
    display: none;
}

#ar-scene-container {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 5;
}

a-scene {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* Fix for Chrome viewport issues */
.a-canvas, canvas.a-canvas {
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 0 !important;
}

/* Hide all MindAR UI elements */
.mindar-ui-overlay, .mindar-image-target-box {
    display: none !important;
}

/* Error message styling */
#error-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    color: white;
    z-index: 200;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

#error-message button {
    background: #fff;
    color: #000;
    border: none;
    padding: 10px 20px;
    margin-top: 20px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
}

/* Debug panel styles */
#debug-panel {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px;
    font-family: monospace;
    font-size: 12px;
    border-radius: 4px;
    max-width: 80%;
    max-height: 30%;
    overflow: auto;
    z-index: 1000;
    display: none; /* Only show when debugging is enabled */
}

/* Video styles for A-Frame - critical for visibility */
a-video, a-plane {
    visibility: visible !important;
}

/* Fix for z-fighting in mobile */
.a-enter-vr, .a-orientation-modal {
    display: none !important;
}