/* =======================================================================================================
===========================================BASIC STYLES==================================================
==========================================================================================================
========================================================================================================== */
html {
    cursor: grab;
}
body {
    margin: 0;
    background-color: #eaeaec;
    font-family: myriad-pro-condensed, sans-serif;
    font-weight: 600;
    font-style: normal;
    font-size: 14px;
    color: #505050;
    user-select: none;
    background-size: 20px 20px;
    background-image:
    linear-gradient(to right, rgb(213, 202, 255) .5px, transparent .5px),
    linear-gradient(to bottom, rgb(213, 202, 255) .5px, transparent .5px);
}
a{
    text-decoration: none;
    color: inherit;
    animation:transform 0.2s ease-in-out;
    user-select: none;
    -webkit-user-drag: none;
}
a:hover{color:black; text-decoration: underline;}
img{
    user-select: none;
    -webkit-user-drag: none;
}
h3{
    width:fit-content;
    white-space: nowrap;
}
#canvas {
    position: static;
    width:0.1px;
    height:0.1px;
    transform-origin: 0 0;
}
.center{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1; /* Ensure it's above other elements if needed */
    display: flex;
    justify-content: center;
    align-items: center;
}
.centered-gif {
    display: block;   /* Ensure it's a block-level element */
    opacity: 1;       /* Make sure it's visible */
    z-index: -1;
    width:30vw;
    transform: rotate(5deg);
    opacity: .7;
}
.container{
    width: fit-content;
    height: fit-content;
    position:absolute;
    user-select: none;
}
.item {
    position:absolute;
    width: fit-content;
    height: fit-content;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    cursor:pointer;
    user-select: none;
}
.item:hover {transform: scale(1.01); z-index: 10;}
.image {
    position:absolute;
    border-radius: 3px;
    cursor: zoom-in;
    transition: transform 0.2s ease-in-out;
    user-select: none;
}
.image:hover {transform: scale(1.5); z-index: 10;}

.controls-info {
    position:absolute;
    top: 2vh;
    left: 2vw;
    padding: 10px;
    border-radius: 3px;
    z-index: 100;
}

.controls-info label {
    display: flex;
    align-items: center;
    margin: 5px;
}

.controls-info input[type="checkbox"]{
    appearance: none;
    -webkit-appearance: none;
    margin-right: 8px;
    height: 13px;
    width: 13px;
    border:rgb(0, 30, 0) 2px solid;
    border-radius: 10px;
    cursor: pointer;
}
.controls-info input[type="checkbox"]:checked {background-color: rgb(80, 40, 240);}

#reset-button {
    position: relative;
    padding-bottom: 20px;
    z-index: 100;
    padding: 8px 16px;
    cursor: pointer;
    color:white;
    background-color: rgb(80, 40, 240);
    border-radius: 50px;
    border:rgb(0, 30, 0) 2px solid;
    font-size:1.1em;
    font-family: myriad-pro-condensed, sans-serif;
    font-weight: 600;
    font-style: normal;
}
#reset-button:hover{
    animation: button-slide 0.1s ease-in-out forwards;
}
@keyframes button-slide {
    0% { transform: translateX(0px) scale(1.0); }
    100% { transform: translateX(1px) scale(1.01); }
}
#canvas.smoothing {transition: transform 0.75s cubic-bezier(0.25, 1, 0.5, 1);}
/* =======================================================================================================
=====================================LOADING SCREEN STYLE=============================================
==========================================================================================================
========================================================================================================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #eaeaec; /* Same as body background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #d1d1d1;
    border-top-color: rgb(80, 40, 240);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* --- Initial State for Main Content --- */
/* By default, the main content is invisible */
#canvas, .controls-info {
    opacity: 0;
    transition: opacity 0.5s ease-in 0.2s; /* Delay the fade-in slightly */
}
/* --- Loaded State --- */
/* When the 'loaded' class is added to the body via JS... */
body.loaded #loading-screen {
    opacity: 0;
    pointer-events: none; /* Make it non-interactive after it fades out */
}
body.loaded #canvas, body.loaded .controls-info {
    opacity: 1; /* Fade in the main content */
}
/* =======================================================================================================
======================================OFFSCREEN INDICATOR STYLE==========================================
==========================================================================================================
========================================================================================================== */
/* --- Offscreen Item Indicator --- */
#offscreen-indicator {
    position: fixed;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgb(0, 30, 0);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    
    /* Center the pseudo-element pointer */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Start hidden and prepare for transitions */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.1s linear;
    z-index: 1000;
    
    /* The transform is controlled by JS. We offset by half the size to center the element on its coordinates. */
    transform: translate(-50%, -50%); 
}

/* The little pointer arrow inside the circle */
#offscreen-indicator::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 6px 9px 6px;
    border-color: transparent transparent rgb(0, 30, 0) transparent;
    transform: translateY(-2px); /* Nudge it towards the center */
}
/* =======================================================================================================
==========================================================================================================
==========================================================================================================
========================================================================================================== */