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

/* Root and Body */
html, body {
    font-family: 'Helvetica', sans-serif;
    overflow: hidden;
    background: #000;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Container */
#container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#container > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: fadeIn 1.2s;
}

canvas {
    display: block;
}

#infotext {
    position: fixed;
    bottom: 5px;
    right: 10px;
    max-width: 160px;
    text-align: center;
    font-size: 12px;
    color: #eee;
    font-family: 'Arial', 'Helvetica', sans-serif;
    padding: 8px;
    z-index: 100;
}

/* Splash Screen */
#splash {
    position: absolute;
    width: 200px;
    height: 200px;
    margin: auto;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Loading */
#loadingIcon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.loading {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 0.25rem solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    animation: spin 1s infinite linear;
}

#loadingcontainer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#loadingtext, #detectionText {
    margin-top: 8px;
    font-size: 16px;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    visibility: hidden;
    height: 0;
}

#loadingtext.visible, #detectionText.visible {
    visibility: visible;
    height: auto;
}

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

/* Buttons */
.button-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0 0 20px;
    color: #fff;
}

button {
    height: 30px;
    width: 140px;
    background-color: rgba(128, 128, 128, 0.7);
    color: #fff;
    padding: 0 10px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: Arial, sans-serif;
}

button:hover {
    background-color: rgba(128, 128, 128, 0.8);
}

/* Status Label */
#statusLabel {
    margin-left: 10px;
}

/* Fixed Position Buttons */
#markerbutton, #closingbutton, #linkbutton, #immersivear {
    position: fixed;
    z-index: 100;
    font-family: Arial, Helvetica, sans-serif;
    color: grey;
}

#markerbutton {
    bottom: 5px;
    right: 10px;
    width: 160px;
    height: 50px;
    padding-top: 10px;
    text-align: center;
    font-size: 12px;
}

#closingbutton {
    top: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
    text-align: right;
    font-size: 20px;
    background-color: rgba(128, 128, 128, 0.4);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#linkbutton {
    bottom: 60px;
    left: 10px;
    right: 10px;
    height: 55px;
    background-color: rgba(28, 28, 28, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    color: #fff;
}

#linktext {
    flex: 1;
    text-align: left;
    font-size: 12px;
}

#gotext {
    color: #0a84fe;
    text-align: right;
    margin-right: 15px;
    font-size: 17px;
    text-decoration: none;
}

#immersivear {
    bottom: 5px;
    left: 0;
    max-width: 200px;
    height: 50px;
    text-align: center;
    font-size: 15px;
}

/* Overlay */
#overlay {
    position: absolute;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.5);
    font-size: 16px;
}

#overlay::before {
    position: absolute;
    top: calc(50% + 50px);
    width: 100%;
    white-space: pre-wrap;
    text-align: center;
    color: #949494;
}

#overlay button {
    background: transparent;
    border: 1px solid #fff;
    border-radius: 4px;
    color: #fff;
    padding: 12px 18px;
    text-transform: uppercase;
    cursor: pointer;
}

/* Keyframes */
@keyframes fadeIn {
    0% { opacity: 0; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}
