/* Prevent zooming on mobile devices */
* {
    user-select: none;
    -webkit-user-drag: none;
    touch-action: manipulation; /* Ensures smooth drag on touch devices */
}

html, body {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: #fff;
    font-family: 'Arial', sans-serif;
    font-size: 1.2em;
    line-height: 1.5em;
    overflow: hidden;
    /*border: 1px solid #f8c301;*/
    box-sizing: border-box; /* Ensure the border fits within the screen */
}

#image-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    object-fit: cover;
    position: relative; /* Make it the positioning context for app-logo */
}

#current-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image fills the container while maintaining aspect ratio */
    user-select: none;
    pointer-events: none;
    visibility: hidden; /* Hide initially until fully loaded */
}

/* Button container styles */
.button-container {
    position: absolute;
    font-size: 12px;
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    border: 1px solid #f8c301;
    border-radius: 10px;
    z-index: 10;
    max-width: 90%;
}

.image-set-button {
    background-color: #333;
    color: #fff;
    border: 1px solid #f8c301;
    border-radius: 5px;
    padding: 10px;
    font-size: 1em;
    width: 100px; /* Set a fixed width for uniformity */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.image-set-button:hover {
    background-color: #444;
    color: #f8c301;
}

.image-set-button.active {
    background-color: #f8c301;
    color: #000;
}

.button-icon {
    width: 16px; /* Adjust as needed */
    height: 16px;
    margin-right: 5px;
    filter: invert(89%) sepia(94%) saturate(541%) hue-rotate(1deg) brightness(104%) contrast(103%);
    /* Ensures the icon matches the color scheme */
}


/* Loading overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    border: 1px solid #f8c301;
    box-sizing: border-box;
    z-index: 1000;
}

/* Center the logo above the loading text */
#loading-logo {
    width: 50vw; /* Responsive width */
    max-width: 400px;
    margin-bottom: 20px;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Animated gradient text for loading message */
#loading-overlay p {
    font-size: 5vw; /* Responsive font size for loading text */
    font-weight: bold;
    background: linear-gradient(90deg, #f8c301, #fff, #f8c301);
    background-size: 200%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradient-animation 2s infinite linear;
    padding: 0 10px;
    line-height: 1.2;
    white-space: nowrap;
}

/* Keyframes for gradient animation */
@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* App logo in the bottom-right corner, overlaid on the content */
#app-logo {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 25vw; /* Responsive size */
    max-width: 240px; /* Limit max width on larger screens */
    z-index: 10; /* Ensure it's above other content in image-container */
    pointer-events: none; /* Allows interactions to pass through the logo */
}

#app-logo img {
    width: 100%;
    height: auto;
    opacity: 0.8; /* Slight transparency */
}

.fullscreen-button {
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: #f8c301;
    color: #000;
    border: none;
    border-radius: 5px;
    padding: 8px;
    font-size: 1.5em;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 55px;
    height: 55px;
}

.toggle-button {
    display: none; /* Hide by default */
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px;
    font-size: 24px;
    background: none;
    border: none;
    color: #f8c301;
    cursor: pointer;
    z-index: 15;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Smaller font sizes and spacing for mobile */
    body {
        font-size: 1em;
    }

    .button-container {
        gap: 5px;
        padding: 4px;
    }

    .image-set-button {
        font-size: 0.9em;
        padding: 6px 8px;
    }

    #loading-overlay p {
        font-size: 4vw;
    }

    #app-logo {
        width: 30vw;
    }
}



@media (max-width: 768px), (max-height: 768px) {
    /* Hide button container off the screen initially */
    .button-container {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        background-color: rgba(0, 0, 0, 0.8);
        border-top: 1px solid #f8c301;
        border: none;
        border-top: 1px solid #f8c301;
        border-radius: 0px;
        padding: 8px;
        gap: 6px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 2fr));
        place-items: center;
        transform: translateY(100%); /* Start offscreen */
        transition: transform 0.3s ease; /* Smooth slide in/out transition */
        z-index: 15;
    }

    /* Show the button container when the .visible class is applied */
    .button-container.visible {
        transform: translateY(0); /* Slide into view */
    }

    /* Toggle button for mobile */
    .toggle-button {
        position: fixed;
        top: 10px;
        right: 10px;
        background-color: #f8c301;
        color: #000;
        border: none;
        border-radius: 5px;
        padding: 10px;
        font-size: 1.2em;
        cursor: pointer;
        z-index: 20;
        min-width: 20px;
        min-height: 20px;
        width: 55px;
        height: 55px;
        display: block;
    }

    .fullscreen-button {
        position: absolute;
        top: 10px;
        left: 10px;
        background-color: #f8c301;
        color: #000;
        /*background: none;*/
        border: none;
        cursor: pointer;
        border-radius: 5px;
        padding: 8px;
        font-size: 1.5em;
        width: 55px;
        height: 55px;
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .fullscreen-button img {
        width: 24px;
        height: 24px;
        filter: brightness(0) invert(1); /* White icon on dark backgrounds */
    }


}
