/* loading - main */
#loading-screen {
    position: fixed;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out;
}

/* loading - image */

#image-spinner {
    position: fixed;
    bottom: calc(40px + var(--footer-height));
    right: 20px;
    z-index: 9999;
}

.image-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--color-accent);
    border-radius: 50%;
    width: 10px;
    height: 10px;
    animation: spin 1s linear infinite;
}

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

/* sidebar */
#container {
    display: flex;
    flex: 1;
    overflow-y: auto;
}

#sidebar {
    width: var(--sidebar-width);
    min-width: 200px;
    background: var(--color-sidebar);
    padding: var(--spacing-small);
    overflow-y: auto;
    position: sticky;
    top: 0;
    z-index: 5;
    transition: background-color 0.3s ease;
}

.folder {
    cursor: pointer;
    padding: var(--spacing-folders);
    display: block;
    position: relative;
    border-radius: var(--border-radius);
    transition: background .2s;
}
.folder:hover, .folder.active {
    background: var(--color-hover);
}
.folder.parent-folder:hover {
    background: var(--color-hover-dark);
}

.nested {
    display: none;
    padding-left: var(--spacing-nested);
}
.expanded > .nested {
    display: block;
}

/* image container */
#image-container {
    flex: 1;
    flex-wrap: wrap;
    padding: var(--spacing-small);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    background-color: var(--color-bg);
    transition: background-color 0.3s ease;
}

.archive-img {
    max-width: 600px;
    max-height: 200px;
    margin: var(--spacing-small);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: border .2s;
}

.archive-img:hover {
    border: 1px solid var(--color-border-hover);
}

/* image preview */
#image-preview {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    color: white
}

.preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
}

#preview-img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: var(--border-radius);
    border: 0px;
}

#preview-img:hover {
    border: 0px;
}

#image-preview .close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 64px;
    cursor: pointer;
    z-index: 1001;
}