.custom-image-selector-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.custom-image-selector-header {
    display: flex;
    justify-content: space-between;
}

.custom-image-selector-preview-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    flex: 1;
    border: 2px solid #afbdcf;
    border-radius: 10px;
    overflow: hidden;
}

.custom-image-selector-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

[data-theme="dark"] .custom-image-selector-preview[data-placeholder="true"] {
    filter: invert(1);
}

.custom-image-selector-btn {
    position: absolute;
    width: 22px;
    height: 22px;
    top: 0.5rem;
    left: 0.5rem;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 0.8rem;
    font-size: 0.9rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.custom-image-selector-btn-trash {
    background-color: #dc3545;
    color: #fff;
}

    .custom-image-selector-btn-trash:hover {
        background-color: #b02a37;
    }

.custom-image-selector-file {
    display: none;
}

.custom-image-selector-icon {
    padding-top: 0.15rem;
    width: 1.5rem;
    height: 1.5rem;
    display: block;
}

.custom-image-selector-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 10px;
}

    .custom-image-selector-loader.active {
        display: flex;
    }

.custom-image-selector-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.custom-image-selector-preview-wrapper.loading .custom-image-selector-preview {
    pointer-events: none;
    opacity: 0.5;
}

.custom-image-selector-preview-wrapper.loading .custom-image-selector-btn-trash {
    pointer-events: none;
    opacity: 0.5;
}
