body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}
:root {
    touch-action: pan-x pan-y;
    height: 100% 
  }
#unity-container {
    position: absolute;
    width: 100%;
    height: 100%;
}
.pdf-annotation {
    position: absolute;
    z-index: 102;
    pointer-events: auto; /* Ensure it's clickable */
}
.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
/* Mobile styles */
@media only screen and (max-width: 1080px) {
    #pdf-background {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 99;
        background-image: url('pdf_gradient.png');
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
        touch-action: pan-x pan-y;
    }

    #title-container {
        display: flex;
        justify-content: center; /* Center horizontally */
        align-items: center;
        gap: 10px; /* Space between the elements */
        padding: 5px;
        width: 100%; /* Make the container take the full width */
        position: relative; /* Positions the buttons and text correctly without affecting other elements */
    }
    #mobile-nav-buttons {
        display: flex;
        align-items: center;
        gap: 5px; /* Space between buttons and title */
    }

    #mobile-prev-page-btn,
    #mobile-next-page-btn {
        border: none;
        cursor: pointer;
        background-color: transparent;
        padding: 0;
        margin: 0;
        width: 25px;
        height: 25px;
    }

#mobile-nav-buttons img {
    width: 100%;
    height: auto;
}
    #pdf-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 95%;
        height: 100%;
        display: none;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        z-index: 100;
        padding: 10px;
        touch-action: pan-x pan-y;
    }

    #pdf-title {
        width: 100%;
        text-align: center;
        font-size: 1.2em;
        font-weight: bold;
        padding: 5px;
        touch-action: pan-x pan-y;
        color: white;
    }

    #border-image-container {
        width: 100%;
        height: calc(100% - 60px);
        border-radius: 10px;
        border: 2px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
        display: flex;
        justify-content: center;
        align-items: flex-start;
        overflow: auto;
        padding: 5px;
        padding-top: 25px;
        touch-action: pan-x pan-y;
        /* Ensure content is scrollable */
    }

    #pdf-content {
        width: 100%;
        height: 100%; /* Make sure it takes full height */
        display: block;
        overflow: auto;
        background-color: white;
        touch-action: pan-x pan-y;
        position: relative;  /* Ensure the annotations are positioned relative to this */
    }

    #prev-page-btn,
    #next-page-btn {
        display: none;
    }

    #close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        border: none;
        cursor: pointer;
        z-index: 101;
        background-color: transparent;
        padding: 0;
        margin: 0;
        width: 30px;
        height: 30px;
    }

    button img {
        width: 100%;
        height: auto;
        display: block;
        background-color: transparent;
    }
    .canvas-container {
        display: block;
        width: 100%;
        height: auto;  /* Let the canvas expand vertically */
        position: relative;
        touch-action: pan-x pan-y;
    }

    .pdf-annotation {
        position: absolute;
        z-index: 102;
        pointer-events: auto;
        box-sizing: border-box;
        touch-action: pan-x pan-y;
    }
}

@media only screen and (min-width: 1080px) {

    #pdf-background {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 99;
        background-image: url('pdf_gradient.png');
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
    }

    #pdf-container {
        position: relative;
        width: 30%;
        height: 85%;
        display: none;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        z-index: 100;
    }

    #pdf-title {
        width: 100%;
        text-align: center;
        font-size: 1.5em;
        font-weight: bold;
        padding: 10px;
        color: white;
    }

    #border-image-container {
        width: 100%;
        height: calc(100% - 60px);
        border-radius: 15px;
        border: 5px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        padding-top: 25px;
        /* Ensure content stays within the container */
    }

    #pdf-content {
        width: 95%;
        height: 100%;
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: auto;
        overflow: hidden;
    }

    #prev-page-btn,
    #next-page-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        border: none;
        cursor: pointer;
        z-index: 101;
        background-color: transparent;
        padding: 0;
        margin: 0;
        width: 3vw;
        height: auto;
    }

    #prev-page-btn {
        left: -6vw;
    }

    #next-page-btn {
        right: -6vw;
    }

    #close-btn {
        position: absolute;
        top: -6vh;
        right: -6vh;
        border: none;
        cursor: pointer;
        z-index: 101;
        background-color: transparent;
        padding: 0;
        margin: 0;
        width: 3vw;
        height: auto;
    }

    button img {
        width: 100%;
        height: auto;
        display: block;
        background-color: transparent;
    }

    .pdf-annotation {
        position: absolute;
        z-index: 102;
        pointer-events: auto;
        box-sizing: border-box;
    }
}

@media only screen and (orientation: portrait) {
    #unity-container {
        display: none;
    }
    #loading-screen {
        display: none;
    }
    
    #rotate-device {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        height: 100vh;
        width: 100vw;
        background-image: url('gradient.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        color: white;
    }
}

@media only screen and (orientation: landscape) {
    #unity-container {
        display: block;
    }
    #loading-screen {
        display: block;
    }
    #rotate-device {
        display: none;
    }
}

#rotate-device img {
    width: 100px;
    /* Adjust the size as needed */
    height: auto;
    margin-bottom: 20px;
}

#rotate-device p {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
}

.warning {
    background-color: #b4b6c5;
    padding: 3px;
    border-radius: 5px;
    color: white;
}

#page-title {
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans,
        Droid Sans, Helvetica Neue, sans-serif;
    font-size: 24px;
    line-height: 30px;
    text-align: center;
    margin: auto;
}

#unity-container.unity-desktop {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%)
}

#unity-container.unity-mobile {
    width: 100% !important;
    height: 100% !important;
}

/* Default Unity styles */
body {
    padding: 0;
    margin: 0
}
#unity-canvas {
    background: #231F20;
    display: block;
    width: 100% !important;
    height: 100% !important;
}

#unity-loading-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
}

#loading-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('loadingBG.webp') no-repeat center center;
    background-size: cover;
}

#loading-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 9999; /* Ensure it covers everything else */
    opacity: 1;
    transition: opacity 1s ease; /* This will handle the fade-out effect */
}
#unity-progress-bar-empty {
    width: 100%;
    height: 100%;
}

#unity-progress-bar-full {
    width: 0%;
    height: 100%;
    background: #06285D;
    transition: width 0.3s ease;
}
/* Add styles for the centered logo */
#loading-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 200px; /* Adjust the logo size as needed */
    max-height: 200px;
} 
#unity-footer {
    position: relative;
    display: none; /* Hiding footer as requested */
}
#unity-message {
    position: absolute;
    bottom: 60px; /* Adjust to be above the loading bar */
    left: 50%;
    transform: translateX(-50%);
    color: red; /* Set a visible color */
    font-size: 16px; /* Adjust the size as needed */
    text-align: center;
}
