.image-preview {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    border: 2px solid var(--background-secondary);
    background-color: var(--background-primary);
    padding: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 10px;
}

.image-preview.allow-zoom-and-drag {
    background-color: transparent;
    border: none;
    pointer-events: auto;
}

.image-preview.allow-zoom-and-drag img {
    cursor: grab;
}

.image-preview .file-info {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: absolute;
    bottom: -25px;
    left: 0;
    text-align: center;
}

.image-preview .file-name {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background-color: var(--background-primary);
    color: var(--text-normal);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 12px;
    box-shadow: 0 0 0 1px var(--background-secondary);
    border: 1px solid var(--background-secondary);
}


.image-preview .file-info span {
    background-color: var(--background-primary);
    color: var(--text-normal);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 12px;
    box-shadow: 0 0 0 1px var(--background-secondary);
    border: 1px solid var(--background-secondary);
}

.image-preview .file-info span:not(:last-child) {
    margin: 0 5px 0 0;
}

.file-size {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.image-preview .file-info span p {
    padding: 0;
    margin: 0;
}

.image-preview .file-info span p:last-child:not(:first-child) {
    color: var(--text-muted);
}

.image-preview.allow-zoom-and-drag .file-name,
.image-preview.allow-zoom-and-drag .file-info {
    display: none;
}

.loading-spinner {
    border: 4px solid var(--background-primary);
    border-top: 4px solid var(--background-tertiary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.preview-media {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: none;
}
